/* =========================
   Khaply - Theme-aware CSS
   Consolidated & fixed
   ========================= */

/* ---------- Theme variables (single source of truth) ---------- */
:root {
    --primary-color: #2563eb;
    --secondary-color: #7c3aed;
    --text-color: #1f2937;
    --light-text: #6b7280;
    --background: #ffffff;
    --feature-bg: rgba(255, 255, 255, 0.8);
    --gradient-start: #f0f9ff;
    --gradient-end: #e0f2fe;
  
    /* components */
    --card-bg: #ffffff;
    --accent: var(--primary-color);
    --muted: #666666;
  }
  
  :root[data-theme="dark"] {
    --primary-color: #60a5fa;
    --secondary-color: #a78bfa;
    --text-color: #e5e7eb;
    --light-text: #9ca3af;
    --background: #111827;
    --feature-bg: rgba(17, 24, 39, 0.6);
    --gradient-start: #1f2937;
    --gradient-end: #111827;
  
    /* components */
    --card-bg: #0f1724; /* slightly darker than background for cards */
    --accent: var(--primary-color);
    --muted: #9aa3b2;
  }
  
  /* ---------- Basic resets ---------- */
  * { margin: 0; padding: 0; box-sizing: border-box; }
  html, body { height: 100%; }
  body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--background);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background 220ms ease, color 220ms ease;
  }
  
  /* ---------- Layout container ---------- */
  .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 1;
  }
  
  /* ---------- Header / logo ---------- */
  header { text-align: center; margin-bottom: 2rem; }
  .logo { text-align: center; margin-bottom: 0; }
  .logo img { max-width: 250px; height: auto; display: block; margin: 0 auto; }
  
  /* ---------- Typography ---------- */
  main { text-align: center; }
  .content { max-width: 800px; margin: 0 auto; }
  h2 { font-size: 2.5rem; margin-bottom: 1rem; font-weight: 700; line-height: 1.2; }
  .tagline { font-size: 1.25rem; color: var(--light-text); margin-bottom: 3rem; position: relative; }
  
  /* typewriter cursor */
  .streaming-text { display: inline-block; }
  @keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }
  .cursor {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background-color: var(--text-color);
    margin-left: 6px;
    vertical-align: middle;
    animation: blink 1s infinite;
  }
  
  /* ---------- Feature cards ---------- */
  .features, .feature-matrix { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px,1fr)); gap: 2rem; margin: 3rem 0; }
  .feature {
    padding: 2rem;
    background: var(--feature-bg);
    border-radius: 1rem;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
    backdrop-filter: blur(8px);
    transition: transform 0.3s ease, box-shadow 0.25s ease;
    color: var(--text-color);
  }
  .feature:hover { transform: translateY(-5px); box-shadow: 0 12px 30px rgba(0,0,0,0.10); }
  .feature i { font-size: 2.5rem; color: var(--primary-color); margin-bottom: 1rem; }
  .feature h3 { font-size: 1.5rem; margin-bottom: 1rem; }
  
  /* ---------- Footer & social ---------- */
  footer { text-align: center; margin-top: 4rem; color: var(--light-text); }
  .social-links { margin-bottom: 1rem; }
  .social-icon { color: var(--light-text); font-size: 1.5rem; margin: 0 0.5rem; text-decoration: none; transition: color 0.25s ease; }
  .social-icon:hover { color: var(--primary-color); }
  
  /* ---------- Background gradient ---------- */
  .background-animation {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    opacity: 0.7;
    z-index: 0;
    transition: background 220ms ease, opacity 220ms ease;
  }
  
  /* ---------- Misc small utilities ---------- */
  .ai-loading { display: none; }
  .stream-text { font-family: inherit; color: inherit; font-size: inherit; line-height: inherit; text-align: inherit; }
  .stream-line, .network-visualization, .node, .connection { display: none; }
  
  /* ---------- Theme toggle button ---------- */
  .theme-toggle {
    position: fixed; top: 1rem; right: 1rem;
    background: var(--feature-bg); border: none; border-radius: 50%;
    width: 40px; height: 40px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; color: var(--text-color); backdrop-filter: blur(8px);
    z-index: 11000; transition: transform .18s ease, background .18s ease;
  }
  .theme-toggle:hover { transform: scale(1.08); }
  
  /* ---------- Links / feature-link ---------- */
  .feature-link { display: block; text-decoration: none; color: inherit; cursor: pointer; }
  .feature-link:hover { transform: translateY(-5px); }
  
  /* ---------- Responsive ---------- */
  @media (max-width: 768px) {
    h2 { font-size: 2.2rem; }
    .feature { padding: 1.5rem; }
    .logo img { max-width: 150px; }
  }
  @media (max-width: 480px) {
    .logo img { max-width: 120px; }
  }
  
  /* ---------- Pricing (theme aware) ---------- */
  .pricing-section {
    margin-top: 3rem;
    margin-bottom: 3rem;
    text-align: center;
    padding: 2.5rem 1.25rem;
    background: var(--feature-bg);
    border-radius: 1rem;
    backdrop-filter: blur(8px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
  }
  .pricing-section h2 { color: var(--primary-color); margin-bottom: 0.5rem; font-size: 1.9rem; }
  .pricing-section p.intro { color: var(--light-text); max-width: 740px; margin: 0.5rem auto 1.5rem; font-size: 1rem; }
  
  .pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px,1fr)); gap: 1.5rem; margin-top: 1.5rem; text-align: left; }
  
  .pricing-card {
    background: var(--card-bg);
    color: var(--text-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
  }
  .pricing-card:hover { transform: translateY(-6px); box-shadow: 0 14px 40px rgba(0,0,0,0.10); }
  .pricing-card.highlight { background: linear-gradient(90deg,var(--primary-color),var(--secondary-color)); color: #fff; transform: scale(1.03); }
  
  .pricing-card h3 { margin: 0 0 0.35rem; font-size: 1.25rem; }
  .pricing-card .price { font-size: 1.45rem; font-weight: 700; margin: 0.35rem 0 0.75rem; }
  .pricing-card ul { list-style: none; padding: 0; margin: 0; color: inherit; }
  .pricing-card ul li { margin: 0.45rem 0; }
  .pricing-card .roi { font-weight: 700; margin-top: 0.85rem; color: inherit; }
  .pricing-section .disclaimer { font-size: 0.9rem; margin-top: 1.25rem; color: var(--muted); }
  
  /* ---------- Small fixes (remove hard-coded light-only colors) ---------- */
  /* Replaces previous hard-coded light backgrounds / text to ensure dark mode applies */
  .pricing-card { /* handled above using var(--card-bg) */ }
  .pricing-card .price, .pricing-card .roi { color: inherit; }
  
  /* ---------- Chat & WhatsApp (if present) - theme aware ---------- */
  #whatsapp-button {
    position: fixed; bottom: 100px; right: 28px;
    background-color: #25D366; color: #fff; border-radius: 50%;
    width: 55px; height: 55px; font-size: 28px; display: flex; align-items: center; justify-content: center;
    text-decoration: none; box-shadow: 0 6px 20px rgba(0,0,0,0.25); transition: transform .18s ease; z-index:10000;
  }
  #whatsapp-button:hover { transform: scale(1.06); }
  
  /* ---------- Small utilities ---------- */
  .hidden { display: none !important; }
  
  /* Centered menu wrapper */
  .nav-center {
    flex: 1;
    display: flex;
    justify-content: center;
  }

  nav ul {
    list-style: none;
    display: flex;
    gap: 1.6rem;
    margin: 0;
    padding: 0;
  }

  nav ul li a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.2s ease;
  }

  nav ul li a:hover {
    color: var(--primary-color);
  }

  /* Mobile menu toggle */
  .menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
  }

  @media (max-width: 768px) {

    /* Your existing menu behavior */
    .nav-center {
      position: absolute;
      top: 60px;
      left: 0;
      width: 100%;
      display: none;
      justify-content: center;
    }

    .nav-center.active {
      display: flex;
    }

    nav ul {
      flex-direction: column;
      background: var(--card-bg);
      border-radius: 10px;
      box-shadow: 0 4px 14px rgba(0,0,0,0.15);
      padding: 1rem 1.2rem;
    }

    .menu-toggle {
      display: block;
    }

    /* NEW: center the burger button */
    nav {
      position: relative;
    }

    .menu-toggle {
      position: absolute;
      left: 50%;
      transform: translateX(-50%);
    }
}


  nav, nav ul, nav ul li a {
    transition: all 0.25s ease;
  }

  /* ---------- Frosted Glass Navbar (Centered) ---------- */
  nav {
    width: 100%;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 2000;
  }
  html[data-theme="dark"] nav {
    background: rgba(15, 23, 36, 0.55);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  /* Logo on the left */
  .nav-logo img {
    height: 40px;
    width: auto;
  }
