/* ==========================================================================
   SolarMatch - Clean Professional Light Theme
   ========================================================================== */

/* --- Variables --- */
:root {
  /* Colors - Light Theme Only */
  --color-primary: #FFB703; /* Rich Solar Gold */
  --color-primary-dark: #FB8500;
  --color-primary-light: #FFD166;
  
  --color-secondary: #023047; /* Deep Professional Navy for text/headings */
  --color-secondary-light: #219EBC;
  
  --bg-body: #F0F4F8; /* Slate 100 tint */
  --bg-surface: rgba(255, 255, 255, 0.45); /* High transparency glass */
  --bg-input: rgba(255, 255, 255, 0.6);
  
  --text-main: #1E293B; /* Slate 800 */
  --text-muted: #475569; /* Slate 600 - darker for readability on clear glass */
  
  --color-success: #10B981;
  --color-danger: #EF4444;
  --color-warning: #F59E0B;
  
  /* Gradients */
  --grad-premium: linear-gradient(135deg, #FFB703, #FB8500, #219EBC);
  --grad-bg: linear-gradient(135deg, #F0F9FF 0%, #E0F2FE 50%, #F8FAFC 100%);
  --grad-surface: linear-gradient(135deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.3));
  
  /* Shadows - Soft & Deep */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(2, 48, 71, 0.04), 0 2px 4px -1px rgba(2, 48, 71, 0.02);
  --shadow-lg: 0 10px 15px -3px rgba(2, 48, 71, 0.06), 0 4px 6px -2px rgba(2, 48, 71, 0.03);
  --shadow-hover: 0 25px 35px -5px rgba(2, 48, 71, 0.1), 0 12px 15px -5px rgba(2, 48, 71, 0.05);
  
  /* Borders & Radius */
  --radius-sm: 12px;
  --radius-md: 24px;
  --radius-lg: 40px; /* Much rounder edges */
  --radius-full: 9999px;
  --border-light: 1px solid rgba(255, 255, 255, 0.4);
  --border-glass: 1px solid rgba(255, 255, 255, 0.6);
  --inner-glow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.3);
  
  /* Layout & Spacing */
  --container-width: 1200px;
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 2rem;
  --spacing-lg: 4rem;
  --spacing-xl: 6rem;
  --section-padding: 80px;
  
  /* Transitions */
  --transition-base: 0.2s ease;
  --transition-smooth: 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  --transition-slow: 0.6s cubic-bezier(0.25, 1, 0.5, 1);
  --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- Global Reset & Basics --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body, input, button, select, textarea {
  font-family: 'Tajawal', sans-serif !important;
}

body {
  background: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* ════════════════════════════════════════════════════════════════════
   PREMIUM BACKGROUND SYSTEM
   Layered: animated gradient + floating SVGs + canvas particles + orbs
   ════════════════════════════════════════════════════════════════════ */

/* 1. BASE GRADIENT — multi-color, slow animated shift */
.animated-bg {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: -4;
  background: linear-gradient(
    135deg,
    #FEF9C3 0%,      /* Solar Gold Tint */
    #E0F2FE 25%,     /* Sky Blue Tint */
    #F0FDF4 50%,     /* Eco Green Tint */
    #FFEDD5 75%,     /* Warm Orange Tint */
    #F8FAFC 100%
  );
  background-size: 400% 400%;
  animation: premiumGradient 28s ease infinite;
}

@keyframes premiumGradient {
  0%   { background-position: 0% 50%; }
  25%  { background-position: 50% 0%; }
  50%  { background-position: 100% 50%; }
  75%  { background-position: 50% 100%; }
  100% { background-position: 0% 50%; }
}

/* 2. FLOATING ELEMENT CONTAINER */
.floating-bg-elements {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: -2;
  pointer-events: none;
  overflow: hidden;
}

/* 3. INDIVIDUAL FLOAT ITEM */
.bg-float-item {
  position: absolute;
  pointer-events: none;
  will-change: transform;
}

.bg-float-item svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* 4. DEPTH LAYERS */
.layer-back  { z-index: 0; }
.layer-mid   { z-index: 1; }
.layer-front { z-index: 2; }

/* 5. FOUR DISTINCT FLOAT ANIMATIONS (variety = life) */
@keyframes float-a {
  0%   { transform: translate(0, 0) rotate(calc(var(--rot-dir, 1) * 0deg)); }
  20%  { transform: translate(12px, -18px) rotate(calc(var(--rot-dir, 1) * 8deg)); }
  40%  { transform: translate(-8px, -32px) rotate(calc(var(--rot-dir, 1) * 3deg)); }
  60%  { transform: translate(-16px, -18px) rotate(calc(var(--rot-dir, 1) * -5deg)); }
  80%  { transform: translate(6px, -8px) rotate(calc(var(--rot-dir, 1) * 10deg)); }
  100% { transform: translate(0, 0) rotate(calc(var(--rot-dir, 1) * 0deg)); }
}

@keyframes float-b {
  0%   { transform: translate(0, 0) rotate(calc(var(--rot-dir, 1) * 0deg)); }
  25%  { transform: translate(-14px, -22px) rotate(calc(var(--rot-dir, 1) * -6deg)); }
  50%  { transform: translate(10px, -38px) rotate(calc(var(--rot-dir, 1) * 12deg)); }
  75%  { transform: translate(18px, -20px) rotate(calc(var(--rot-dir, 1) * -4deg)); }
  100% { transform: translate(0, 0) rotate(calc(var(--rot-dir, 1) * 0deg)); }
}

@keyframes float-c {
  0%   { transform: translate(0, 0) scale(1) rotate(calc(var(--rot-dir, 1) * 0deg)); }
  33%  { transform: translate(16px, -28px) scale(1.05) rotate(calc(var(--rot-dir, 1) * 9deg)); }
  66%  { transform: translate(-12px, -42px) scale(0.96) rotate(calc(var(--rot-dir, 1) * -7deg)); }
  100% { transform: translate(0, 0) scale(1) rotate(calc(var(--rot-dir, 1) * 0deg)); }
}

@keyframes float-d {
  0%   { transform: translate(0, 0) rotate(calc(var(--rot-dir, 1) * 0deg)); }
  15%  { transform: translate(8px, -10px) rotate(calc(var(--rot-dir, 1) * 5deg)); }
  35%  { transform: translate(-10px, -25px) rotate(calc(var(--rot-dir, 1) * -8deg)); }
  55%  { transform: translate(14px, -35px) rotate(calc(var(--rot-dir, 1) * 6deg)); }
  75%  { transform: translate(-6px, -18px) rotate(calc(var(--rot-dir, 1) * -3deg)); }
  90%  { transform: translate(4px, -5px) rotate(calc(var(--rot-dir, 1) * 8deg)); }
  100% { transform: translate(0, 0) rotate(calc(var(--rot-dir, 1) * 0deg)); }
}

/* Separate gentle rotation keyframe (added via JS as second animation) */
@keyframes rotate-float {
  0%   { transform: rotate(calc(var(--rot-dir, 1) * 0deg)); }
  100% { transform: rotate(calc(var(--rot-dir, 1) * 360deg)); }
}

/* 6. GLOWING ORBS */
.bg-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

@keyframes orb-pulse {
  0%   { opacity: 0.6; transform: scale(1); }
  50%  { opacity: 1;   transform: scale(1.12); }
  100% { opacity: 0.6; transform: scale(1); }
}

/* 7. CANVAS PARTICLE LAYER (sits below floating items) */
#bg-particle-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: -3;
  pointer-events: none;
}

/* 8. CURSOR GLOW */
#cursor-glow {
  position: fixed;
  pointer-events: none;
  z-index: -1;
  border-radius: 50%;
}

