/* ==============================
   FutureMate AI - Main Styles
   ============================== */

/* ── Override Bootstrap 5.3 CSS Variables ── */
:root {
  --bs-body-color:             #F1F5F9;
  --bs-body-color-rgb:         241, 245, 249;
  --bs-body-bg:                #0F172A;
  --bs-body-bg-rgb:            15, 23, 42;
  --bs-secondary-color:        #94A3B8;
  --bs-secondary-color-rgb:    148, 163, 184;
  --bs-tertiary-color:         #64748B;
  --bs-tertiary-color-rgb:     100, 116, 139;
  --bs-emphasis-color:         #F1F5F9;
  --bs-emphasis-color-rgb:     241, 245, 249;
  --bs-link-color:             #A78BFA;
  --bs-link-color-rgb:         167, 139, 250;
  --bs-link-hover-color:       #C4B5FD;
  --bs-border-color:           #334155;
  --bs-border-color-translucent: rgba(241,245,249,.15);
  --bs-heading-color:          #F1F5F9;
  --bs-form-valid-color:       #10B981;
  --bs-form-invalid-color:     #EF4444;
  /* Form controls */
  --bs-form-control-bg:        #2D3748;
  --bs-form-select-bg:         #2D3748;
  --bs-body-color-dark:        #F1F5F9;
}

