/* DealSpark App Theme - Shared Styles */

:root {
  --navy: #0a1628;
  --navy-light: #132039;
  --navy-lighter: #1a2d4a;
  --electric: #3b82f6;
  --electric-glow: #60a5fa;
  --gold: #f59e0b;
  --gold-light: #fbbf24;
  --white: #ffffff;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-400: #94a3b8;
  --gray-600: #475569;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --purple: #8b5cf6;
  --cyan: #06b6d4;
  --pink: #ec4899;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
  background: var(--navy);
  color: var(--white);
  line-height: 1.6;
  min-height: 100vh;
}

/* Animated background */
.bg-grid {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    linear-gradient(rgba(59, 130, 246, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

.glow-orb {
  position: fixed;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.1;
  pointer-events: none;
  z-index: 0;
}

.glow-orb-1 {
  background: var(--electric);
  top: -200px;
  right: -100px;
  animation: float 20s ease-in-out infinite;
}

.glow-orb-2 {
  background: var(--gold);
  bottom: -200px;
  left: -100px;
  animation: float 25s ease-in-out infinite reverse;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* Layout */
.app-container {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* Sidebar */
.sidebar {
  width: 280px;
  background: rgba(19, 32, 57, 0.8);
  backdrop-filter: blur(20px);
  border-right: 1px solid rgba(59, 130, 246, 0.1);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(59, 130, 246, 0.1);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--white);
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--electric), var(--electric-glow));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
}

.logo-icon svg {
  width: 24px;
  height: 24px;
  color: white;
}

.logo-text {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
  overflow-y: auto;
}

/* Custom scrollbar for sidebar */
.sidebar-nav::-webkit-scrollbar {
  width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(59, 130, 246, 0.3);
  border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(59, 130, 246, 0.5);
}

/* Firefox scrollbar */
.sidebar-nav {
  scrollbar-width: thin;
  scrollbar-color: rgba(59, 130, 246, 0.3) transparent;
}

.nav-section {
  margin-bottom: 1.5rem;
}

.nav-section-title {
  padding: 0.5rem 1.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gray-400);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  color: var(--gray-400);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.nav-link:hover {
  color: var(--white);
  background: rgba(59, 130, 246, 0.1);
}

.nav-link.active {
  color: var(--electric-glow);
  background: rgba(59, 130, 246, 0.15);
  border-left-color: var(--electric);
}

.nav-link svg {
  width: 20px;
  height: 20px;
  opacity: 0.7;
}

.nav-link.active svg {
  opacity: 1;
}

.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(59, 130, 246, 0.1);
}

.logout-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  width: 100%;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 10px;
  color: #f87171;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.logout-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
}

.logout-btn svg {
  width: 20px;
  height: 20px;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: 280px;
  min-height: 100vh;
}

@media (max-width: 768px) {
  .main-content {
    margin-left: 0;
  }
}

/* Mobile Header */
.mobile-header {
  display: none;
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 1rem 1.5rem;
  background: rgba(19, 32, 57, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(59, 130, 246, 0.1);
}

@media (max-width: 768px) {
  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
}

.menu-btn {
  background: none;
  border: none;
  color: var(--white);
  cursor: pointer;
  padding: 0.5rem;
}

.menu-btn svg {
  width: 24px;
  height: 24px;
}

/* Page Content */
.page-content {
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .page-content {
    padding: 1.5rem;
  }
}

/* Page Header */
.page-header {
  margin-bottom: 2rem;
}

.page-title {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 2.5rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--white), var(--gray-200));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-subtitle {
  color: var(--gray-400);
  font-size: 1rem;
}

/* Cards */
.card {
  background: rgba(19, 32, 57, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(59, 130, 246, 0.1);
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(59, 130, 246, 0.1);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.card-header-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.card-header-icon.blue { background: rgba(59, 130, 246, 0.2); }
.card-header-icon.green { background: rgba(16, 185, 129, 0.2); }
.card-header-icon.red { background: rgba(239, 68, 68, 0.2); }
.card-header-icon.gold { background: rgba(245, 158, 11, 0.2); }
.card-header-icon.purple { background: rgba(139, 92, 246, 0.2); }
.card-header-icon.cyan { background: rgba(6, 182, 212, 0.2); }

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--white);
}

.card-body {
  padding: 1.5rem;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: rgba(19, 32, 57, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(59, 130, 246, 0.1);
  border-radius: 16px;
  padding: 1.25rem;
  transition: all 0.3s;
}

.stat-card:hover {
  border-color: rgba(59, 130, 246, 0.3);
  transform: translateY(-2px);
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
}

.stat-icon.blue { background: rgba(59, 130, 246, 0.2); }
.stat-icon.green { background: rgba(16, 185, 129, 0.2); }
.stat-icon.gold { background: rgba(245, 158, 11, 0.2); }
.stat-icon.purple { background: rgba(139, 92, 246, 0.2); }
.stat-icon.cyan { background: rgba(6, 182, 212, 0.2); }
.stat-icon.pink { background: rgba(236, 72, 153, 0.2); }

.stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-400);
  margin-bottom: 0.25rem;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
}