/* 9. CONTENT LEGIBILITY OVERLAY
   Adds the faintest veil behind text-heavy sections so the bg never competes */
.section-padding,
.hero,
.features,
.learn-section,
.chat-container,
.dashboard-grid {
  position: relative;
  z-index: 1;
}

/* 10. ACCESSIBILITY — stop all animation if user prefers */
@media (prefers-reduced-motion: reduce) {
  .animated-bg,
  .bg-float-item,
  .bg-orb,
  #bg-particle-canvas {
    animation: none !important;
    transition: none !important;
  }
}


h1, h2, h3, h4, h5, h6 {
  font-family: 'Tajawal', sans-serif;
  color: var(--color-secondary);
  line-height: 1.2;
  font-weight: 700;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition-base);
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-gradient {
  background: var(--grad-premium);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
}

/* --- Typography --- */
.section-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: var(--color-secondary);
}

.section-subtitle {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 700px;
  margin: 0 auto 3rem;
}

/* --- Components --- */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  border: none;
  gap: 0.5rem;
  font-size: 1rem;
  box-shadow: var(--shadow-sm);
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-secondary);
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  color: white;
  transform: scale(1.02);
  box-shadow: 0 8px 15px rgba(251, 133, 0, 0.2);
}

.btn-secondary {
  background: var(--color-secondary);
  color: white;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--color-secondary);
  color: var(--color-secondary);
}

.btn-secondary:hover {
  background: var(--color-secondary-light);
  transform: scale(1.02);
  box-shadow: 0 8px 15px rgba(33, 158, 188, 0.2);
}

.btn-outline:hover {
  background: var(--color-secondary);
  color: white;
  transform: scale(1.02);
  box-shadow: 0 8px 15px rgba(2, 48, 71, 0.1);
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  padding: 1rem 0;
  transition: var(--transition-smooth);
}

.navbar.scrolled {
  padding: 0.75rem 0;
  box-shadow: var(--shadow-sm);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--color-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo i {
  color: var(--color-primary);
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-links a {
  font-weight: 600;
  color: var(--text-muted);
  position: relative;
  padding: 0.5rem 0;
  transition: var(--transition-base);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--color-secondary);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  transition: var(--transition-smooth);
  border-radius: 2px;
}

.nav-links a:hover::after, .nav-links a.active::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.theme-toggle {
  display: none; /* REMOVED DARK MODE */
}

.hamburger {
  display: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--color-secondary);
}

/* Cards */
.card {
  background: var(--bg-surface);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-md), var(--inner-glow);
  border: var(--border-glass);
  transition: var(--transition-smooth);
}

.card:hover {
  transform: scale(1.01);
  box-shadow: var(--shadow-lg), var(--inner-glow);
  border-color: var(--color-primary-light);
}

/* Interaction Hooks */
.interactive-element {
  transition: transform 0.2s cubic-bezier(0.2, 0, 0.2, 1), box-shadow 0.3s ease;
  will-change: transform;
}

.hover-image-container {
  overflow: hidden;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: box-shadow 0.4s ease;
}

.hover-image-container img {
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hover-image-container:hover img {
  transform: scale(1.02);
}

.hover-image-container:hover {
  box-shadow: var(--shadow-hover);
}

.text-reveal {
  opacity: 0;
  filter: blur(10px);
  transform: translate3d(0, 15px, 0);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.25, 1, 0.5, 1), filter 1s ease;
  will-change: transform, opacity, filter;
  backface-visibility: hidden;
}

.text-reveal.active {
  opacity: 1;
  filter: blur(0);
  transform: translate3d(0, 0, 0);
}

.magnetic-wrap {
  display: inline-block;
  transition: transform 0.2s cubic-bezier(0.2, 0, 0.2, 1);
}

/* --- Results Dashboard Styles --- */
.results-dashboard {
  background: #ffffff;
  border-radius: 24px;
  padding: 2.5rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
  border: 1px solid #f1f5f9;
}

.summary-card {
  background: #023047;
  color: #ffffff;
  padding: 2.5rem;
  border-radius: 20px;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 15px 35px rgba(2, 48, 71, 0.15);
}

.summary-card::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -10%;
  width: 300px;
  height: 300px;
  background: rgba(255, 183, 3, 0.05);
  border-radius: 50%;
  pointer-events: none;
}

.summary-main {
  text-align: center;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 2.5rem;
}

.summary-main small {
  display: block;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 700;
  color: #FFB703;
  margin-bottom: 1rem;
  font-size: 0.8rem;
}