/* ── Global Bootstrap Override (force light text on dark bg) ── */
body { color: #F1F5F9 !important; }

/* Force all inputs/selects to dark theme */
input, textarea, select {
  color: #F1F5F9 !important;
  background-color: #2D3748 !important;
  border-color: #334155 !important;
}
input::placeholder, textarea::placeholder { color: #64748B !important; }
input:focus, textarea:focus, select:focus {
  color: #F1F5F9 !important;
  background-color: #2D3748 !important;
  border-color: #7C3AED !important;
}
/* Bootstrap overrides */
.form-control, .form-select, .form-check-input {
  color: #F1F5F9 !important;
  background-color: #2D3748 !important;
  border-color: #334155 !important;
}
.form-control:focus, .form-select:focus {
  color: #F1F5F9 !important;
  background-color: #2D3748 !important;
  border-color: #7C3AED !important;
  box-shadow: 0 0 0 3px rgba(124,58,237,.2) !important;
}
.input-group-text {
  color: #94A3B8 !important;
  background-color: #1E293B !important;
  border-color: #334155 !important;
}
/* Select options */
select option { background: #1E293B; color: #F1F5F9; }
/* Modal */
.modal-content { background: #1E293B !important; color: #F1F5F9 !important; }
/* Dropdown */
.dropdown-menu { background: #1E293B !important; }
.dropdown-item { color: #94A3B8 !important; }
.dropdown-item:hover { background: #2D3748 !important; color: #F1F5F9 !important; }
/* Table */
.table { color: #F1F5F9 !important; }
/* Badge text */
.badge { color: inherit !important; }
/* Navbar */
.navbar { color: #F1F5F9 !important; }
/* Breadcrumb */
.breadcrumb-item, .breadcrumb-item a { color: #94A3B8 !important; }
.breadcrumb-item.active { color: #F1F5F9 !important; }
/* Nav pills */
.nav-pills .nav-link { color: #94A3B8 !important; }
.nav-pills .nav-link.active { color: #fff !important; }

:root {
  --primary: #7C3AED;
  --primary-dark: #5B21B6;
  --primary-light: #A78BFA;
  --accent: #06B6D4;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --bg: #0F172A;
  --surface: #1E293B;
  --surface2: #2D3748;
  --border: #334155;
  --text: #F1F5F9;
  --text-muted: #94A3B8;
  --radius: 12px;
  --radius-lg: 20px;
}

* { box-sizing: border-box; }

body {
  font-family: 'Tajawal', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 4px; }

/* ── Navbar ── */
#mainNav {
  background: rgba(15,23,42,.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: .75rem 0;
}
.navbar-brand { font-size: 1.3rem; letter-spacing: -.5px; }
.navbar-brand .bi { color: var(--primary-light); }
.nav-link { color: var(--text-muted) !important; border-radius: 8px; padding: .4rem .8rem !important; transition: all .2s; }
.nav-link:hover { color: var(--text) !important; background: var(--surface); }

/* ── Points Badge ── */
.points-badge {
  background: linear-gradient(135deg, rgba(124,58,237,.2), rgba(6,182,212,.2));
  border: 1px solid rgba(124,58,237,.4);
  color: var(--text);
  padding: .35rem .85rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: .9rem;
}
.points-badge .bi { color: var(--warning); }

/* ── Avatar ── */
.avatar-sm {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem;
}
.avatar-md {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.1rem;
}
.avatar-lg {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.6rem;
}

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
}
.card-header {
  background: transparent;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  padding: 1rem 1.25rem;
}
.card:hover { border-color: rgba(124,58,237,.4); transition: border-color .2s; }

/* ── Stat Cards ── */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: transform .2s, border-color .2s;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 100%; height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}
.stat-card:hover { transform: translateY(-3px); border-color: var(--primary); }
.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
}
.stat-value { font-size: 2rem; font-weight: 800; line-height: 1; }
.stat-label { color: var(--text-muted); font-size: .875rem; margin-top: .25rem; }

/* ── Gradient Text ── */
.gradient-text {
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Buttons ── */
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: none;
  border-radius: 8px;
  font-weight: 600;
  transition: all .2s;
}
.btn-primary:hover { background: linear-gradient(135deg, var(--primary-dark), var(--primary)); transform: translateY(-1px); }
.btn-outline-primary { border-color: var(--primary); color: var(--primary-light); }
.btn-outline-primary:hover { background: var(--primary); color: white; }
.btn-ghost { background: transparent; border: none; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface2); color: var(--text); }

/* ── Forms ── */
.form-control, .form-select, .form-check-input {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
}
.form-control:focus, .form-select:focus {
  background: var(--surface2);
  border-color: var(--primary);
  color: var(--text);
  box-shadow: 0 0 0 3px rgba(124,58,237,.2);
}
.form-control::placeholder { color: var(--text-muted); }
.form-label { font-weight: 500; color: var(--text-muted); margin-bottom: .4rem; }
.input-group-text { background: var(--surface2); border-color: var(--border); color: var(--text-muted); }

/* ── Tables ── */
.table { color: var(--text); }
.table > :not(caption) > * > * { background: transparent; border-bottom-color: var(--border); padding: .85rem 1rem; }
.table thead th { color: var(--text-muted); font-weight: 600; font-size: .85rem; text-transform: uppercase; letter-spacing: .5px; }
.table tbody tr:hover > * { background: rgba(255,255,255,.03); }
.table-responsive { border-radius: var(--radius); border: 1px solid var(--border); }

/* ── Badges ── */
.badge { font-weight: 600; font-size: .78rem; border-radius: 6px; padding: .35em .65em; }
.bg-success-soft { background: rgba(16,185,129,.15); color: #34D399; }
.bg-danger-soft  { background: rgba(239,68,68,.15);  color: #FCA5A5; }
.bg-warning-soft { background: rgba(245,158,11,.15); color: #FDE68A; }
.bg-primary-soft { background: rgba(124,58,237,.15); color: #A78BFA; }
.bg-info-soft    { background: rgba(6,182,212,.15);  color: #67E8F9; }

/* ── Service Cards ── */
.service-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  cursor: pointer;
  transition: all .25s;
  height: 100%;
  display: flex; flex-direction: column;
}
.service-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(124,58,237,.2);
}
.service-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 1rem;
}

/* ── Package Cards ── */
.package-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  transition: all .25s;
  position: relative;
  overflow: hidden;
}
.package-card.popular {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(124,58,237,.1), rgba(6,182,212,.05));
}
.package-card:hover { transform: translateY(-6px); box-shadow: 0 20px 40px rgba(0,0,0,.3); }
.package-popular-badge {
  position: absolute;
  top: 16px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  font-size: .75rem;
  font-weight: 700;
  padding: .25rem 1rem;
  border-radius: 50px;
}
.package-price { font-size: 2.5rem; font-weight: 800; }
.package-price sup { font-size: 1rem; font-weight: 500; vertical-align: top; margin-top: .5rem; }
.package-points { font-size: 1.1rem; color: var(--warning); font-weight: 600; }

/* ── Dropdowns ── */
.dropdown-menu {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0,0,0,.4);
}
.dropdown-item { color: var(--text-muted); font-weight: 500; border-radius: 8px; }
.dropdown-item:hover { background: var(--surface2); color: var(--text); }
.dropdown-divider { border-color: var(--border); }

/* ── Alerts ── */
.alert { border-radius: var(--radius); border: none; }
.alert-success { background: rgba(16,185,129,.15); color: #34D399; }
.alert-danger  { background: rgba(239,68,68,.15);  color: #FCA5A5; }
.alert-warning { background: rgba(245,158,11,.15); color: #FDE68A; }
.alert-info    { background: rgba(6,182,212,.15);  color: #67E8F9 !important; }
.btn-close { filter: invert(1); }

/* ── Modal ── */
.modal-content { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); color: var(--text); }
.modal-header { border-bottom: 1px solid var(--border); }
.modal-footer { border-top: 1px solid var(--border); }

/* ── Hero (Landing) ── */
.hero-section {
  min-height: 90vh;
  display: flex; align-items: center;
  background: radial-gradient(ellipse 80% 80% at 50% -10%, rgba(124,58,237,.25), transparent);
  position: relative;
  overflow: hidden;
}
.hero-section::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(124,58,237,.15), transparent 70%);
  top: -200px; right: -200px;
  border-radius: 50%;
}

/* ── History Timeline ── */
.timeline-item {
  display: flex; gap: 1rem; align-items: flex-start;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}
.timeline-icon {
  width: 38px; height: 38px; flex-shrink: 0;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
}

/* ── Pagination ── */
.pagination .page-link { background: var(--surface); border-color: var(--border); color: var(--text-muted); border-radius: 8px; margin: 0 2px; }
.pagination .page-link:hover { background: var(--primary); border-color: var(--primary); color: white; }
.pagination .page-item.active .page-link { background: var(--primary); border-color: var(--primary); }

/* ── AI Output ── */
.ai-output {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  white-space: pre-wrap;
  word-wrap: break-word;
  line-height: 1.8;
  min-height: 120px;
  max-height: 500px;
  overflow-y: auto;
}

/* ── Loading ── */
.loading-spinner {
  display: none;
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Utilities ── */
.text-primary { color: var(--primary-light) !important; }
.bg-primary { background: var(--primary) !important; }
.border-primary { border-color: var(--primary) !important; }
.rounded-xl { border-radius: var(--radius) !important; }
.rounded-2xl { border-radius: var(--radius-lg) !important; }

/* Responsive */
@media (max-width: 768px) {
  .stat-value { font-size: 1.5rem; }
  .package-price { font-size: 2rem; }
}
