/* Modern Design System for Gujarati Font Stroke Animator & Kano App */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Noto+Sans+Gujarati:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Dark Theme (Default) */
  --bg-primary: #0a0e14;
  --bg-secondary: #121820;
  --bg-tertiary: #1a222d;
  --bg-card: rgba(22, 29, 39, 0.85);
  --bg-card-hover: rgba(28, 37, 49, 0.95);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.15);
  --border-accent: rgba(255, 107, 53, 0.4);

  --text-primary: #f0f6fc;
  --text-secondary: #8b949e;
  --text-muted: #586069;

  --accent-primary: #ff6b35;
  --accent-primary-hover: #ff7d4d;
  --accent-glow: rgba(255, 107, 53, 0.28);

  --cyan-stroke: #00f2fe;
  --cyan-glow: rgba(0, 242, 254, 0.35);

  --green-action: #2ea043;
  --green-hover: #3fb950;
  --blue-action: #1f6feb;
  --blue-hover: #388bfd;

  --stage-bg: #070a0e;
  --stage-border: #21262d;
  --stage-outline-ref: #4a5568;
  --stage-outline-bold: #203347;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
}

[data-theme="light"] {
  --bg-primary: #f6f8fa;
  --bg-secondary: #ffffff;
  --bg-tertiary: #eaeef2;
  --bg-card: rgba(255, 255, 255, 0.95);
  --bg-card-hover: #ffffff;
  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-medium: rgba(0, 0, 0, 0.14);
  --border-accent: rgba(255, 107, 53, 0.5);

  --text-primary: #1f2328;
  --text-secondary: #57606a;
  --text-muted: #8c959f;

  --accent-primary: #e65100;
  --accent-primary-hover: #f57c00;
  --accent-glow: rgba(230, 81, 0, 0.2);

  --cyan-stroke: #0284c7;
  --cyan-glow: rgba(2, 132, 199, 0.25);

  --green-action: #1a7f37;
  --green-hover: #2da44e;
  --blue-action: #0969da;
  --blue-hover: #218bff;

  --stage-bg: #f8fafc;
  --stage-border: #cbd5e1;
  --stage-outline-ref: #94a3b8;
  --stage-outline-bold: #64748b;

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.09);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12);
}

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

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px 60px;
  line-height: 1.5;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  overflow-x: hidden;
}

/* Header & Top Bar */
.top-nav {
  width: 100%;
  max-width: 1140px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.top-nav-main {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  font-size: 28px;
  filter: drop-shadow(0 2px 8px var(--accent-glow));
}

.brand-text h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.brand-text p {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 400;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Suite Switcher Two-Tab Segmented Control */
.suite-tabs-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-full);
  padding: 4px;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
}

.suite-tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.suite-tab-btn:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.suite-tab-btn.active {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.35);
  font-weight: 700;
}

.suite-tab-btn .tab-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.18);
  color: currentColor;
  font-weight: 600;
}

.suite-tab-btn:not(.active) .tab-badge {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

/* Suite Main Section Wrapper */
.suite-main-section {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: center;
}



.handwriting-frame-wrapper {
  width: 100%;
  border: none;
  background: transparent;
  box-shadow: none;
  position: relative;
}

.handwriting-iframe {
  width: 100%;
  height: 560px;
  border: none;
  display: block;
  overflow: hidden;
  transition: height 0.2s ease-out;
}

/* Theme Toggle Button */
.theme-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.theme-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-primary);
  transform: scale(1.05);
}

/* Sound Toggle Button */
.sound-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  height: 40px;
  padding: 0 14px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.sound-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--cyan-stroke);
}

.sound-btn.active {
  border-color: var(--cyan-stroke);
  color: var(--cyan-stroke);
  box-shadow: 0 0 12px var(--cyan-glow);
}

/* GitHub Link */
.github-link {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 18px;
  transition: all var(--transition-fast);
}

.github-link:hover {
  background: var(--bg-card-hover);
  transform: scale(1.05);
}

/* Floating Notification Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  border-left: 4px solid var(--accent-primary);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: all var(--transition-normal);
  z-index: 1000;
}

.toast.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* Footer */
footer {
  margin-top: 48px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

footer a {
  color: var(--accent-primary);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Mobile Responsive Optimization */
@media (max-width: 768px) {
  body {
    padding: 12px 10px 40px;
  }

  .top-nav {
    gap: 12px;
    margin-bottom: 16px;
  }

  .top-nav-main {
    gap: 10px;
  }

  .brand-text h1 {
    font-size: 16px;
  }

  .brand-text p {
    display: none;
  }

  .suite-tabs-nav {
    max-width: 100%;
    padding: 3px;
    gap: 4px;
  }

  .suite-tab-btn {
    padding: 8px 10px;
    font-size: 12px;
    gap: 5px;
  }

  .suite-tab-btn .tab-badge {
    display: none;
  }

  .handwriting-iframe {
    height: 980px;
  }
}

@media (max-width: 520px) {
  .top-nav-main {
    flex-wrap: wrap;
    gap: 8px;
  }

  .brand {
    flex: 1;
    min-width: 140px;
  }

  .brand-icon {
    font-size: 22px;
  }

  .nav-actions {
    gap: 6px;
  }

  .sound-btn {
    height: 32px;
    padding: 0 8px;
    font-size: 11px;
  }

  .nav-action-label {
    display: none;
  }

  .theme-btn, .github-link {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  .suite-tab-btn {
    padding: 8px 6px;
    font-size: 11px;
  }

  .suite-tab-btn .tab-icon {
    font-size: 13px;
  }
}