.summary-main p {
  font-size: 3.5rem;
  font-weight: 900;
  margin: 0;
  line-height: 1;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.summary-item {
  text-align: center;
  padding: 0.5rem;
}

.summary-item:not(:last-child) {
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.summary-item small {
  display: block;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.75rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.summary-item p {
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0;
  color: #ffffff;
}

/* Metric Cards */
.metric-card {
  background: #ffffff;
  padding: 1.5rem;
  border-radius: 18px;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  transition: all 0.3s ease;
}

.metric-card:hover {
  border-color: #FFB703;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.05);
  transform: translateY(-2px);
}

.metric-icon {
  width: 48px;
  height: 48px;
  background: #f1f5f9;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #023047;
  font-size: 1.25rem;
}

.metric-card.highlight .metric-icon {
  background: rgba(255, 183, 3, 0.1);
  color: #FB8500;
}

.metric-info small {
  display: block;
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
}

.metric-info p {
  font-size: 1.2rem;
  font-weight: 800;
  color: #023047;
  margin: 0;
}

/* Section Padding */
.section-padding {
  padding: var(--section-padding) 0;
}

/* Hero Section */
.hero {
  padding: var(--section-padding) 0;
  position: relative;
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero-text h1 {
  font-size: 3.5rem;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  color: var(--color-secondary);
}

.hero-text p {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.hero-visual {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.hero-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  align-items: stretch;
}

.feature-card {
  background: var(--bg-surface);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  border: var(--border-glass);
  box-shadow: var(--shadow-md), var(--inner-glow);
  transition: var(--transition-smooth);
  text-align: left;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.feature-card:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-hover), var(--inner-glow);
  border-color: var(--color-primary);
}

.feature-icon {
  width: 64px;
  height: 64px;
  background: rgba(255, 183, 3, 0.1);
  color: var(--color-primary-dark);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 1.5rem;
  transition: transform 0.3s ease;
}

.feature-card:hover .feature-icon {
  transform: scale(1.1);
  background: var(--color-primary);
  color: var(--color-secondary);
}

.feature-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

/* Image Showcase / Marquee (Cleaned up) */
.showcase-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 3rem;
  align-items: stretch;
}

.showcase-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md), var(--inner-glow);
  background: var(--bg-surface);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: var(--border-glass);
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.showcase-card:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-hover);
}

.showcase-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.showcase-content {
  padding: 1.5rem;
}

.showcase-content h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.showcase-content p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 1.75rem;
  width: 100%;
}

.form-input-wrapper {
  position: relative;
  width: 100%;
}

.form-input-wrapper i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 2;
  transition: var(--transition-base);
}

.form-input-wrapper .form-control {
  padding-left: 3rem;
  padding-right: 3rem;
}

[dir="rtl"] .form-input-wrapper .form-control {
  padding-left: 3rem;
  padding-right: 3rem;
}

.form-input-wrapper i.toggle-password {
  left: auto;
  right: 1rem;
  cursor: pointer;
  pointer-events: all;
  color: var(--text-muted);
  font-size: 0.9rem;
  z-index: 3;
}

[dir="rtl"] .form-input-wrapper i.toggle-password {
  right: auto;
  left: 1rem;
}

.form-input-wrapper i.toggle-password:hover {
  color: var(--color-primary-dark);
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--color-secondary);
  font-size: 0.9rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #CBD5E1;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  background: var(--bg-surface);
  color: var(--text-main);
  transition: var(--transition-base);
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(255, 183, 3, 0.2);
}

/* Calculator Dashboard Layout */
.calculator-dashboard {
  margin-top: 2rem;
  margin-bottom: 4rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(350px, 420px) 1fr;
  gap: 2.5rem;
  align-items: start;
}

@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-panel {
    max-width: 100%;
  }
}

@media (max-width: 1200px) {
  .dashboard-grid {
    grid-template-columns: 380px 1fr;
    gap: 2rem;
  }
}

@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  
  .dashboard-panel {
    padding: 2rem;
  }
}

.dashboard-panel {
  background: var(--bg-surface);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), var(--inner-glow);
  border: var(--border-glass);
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #E2E8F0;
}

.panel-header i {
  color: var(--color-primary-dark);
  font-size: 1.25rem;
}

.panel-header h3 {
  font-size: 1.25rem;
  margin: 0;
}

/* Map area */
#solar-map {
  height: 400px;
  border-radius: var(--radius-lg);
  border: var(--border-light);
  box-shadow: var(--shadow-md);
  margin-bottom: var(--spacing-md);
  overflow: hidden;
  position: relative;
  background-color: #f1f5f9;
}

.map-fallback-msg {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #F1F5F9;
  color: var(--text-muted);
  padding: 2rem;
  text-align: center;
  gap: 1rem;
}

.map-fallback-msg i {
  font-size: 3rem;
  color: #CBD5E1;
}

/* Results Section inside Dashboard */
.results-dashboard {
  min-height: 100%;
}

.roi-progress-container {
  margin-top: 2rem;
  background: var(--bg-surface);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  border: var(--border-light);
}

.roi-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.roi-bar-bg {
  height: 12px;
  background: #E2E8F0;
  border-radius: var(--radius-full);
  overflow: hidden;
}

.roi-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--color-success);
  border-radius: var(--radius-full);
  transition: width 1s ease;
}

@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .dashboard-metrics {
    flex-direction: column;
  }
  .metric-card {
    width: 100%;
  }
  .summary-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* Advisor Dashboard Layout - STABILIZED */
.advisor-dashboard {
  max-width: 1100px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.05);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 260px);
  min-height: 500px;
  max-height: none;
  position: relative;
}

.advisor-header {
  padding: 1.5rem 2rem;
  background: #ffffff;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  z-index: 10;
}

.advisor-header .avatar {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #FFB703, #FB8500);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #023047;
  font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(255, 183, 3, 0.3);
}

.advisor-header-info h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: #023047;
  margin-bottom: 0.15rem;
}

.advisor-header-info p {
  font-size: 0.8rem;
  color: #10b981;
  font-weight: 600;
}

/* Chat Messages Area */
.chat-messages {
  flex: 1 1 0;
  min-height: 0;
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background: #f8fafc;
  scroll-behavior: smooth;
}

.message {
  max-width: 80%;
  display: flex;
  flex-direction: column;
}

.message.bot {
  align-self: flex-start;
}

.message.user {
  align-self: flex-end;
}

.message-bubble {
  padding: 1.2rem 1.6rem;
  border-radius: 24px;
  font-size: 0.95rem;
  line-height: 1.65;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
  position: relative;
  word-wrap: break-word;
}

.message.bot .message-bubble {
  background: #ffffff;
  color: #334155;
  border-bottom-left-radius: 4px;
  border: 1px solid #e2e8f0;
}

.message.user .message-bubble {
  background: var(--color-primary);
  color: var(--color-secondary);
  border-bottom-right-radius: 4px;
  font-weight: 600;
}

.chat-input-area {
  padding: 1rem 1.5rem;
  background: #ffffff;
  border-top: 1px solid #E2E8F0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex-shrink: 0;
}

.input-wrapper {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}

.chat-input-area input {
  flex: 1;
  padding: 0.85rem 1.5rem;
  border: 1px solid #CBD5E1;
  border-radius: var(--radius-full);
  font-size: 1rem;
  background: white;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-base);
}

.chat-input-area input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(255, 183, 3, 0.15);
}