/* Table */
.table-wrapper {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-400);
  background: rgba(10, 22, 40, 0.4);
  border-bottom: 1px solid rgba(59, 130, 246, 0.1);
}

.data-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid rgba(59, 130, 246, 0.05);
  color: var(--gray-200);
}

.data-table tr {
  transition: background 0.2s;
}

.data-table tbody tr:hover {
  background: rgba(59, 130, 246, 0.08);
}

.data-table tr.overdue {
  background: rgba(239, 68, 68, 0.1);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-blue { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
.badge-green { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }
.badge-gold { background: rgba(245, 158, 11, 0.2); color: #fcd34d; }
.badge-purple { background: rgba(139, 92, 246, 0.2); color: #c4b5fd; }
.badge-red { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.badge-cyan { background: rgba(6, 182, 212, 0.2); color: #67e8f9; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--electric), #2563eb);
  color: var(--white);
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: var(--electric-glow);
}

.btn-secondary:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.5);
}

.btn-success {
  background: linear-gradient(135deg, var(--success), #059669);
  color: var(--white);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
}

/* Form Elements */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-400);
  margin-bottom: 0.5rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: rgba(10, 22, 40, 0.6);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  color: var(--white);
  font-size: 0.9rem;
  font-family: inherit;
  transition: all 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--electric);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--gray-600);
}

.form-select {
  cursor: pointer;
}

.form-select option {
  background: var(--navy-light);
}

/* Filters */
.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.filter-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-400);
}

.filter-input {
  background: rgba(10, 22, 40, 0.6);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  color: var(--white);
  font-size: 0.875rem;
  font-family: inherit;
  min-width: 140px;
  transition: all 0.2s;
}

.filter-input:focus {
  outline: none;
  border-color: var(--electric);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Empty State */
.empty-state {
  color: var(--gray-400);
  font-size: 0.875rem;
  padding: 2rem;
  text-align: center;
}

/* Overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 40;
}

@media (max-width: 768px) {
  .sidebar-overlay.open {
    display: block;
  }
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}

.modal {
  background: var(--navy-light);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 20px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(59, 130, 246, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--white);
}

.modal-close {
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  padding: 0.5rem;
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--white);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1.5rem;
  border-top: 1px solid rgba(59, 130, 246, 0.1);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Kanban specific */
.kanban-container {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 1rem;
}

.kanban-column {
  min-width: 300px;
  max-width: 320px;
  background: rgba(19, 32, 57, 0.4);
  border: 1px solid rgba(59, 130, 246, 0.1);
  border-radius: 16px;
  flex-shrink: 0;
}

.kanban-column-header {
  padding: 1rem;
  border-bottom: 1px solid rgba(59, 130, 246, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kanban-column-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--white);
}

.kanban-column-count {
  background: rgba(59, 130, 246, 0.2);
  color: var(--electric-glow);
  padding: 0.125rem 0.5rem;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
}

.kanban-column-body {
  padding: 0.75rem;
  min-height: 200px;
}

.kanban-card {
  background: rgba(10, 22, 40, 0.8);
  border: 1px solid rgba(59, 130, 246, 0.1);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.kanban-card:hover {
  border-color: rgba(59, 130, 246, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.kanban-card-title {
  font-weight: 600;
  color: var(--white);
  margin-bottom: 0.5rem;
}

.kanban-card-meta {
  font-size: 0.75rem;
  color: var(--gray-400);
}

/* Sortable ghost states */
.sortable-ghost {
  opacity: 0.4;
  background: rgba(59, 130, 246, 0.2) !important;
}

.sortable-chosen {
  box-shadow: 0 0 0 2px var(--electric);
}

.sortable-drag {
  opacity: 0.9;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(59, 130, 246, 0.1);
  padding-bottom: 0.5rem;
}

.tab {
  padding: 0.5rem 1rem;
  background: none;
  border: none;
  color: var(--gray-400);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
}

.tab:hover {
  color: var(--white);
  background: rgba(59, 130, 246, 0.1);
}

.tab.active {
  color: var(--electric-glow);
  background: rgba(59, 130, 246, 0.15);
}

/* Alert / Toast */
.alert {
  padding: 1rem 1.25rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: #fcd34d;
}

.alert-info {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

/* Loading spinner */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(59, 130, 246, 0.2);
  border-top-color: var(--electric);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Utility classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--gray-400); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.hidden { display: none; }