.chat-input-area button#chat-send {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-secondary);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: var(--transition-bounce);
  box-shadow: var(--shadow-sm);
}

.chat-input-area button#chat-send:hover {
  background: var(--color-primary-dark);
  color: white;
  transform: scale(1.1) rotate(5deg);
}

/* Recommendation Buttons */
.suggestion-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin: 0.75rem auto;
  width: 100%;
  max-width: 800px;
  padding: 0 1rem;
}

.suggestion-btn, .qa-suggestion-btn {
  width: auto !important;
  height: auto !important;
  min-width: unset !important;
  padding: 0.6rem 1.25rem !important;
  background: white !important;
  border: 1.5px solid var(--color-primary) !important;
  border-radius: 30px !important; /* Pill shape */
  font-size: 0.9rem !important;
  font-weight: 700 !important;
  color: var(--color-secondary) !important;
  cursor: pointer;
  transition: all 0.3s ease !important;
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05) !important;
  display: inline-block !important;
}

.suggestion-btn:hover, .qa-suggestion-btn:hover {
  background: var(--color-primary) !important;
  color: var(--color-secondary) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(255, 183, 3, 0.2) !important;
}

[dir="rtl"] .chat-input-area button i {
  transform: rotate(180deg);
}

/* Learn Page */
.learn-section {
  padding: var(--section-padding) 0;
}

.learn-pillars {
  padding: var(--section-padding) 0;
}

.pillars-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
  margin-top: 3rem;
  align-items: stretch;
}

.pillar-card {
  background: var(--bg-surface);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-md), var(--inner-glow);
  border: var(--border-glass);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  transition: var(--transition-smooth);
  height: 100%;
}

.pillar-card:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-lg), var(--inner-glow);
}

.pillar-icon {
  width: 60px;
  height: 60px;
  background: rgba(255, 183, 3, 0.1);
  color: var(--color-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.learn-grid {
  display: flex;
  flex-direction: column;
  gap: 5rem;
}

.learn-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 3rem;
  box-shadow: var(--shadow-md);
  border: var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.learn-card h2 {
  font-size: 2rem;
  color: var(--color-secondary);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.learn-card h2 i {
  color: var(--color-primary);
  font-size: 2.2rem;
}

.learn-card p {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.8;
}

.learn-card-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

/* Details/Accordion */
details.faq-item {
  background: var(--bg-surface);
  border: var(--border-light);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}

details.faq-item summary {
  padding: 1.5rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

details.faq-item p {
  padding: 0 1.5rem 1.5rem;
  color: var(--text-muted);
}

/* Footer */
footer {
  background: var(--color-secondary);
  color: white;
  padding: var(--section-padding) 0 2rem;
  margin-top: var(--section-padding);
}

.footer-content {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-content h4 {
  color: white;
  margin-bottom: 1rem;
}

.footer-content p {
  color: #94A3B8;
  font-size: 0.9rem;
}

.footer-content ul li {
  margin-bottom: 0.5rem;
}

.footer-content a {
  color: #94A3B8;
}

.footer-content a:hover {
  color: var(--color-primary);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 2rem;
  text-align: center;
  font-size: 0.85rem;
  color: #94A3B8;
}

/* Animations */
.reveal {
  opacity: 0;
  transform: translate3d(0, 30px, 0);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
  will-change: transform, opacity;
  backface-visibility: hidden;
}

.reveal.active {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.reveal-left {
  opacity: 0;
  transform: translate3d(-30px, 0, 0);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
  will-change: transform, opacity;
  backface-visibility: hidden;
}
.reveal-left.active {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.reveal-right {
  opacity: 0;
  transform: translate3d(30px, 0, 0);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
  will-change: transform, opacity;
  backface-visibility: hidden;
}
.reveal-right.active {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.scale-up {
  opacity: 0;
  transform: scale3d(0.95, 0.95, 1);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
  will-change: transform, opacity;
  backface-visibility: hidden;
}
.scale-up.active {
  opacity: 1;
  transform: scale3d(1, 1, 1);
}

.text-reveal {
  opacity: 0;
  filter: blur(10px);
  transform: translate3d(0, 15px, 0);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.25, 1, 0.5, 1), filter 1s ease;
  will-change: transform, opacity, filter;
  backface-visibility: hidden;
}

.text-reveal.active {
  opacity: 1;
  filter: blur(0);
  transform: translate3d(0, 0, 0);
}

/* Learn Page Video Section */
.video-section {
  padding: 4rem 0;
  background: rgba(255, 183, 3, 0.03);
  border-radius: var(--radius-lg);
  margin: 4rem 0;
}

.video-container {
  max-width: 800px;
  margin: 0 auto;
}

.video-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(0,0,0,0.05);
  transition: var(--transition-smooth);
}

.video-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 ratio */
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: #000;
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Media Queries for Responsiveness */
@media (max-width: 1200px) {
  .container {
    max-width: 95%;
  }
}

@media (max-width: 1024px) {
  .pillars-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .pillars-grid {
    grid-template-columns: 1fr;
  }

  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .hero-text h1 {
    font-size: 2.5rem;
  }
  
  .features-grid, .showcase-grid, .dashboard-metrics, .summary-grid {
    grid-template-columns: 1fr;
  }
  
  .learn-card-content {
    grid-template-columns: 1fr;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .nav-links {
    display: none;
  }
  
  .hamburger {
    display: block;
  }
  
  .nav-actions {
    gap: 0.5rem;
  }
  .nav-cta {
    display: none;
  }
}

/* Utility Classes */
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-4 { margin-top: 2rem; }
.mt-2 { margin-top: 1rem; }

.text-success { color: var(--color-success); }
.text-danger { color: var(--color-danger); }
.text-warning { color: var(--color-warning); }
.font-bold { font-weight: 700; }

/* Typing Animation */
.typing-dot {
  width: 8px;
  height: 8px;
  background: var(--color-secondary);
  border-radius: 50%;
  animation: typing-blink 1.4s infinite both;
  opacity: 0.4;
}

.typing-dot:nth-of-type(1) { animation-delay: 0.2s; }
.typing-dot:nth-of-type(2) { animation-delay: 0.4s; }
.typing-dot:nth-of-type(3) { animation-delay: 0.6s; }

@keyframes typing-blink {
  0%, 80%, 100% { opacity: 0.2; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1.1); }
}

/* Chat & Advisor Improvements */
.message {
  display: flex;
  margin-bottom: 1.5rem;
  transition: all 0.4s ease;
}

.message.fade-in {
  animation: fadeInMsg 0.5s ease-out;
}

@keyframes fadeInMsg {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.message-bubble {
  max-width: 85%;
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  line-height: 1.5;
  font-size: 1rem;
}

.bot-message .message-bubble, .bot .message-bubble {
  background: white;
  color: var(--color-secondary);
  border-bottom-left-radius: 4px;
}

.user-message .message-bubble, .user .message-bubble {
  background: var(--color-primary);
  color: var(--color-secondary);
  border-bottom-right-radius: 4px;
  margin-left: auto;
}

/* Report Box in Advisor */
.report-box {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: var(--radius-sm);
  padding: 1.5rem;
  margin: 1rem 0;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.report-box hr {
  border: 0;
  border-top: 1px solid #E2E8F0;
  margin: 1rem 0;
}

/* Fix Overlapping Text in Summary Cards */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .summary-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* Navigation Tooltip support (Browser default works but we can add styling if needed) */
[title] {
  cursor: help;
}

/* Transitions */
/* RTL Specific Overrides */
[dir="rtl"] .text-center { text-align: center; }
[dir="rtl"] .section-title, [dir="rtl"] .section-subtitle { text-align: center; }

[dir="rtl"] .advisor-header {
  flex-direction: row;
}

[dir="rtl"] .message.bot {
  align-self: flex-start;
}

[dir="rtl"] .message.user {
  align-self: flex-end;
}

[dir="rtl"] .bot .message-bubble {
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 4px;
}

[dir="rtl"] .user .message-bubble {
  border-bottom-right-radius: 20px;
  border-bottom-left-radius: 4px;
}

[dir="rtl"] .fa-paper-plane {
  transform: scaleX(-1);
}

[dir="rtl"] .nav-links {
  flex-direction: row;
}

[dir="rtl"] .feature-card {
  text-align: right;
}

[dir="rtl"] .metric-card {
  flex-direction: row;
}

[dir="rtl"] .panel-header {
  flex-direction: row;
}

[dir="rtl"] .summary-item {
  text-align: center;
}

[dir="rtl"] .chat-input-area input {
  text-align: right;
}

[dir="rtl"] .suggestion-container {
  flex-direction: row;
}

/* ==========================================================================
   SOLAR JOURNEY PAGE — New styles (do not overwrite existing)
   ========================================================================== */

/* Journey 2-col layout: roadmap left, AI panel right */
.journey-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 2rem;
  align-items: start;
}

/* Top summary panel */
.journey-top-panel {
  padding: 1.75rem 2rem;
}

.journey-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  align-items: center;
}

.journey-metric {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.jm-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  background: rgba(255, 183, 3, 0.12);
  color: var(--color-primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.jm-icon.affordable { background: rgba(16, 185, 129, 0.12); color: var(--color-success); }
.jm-icon.cost       { background: rgba(239, 68, 68, 0.1); color: var(--color-danger); }
.jm-icon.budget     { background: rgba(33, 158, 188, 0.12); color: var(--color-secondary-light); }

.jm-info small {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  display: block;
}

.jm-info p {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-secondary);
  margin: 0;
}

/* Progress bar inside top panel */
.journey-progress {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid #E2E8F0;
}

.journey-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
}

.journey-progress-bar {
  height: 10px;
  background: #E2E8F0;
  border-radius: var(--radius-full);
  overflow: hidden;
}

.journey-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-dark));
  border-radius: var(--radius-full);
  transition: width 1s cubic-bezier(0.25, 1, 0.5, 1);
}

/* ── ROADMAP PANEL ── */
.journey-roadmap-panel {
  padding: 1.75rem;
  position: sticky;
  top: 90px;
}

.roadmap-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.roadmap-step {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-smooth);
  border: 1.5px solid transparent;
  background: transparent;
  position: relative;
}

.roadmap-step:hover {
  background: rgba(255, 183, 3, 0.06);
  border-color: rgba(255, 183, 3, 0.3);
}

.roadmap-step.active {
  background: rgba(255, 183, 3, 0.1);
  border-color: var(--color-primary);
}

.roadmap-step.completed .step-number {
  background: var(--color-success);
  color: white;
  border-color: var(--color-success);
}

.roadmap-step.completed .step-label {
  color: var(--text-muted);
  text-decoration: line-through;
}

.step-number {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 50%;
  background: #F1F5F9;
  border: 1.5px solid #CBD5E1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: var(--transition-base);
}

.roadmap-step.active .step-number {
  background: var(--color-primary);
  color: var(--color-secondary);
  border-color: var(--color-primary);
}

.step-icon {
  color: var(--text-muted);
  font-size: 0.95rem;
  width: 18px;
  text-align: center;
  transition: var(--transition-base);
}

.roadmap-step.active .step-icon { color: var(--color-primary-dark); }
.roadmap-step.completed .step-icon { color: var(--color-success); }

.step-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-secondary);
  flex: 1;
  transition: var(--transition-base);
}

.roadmap-step.active .step-label { color: var(--color-secondary); font-weight: 700; }

.step-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #CBD5E1;
  transition: var(--transition-base);
}

.roadmap-step.active .step-status-dot { background: var(--color-primary); }
.roadmap-step.completed .step-status-dot { background: var(--color-success); }

/* ── AI EXPERT PANEL ── */
.journey-ai-panel {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 600px;
}

.journey-ai-panel .chat-messages {
  flex: 1;
  min-height: 400px;
}

/* ── BUDGET COMPARISON CARDS ── */
.budget-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.5rem 0 1rem;
}

.budget-card {
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-align: center;
  box-shadow: var(--shadow-md);
  transition: var(--transition-smooth);
}

.budget-card:hover { transform: scale(1.02); }

.budget-card.ideal { border-color: var(--color-primary-light); }
.budget-card.affordable { border-color: #6EE7B7; }

.budget-card .bc-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin: 0 auto 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.budget-card.ideal .bc-icon { background: rgba(255,183,3,0.1); color: var(--color-primary-dark); }
.budget-card.affordable .bc-icon { background: rgba(16,185,129,0.1); color: var(--color-success); }

.budget-card small {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  display: block;
}

.budget-card .bc-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--color-secondary);
  margin: 0.25rem 0;
}

.bc-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
}

.ideal-tag { background: rgba(255,183,3,0.1); color: var(--color-primary-dark); }
.affordable-tag { background: rgba(16,185,129,0.1); color: #065F46; }

/* Budget coverage progress */
.budget-coverage-bar-wrap {
  margin: 0.5rem 0 1.5rem;
}

.bcb-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.bcb-track {
  height: 10px;
  background: #E2E8F0;
  border-radius: var(--radius-full);
  overflow: hidden;
}

.bcb-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-dark));
  border-radius: var(--radius-full);
  transition: width 1s cubic-bezier(0.25, 1, 0.5, 1);
}

.bcb-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* Budget-sufficient single card */
.budget-card-full {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #F0FDF4;
  border: 1px solid #6EE7B7;
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
}

/* ── JOURNEY GUIDE CTA ── */
.journey-guide-cta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: linear-gradient(135deg, rgba(255,183,3,0.08), rgba(251,133,0,0.06));
  border: 1.5px solid rgba(255,183,3,0.35);
  border-radius: var(--radius-md);
  padding: 1.5rem 1.75rem;
  margin-top: 1.5rem;
  transition: var(--transition-smooth);
}

.journey-guide-cta:hover {
  border-color: var(--color-primary);
  box-shadow: 0 4px 20px rgba(255,183,3,0.15);
}

.jcta-icon {
  width: 52px;
  height: 52px;
  min-width: 52px;
  background: var(--color-primary);
  color: var(--color-secondary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.jcta-content { flex: 1; }
.jcta-content h4 { font-size: 1rem; margin-bottom: 0.25rem; color: var(--color-secondary); }
.jcta-content p { font-size: 0.88rem; color: var(--text-muted); margin: 0; }

/* ── TYPING DOTS (for both advisor and journey) ── */
.typing-dot {
  width: 7px;
  height: 7px;
  background: var(--color-primary-dark);
  border-radius: 50%;
  display: inline-block;
  animation: typingBounce 1.2s infinite ease-in-out;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* ── FADE IN ── */
.fade-in {
  animation: fadeIn 0.3s ease-out both;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── RESPONSIVE: JOURNEY PAGE ── */
@media (max-width: 1024px) {
  .journey-layout {
    grid-template-columns: 1fr;
  }

  .journey-roadmap-panel {
    position: static;
  }

  .roadmap-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
  }

  .roadmap-step {
    flex-direction: column;
    text-align: center;
    padding: 0.75rem 0.5rem;
    gap: 0.4rem;
  }

  .step-label { font-size: 0.75rem; }
  .step-status-dot { display: none; }
}

@media (max-width: 768px) {
  .journey-metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .budget-comparison {
    grid-template-columns: 1fr;
  }

  .journey-guide-cta {
    flex-direction: column;
    text-align: center;
  }

  .jcta-icon { margin: 0 auto; }

  .roadmap-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── RTL JOURNEY ── */
[dir="rtl"] .journey-roadmap-panel,
[dir="rtl"] .journey-ai-panel { direction: rtl; }

[dir="rtl"] .journey-guide-cta { flex-direction: row-reverse; }
[dir="rtl"] .jcta-content { text-align: right; }

[dir="rtl"] .journey-metric {
  flex-direction: row-reverse;
  text-align: right;
}

[dir="rtl"] .budget-card-full {
  flex-direction: row-reverse;
}

/* --- Stabilization Fixes --- */
/* Removed conflicting max-height on chat-messages - flex handles sizing */

/* Fix for overlapping inputs on tablet */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
}

/* Fix for sticky boxes */
.form-group {
    margin-bottom: 1.5rem !important;
}

/* Auth Lock Overlay */
.auth-lock-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
}

.auth-lock-content {
    background: white;
    padding: 3rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 450px;
    border: 1px solid var(--color-primary-light);
}

/* --- Auth UI --- */
/* --- Auth UI --- */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--bg-body);
}

.auth-card {
    background: var(--bg-surface);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: var(--radius-lg);
    padding: 3rem;
    box-shadow: var(--shadow-lg), var(--inner-glow);
    border: var(--border-glass);
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.auth-header i {
    color: var(--color-primary);
}

/* --- Premium UI Enhancements --- */
.summary-card {
    background: linear-gradient(135deg, var(--color-secondary) 0%, #1e293b 100%) !important;
    color: white !important;
    position: relative;
    overflow: hidden;
    padding: 2.5rem !important;
    border-radius: var(--radius-lg) !important;
}

.summary-card::after {
    content: '';
    position: absolute;
    top: -20%; right: -10%;
    width: 200px; height: 200px;
    background: var(--color-primary);
    filter: blur(100px);
    opacity: 0.2;
    z-index: 0;
}

.summary-main p {
    font-size: 3rem !important;
    font-weight: 900 !important;
    letter-spacing: -1px;
}

.metric-card {
    background: rgba(255, 255, 255, 0.6) !important;
    backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07) !important;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 1.5rem !important;
    border-radius: var(--radius-md) !important;
}

.metric-card:hover {
    transform: translateY(-8px);
    background: white !important;
    border-color: var(--color-primary-light) !important;
}

/* Learn Page Highlights Spacing & Style */
.metric-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 2rem;
}

.metric-card.yellow-premium {
    background: linear-gradient(135deg, rgba(255, 183, 3, 0.95), rgba(251, 133, 0, 0.95)) !important;
    color: var(--color-secondary) !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    box-shadow: 0 15px 35px rgba(255, 183, 3, 0.25) !important;
    backdrop-filter: blur(10px) !important;
    font-weight: 700;
}

.metric-card.yellow-premium:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 20px 45px rgba(255, 183, 3, 0.35) !important;
    border-color: white !important;
}

.metric-card.yellow-premium .metric-icon {
    background: rgba(255, 255, 255, 0.3) !important;
    color: var(--color-secondary) !important;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.metric-card.yellow-premium span {
    font-size: 1rem;
    letter-spacing: 0.5px;
}

.status-good { color: #059669 !important; font-weight: 700; }
.status-bad { color: #dc2626 !important; font-weight: 700; }

/* --- RTL Support --- */
[dir="rtl"], .rtl {
    direction: rtl;
    text-align: right;
    font-family: 'Tajawal', sans-serif;
}

[dir="rtl"] .reveal-left { transform: translateX(30px); }
[dir="rtl"] .reveal-right { transform: translateX(-30px); }
[dir="rtl"] .panel-header i { margin-right: 0; margin-left: 1rem; }
[dir="rtl"] .nav-links { margin-right: 0; margin-left: auto; }
[dir="rtl"] .summary-item { border-left: none; border-right: 1px solid rgba(255,255,255,0.1); }
[dir="rtl"] .summary-item:first-child { border-right: none; }

/* (duplicate blocks removed) */

/* --- Offline AI Banner --- */
.offline-banner {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: #FFF1F2;
  color: #E11D48;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-full);
  border: 1px solid #FDA4AF;
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
}

.offline-banner i {
  font-size: 1.1rem;
}

/* Fix for Calculator Result Cards */
.results-dashboard .metric-card {
  min-height: 100px;
  height: auto;
}

.results-dashboard .summary-card {
  border: 1px solid #CBD5E1;
  background: white;
}

.results-dashboard .summary-item p {
  font-size: 1.25rem;
}

@media (max-width: 600px) {
  .advisor-dashboard {
    height: calc(100vh - 160px);
    min-height: 400px;
    border-radius: 12px;
  }
  .advisor-header {
    padding: 1rem 1.25rem;
  }
  .chat-messages {
    padding: 1rem;
    gap: 1rem;
  }
  .chat-input-area {
    padding: 0.75rem 1rem;
  }
  .message {
    max-width: 90%;
  }
  .message-bubble {
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
  }
  .offline-banner {
    width: 90%;
    top: 70px;
    font-size: 0.8rem;
  }
}

/* --- Auth Lock Overlay --- */
.auth-lock-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(2, 48, 71, 0.4);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.auth-lock-content {
  background: white;
  padding: 4rem 3rem;
  border-radius: var(--radius-lg);
  max-width: 500px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-hover);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

/* ════════════════════════════════════════════════════════════════════
   RTL SUPPORT (ARABIC)
   ════════════════════════════════════════════════════════════════════ */

[dir="rtl"] {
  text-align: right;
}

[dir="rtl"] .hero-text,
[dir="rtl"] .feature-card,
[dir="rtl"] .showcase-content,
[dir="rtl"] .auth-header,
[dir="rtl"] .modal-content,
[dir="rtl"] .chat-message {
  text-align: right;
}

[dir="rtl"] .nav-links {
  margin-right: auto;
  margin-left: 0;
}

[dir="rtl"] .nav-actions {
  margin-left: 0;
  margin-right: 1.5rem;
}

[dir="rtl"] .form-group i {
  left: auto !important;
  right: 1rem !important;
}

[dir="rtl"] .form-control {
  padding-left: 1rem !important;
  padding-right: 3rem !important;
}

[dir="rtl"] .btn i {
  margin-right: 0;
  margin-left: 0.5rem;
}

[dir="rtl"] .metric-card {
  flex-direction: row-reverse;
}

[dir="rtl"] .metric-info {
  text-align: right;
}

[dir="rtl"] .summary-item:not(:last-child) {
  border-right: none;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

[dir="rtl"] .fa-arrow-right {
  transform: rotate(180deg);
}

[dir="rtl"] .fa-arrow-left {
  transform: rotate(180deg);
}

[dir="rtl"] .auth-container a[href="index.html"] {
  left: auto !important;
  right: 2rem !important;
  flex-direction: row-reverse;
}

[dir="rtl"] .sidebar {
  left: auto;
  right: 0;
  border-left: 1px solid var(--border-color);
  border-right: none;
}

[dir="rtl"] .roadmap-step {
  border-left: none;
  border-right: 4px solid var(--color-primary);
  padding-left: 0;
  padding-right: 1.5rem;
}

[dir="rtl"] .step-num {
  left: auto;
  right: -2.5rem;
}

/* Fix for Calculator Output Grid */
[dir="rtl"] .results-grid {
  direction: rtl;
}

/* Fix for AI Chatbot */
[dir="rtl"] .chat-bubble {
  border-radius: 20px 20px 0 20px;
}

[dir="rtl"] .chat-bubble.ai {
  border-radius: 20px 20px 20px 0;
}

/* --- RTL Mode Overrides --- */
body.rtl-mode, [dir="rtl"] {
  direction: rtl;
  text-align: right;
}

[dir="rtl"] .nav-links {
  margin-right: auto;
  margin-left: 0;
}

[dir="rtl"] .nav-actions {
  margin-left: 0;
  margin-right: 1rem;
}

[dir="rtl"] .logo i {
  margin-left: 0.5rem;
  margin-right: 0;
}

[dir="rtl"] .btn i {
  margin-left: 0.5rem;
  margin-right: 0;
}

[dir="rtl"] .feature-card {
  text-align: right;
}

[dir="rtl"] .form-input-wrapper i {
  left: auto;
  right: 1rem;
}

[dir="rtl"] .form-input-wrapper input {
  padding-left: 1rem;
  padding-right: 2.75rem;
}

[dir="rtl"] .form-input-wrapper .toggle-password {
  right: auto;
  left: 1rem;
}

[dir="rtl"] .message-bubble {
  border-radius: 18px 18px 4px 18px !important;
  text-align: right;
}

[dir="rtl"] .message.user .message-bubble {
  border-radius: 18px 18px 18px 4px !important;
}

[dir="rtl"] .suggestion-btn {
  margin-left: 0.5rem;
  margin-right: 0;
}

[dir="rtl"] .hero-content {
  direction: rtl;
}

[dir="rtl"] .metric-card {
  flex-direction: row-reverse;
  text-align: right;
}

[dir="rtl"] .metric-info {
  margin-right: 0;
  margin-left: auto;
}

[dir="rtl"] .summary-item:not(:last-child) {
  border-right: none;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

[dir="rtl"] .chat-input-area .input-wrapper i.fa-paper-plane {
  transform: scaleX(-1);
}

[dir="rtl"] .chat-input-area input {
  padding-left: 3.5rem;
  padding-right: 1.5rem;
  text-align: right;
}

[dir="rtl"] #chat-send {
  right: auto;
  left: 0.5rem;
}

[dir="rtl"] .footer-links {
  text-align: right;
}

/* ════════════════════════════════════════════════════════════════════
   STABILIZATION PASS — Final CSS Fixes
   ════════════════════════════════════════════════════════════════════ */

/* ── Mobile Navigation: show menu when .active class is toggled ── */
@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    display: none;
    z-index: 999;
    padding: 2rem;
  }

  .nav-links.active {
    display: flex;
    animation: navSlideIn 0.3s cubic-bezier(0.25, 1, 0.5, 1) both;
  }

  .nav-links a {
    font-size: 1.2rem;
    font-weight: 700;
  }

  .hamburger {
    z-index: 1001;
    position: relative;
  }

  /* Hide desktop CTA button on mobile (it clashes with hamburger) */
  .nav-actions > .btn-primary {
    display: none;
  }
}

@keyframes navSlideIn {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* RTL mobile nav */
[dir="rtl"] .nav-links {
  right: 0;
  left: auto;
}

/* ── Advisor & Q&A Dashboard: Fix height so it fills but doesn't overflow ── */
.advisor-dashboard {
  /* Override fixed calc height with flex-based approach */
  height: auto !important;
  min-height: calc(100vh - 280px) !important;
  max-height: none !important;
}

/* Pages that wrap advisor with flex: let it grow naturally */
.advisor-page-wrapper .advisor-dashboard,
.qa-page-wrapper .advisor-dashboard {
  flex: 1 1 auto !important;
  height: auto !important;
  min-height: 500px !important;
}

/* Ensure chat messages fill available vertical space */
.advisor-page-wrapper .chat-messages,
.qa-page-wrapper .chat-messages {
  min-height: 300px;
  max-height: 65vh;
}

/* ── Responsive Financial Grid on Calculator ── */
@media (max-width: 900px) {
  .dashboard-metrics {
    grid-template-columns: 1fr 1fr !important;
  }
}

@media (max-width: 600px) {
  .dashboard-metrics {
    grid-template-columns: 1fr !important;
  }

  /* Calculator results: stack panels */
  .results-dashboard {
    padding: 1.5rem !important;
  }

  .summary-main p {
    font-size: 2.5rem !important;
  }

  /* Journey layout: single column on mobile */
  .journey-layout {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }

  /* Advisor page: comfortable padding on small screens */
  .advisor-page-wrapper,
  .qa-page-wrapper {
    padding: 1rem 0.75rem 4rem !important;
  }
}

/* ── Prevent horizontal scroll globally ── */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

/* ── Auth Lock Overlay: consistent final styles ── */
.auth-lock-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background: rgba(2, 48, 71, 0.45) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  z-index: 99999 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 1.5rem !important;
  transition: opacity 0.4s ease !important;
}

.auth-lock-content {
  background: white !important;
  padding: 3.5rem 2.5rem !important;
  border-radius: var(--radius-lg) !important;
  max-width: 480px !important;
  width: 100% !important;
  text-align: center !important;
  box-shadow: 0 30px 60px rgba(0,0,0,0.25) !important;
  border: 1px solid rgba(255, 255, 255, 0.8) !important;
}

/* ── Reset Modal Backdrop Animation ── */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Toast Notification (global positioning fix) ── */
.sm-toast {
  font-family: 'Tajawal', sans-serif !important;
}

/* ── RTL: Fix for icon direction in .panel-header ── */
[dir="rtl"] .panel-header {
  flex-direction: row-reverse;
}

[dir="rtl"] .panel-header i {
  margin-right: 0;
  margin-left: 0;
}

/* ── RTL: Calc section card headers ── */
[dir="rtl"] .calc-section-card h4 {
  flex-direction: row-reverse;
}

/* ── RTL: Input hints align right ── */
[dir="rtl"] .input-hint {
  text-align: right;
}

/* ── RTL: Metric cards text ── */
[dir="rtl"] .metric-card {
  flex-direction: row-reverse !important;
}

[dir="rtl"] .metric-info {
  text-align: right !important;
}

/* ── RTL: Result summary ── */
[dir="rtl"] .summary-main {
  text-align: center;
}

/* ── RTL: Journey AI panel header ── */
[dir="rtl"] .advisor-header {
  flex-direction: row !important;
}

[dir="rtl"] #current-step-label {
  margin-left: 0;
  margin-right: auto;
}

/* ── RTL: Footer ── */
[dir="rtl"] .footer-content {
  text-align: right;
}

[dir="rtl"] .footer-bottom {
  text-align: center;
}

/* ── RTL: Advisor banner on calculator ── */
[dir="rtl"] .advisor-banner-row {
  flex-direction: row-reverse;
}

/* ── Form control RTL fix: no double icons ── */
[dir="rtl"] .form-input-wrapper i:not(.toggle-password) {
  left: auto !important;
  right: 1rem !important;
}

[dir="rtl"] .form-input-wrapper .form-control {
  padding-left: 1rem !important;
  padding-right: 3rem !important;
  text-align: right !important;
}

/* ── Card hover fix for touch devices ── */
@media (hover: none) {
  .feature-card:hover,
  .card:hover,
  .metric-card:hover,
  .rec-card:hover {
    transform: none !important;
  }
}

/* ── Auth pages: background fills full screen ── */
.auth-container {
  position: relative;
  min-height: 100vh;
  z-index: 1;
}

/* ── Ensure navbar stays above auth lock overlay ── */
.navbar {
  z-index: 1000 !important;
}

/* ── RTL: Journey roadmap step ── */
[dir="rtl"] .roadmap-step {
  flex-direction: row-reverse;
  text-align: right;
}

/* ── RTL: Budget comparison card ── */
[dir="rtl"] .budget-comparison {
  direction: rtl;
}

/* ── Summary grid responsive fix ── */
@media (max-width: 480px) {
  .summary-grid {
    grid-template-columns: 1fr !important;
  }

  .summary-item:not(:last-child) {
    border-right: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1rem;
  }
}

/* ════════════════════════════════════════════════════════════════════
   RTL SUPPORT (Arabic)
   ════════════════════════════════════════════════════════════════════ */
[dir="rtl"] {
  text-align: right;
}

[dir="rtl"] .auth-back-link {
  left: auto !important;
  right: 2rem !important;
}

[dir="rtl"] .auth-back-link i {
  transform: rotate(180deg);
}

[dir="rtl"] .form-input-wrapper i:not(.toggle-password) {
  left: auto;
  right: 1.2rem;
}

[dir="rtl"] .form-input-wrapper .toggle-password {
  right: auto;
  left: 1.2rem;
  margin-left: 0 !important;
}

[dir="rtl"] .form-control {
  padding-left: 1.2rem;
  padding-right: 3rem;
  text-align: right;
}

[dir="rtl"] .nav-links {
  margin-right: 0;
  margin-left: 2rem;
}

[dir="rtl"] .nav-links a i,
[dir="rtl"] .nav-actions a i,
[dir="rtl"] .btn i,
[dir="rtl"] .auth-back-link i {
  margin-left: 0.6rem !important;
  margin-right: 0 !important;
}

[dir="rtl"] .metric-card {
  flex-direction: row-reverse;
}

[dir="rtl"] .summary-item:not(:last-child) {
  border-right: none;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

/* Custom RTL spacing for specific elements if needed */
.rtl-mode .reveal-left { transform: translate3d(30px, 0, 0); }
.rtl-mode .reveal-right { transform: translate3d(-30px, 0, 0); }

/* ── Hamburger active state ── */
.hamburger i.fa-times {
  color: var(--color-danger);
}