/* ==========================================================================
   SpeakIM Design System - Material 3 Inspired Modern Web Styling
   ========================================================================== */

:root {
  /* Core Brand Colors */
  --primary-teal: #00adb5;
  --primary-teal-dark: #007a80;
  --primary-teal-light: #33d9e2;
  --primary-teal-glow: rgba(0, 173, 181, 0.25);
  
  --accent-purple: #8b5cf6;
  --accent-purple-light: #a78bfa;
  --accent-purple-glow: rgba(139, 92, 246, 0.25);
  
  --accent-green: #10b981;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;

  /* Typography */
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Border Radii */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;
}

/* ==========================================================================
   Theme Definitions: Dark (Default) & Light
   ========================================================================== */

/* Dark Theme (Default) */
[data-theme="dark"] {
  --bg-body: #0b132b;
  --bg-surface: #1c2541;
  --bg-card: #1e293b;
  --bg-card-hover: #24324a;
  --bg-input: #0f172a;
  --bg-glass: rgba(28, 37, 65, 0.75);
  --bg-glass-card: rgba(30, 41, 59, 0.7);
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(0, 173, 181, 0.35);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px rgba(0, 173, 181, 0.2);
}

/* Light Theme */
[data-theme="light"] {
  --bg-body: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-input: #f8fafc;
  --bg-glass: rgba(255, 255, 255, 0.85);
  --bg-glass-card: rgba(255, 255, 255, 0.9);
  
  --border-color: #e2e8f0;
  --border-hover: rgba(0, 173, 181, 0.5);
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.12);
  --shadow-glow: 0 0 30px rgba(0, 173, 181, 0.15);
}

/* ==========================================================================
   Base & Reset
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  font-size: inherit;
}

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

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  transition: all var(--transition-normal);
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.logo-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary-teal), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 12px var(--primary-teal-glow);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}

.nav-links a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.nav-links a:hover {
  color: var(--primary-teal);
}

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

/* Theme Toggle Button */
.theme-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
  border-color: var(--primary-teal);
  transform: translateY(-1px);
}

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

/* Admin Toggle Button */
.admin-toggle-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.admin-toggle-btn:hover {
  color: var(--accent-purple);
  border-color: var(--accent-purple);
}

/* Primary CTA Button */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--primary-teal), var(--primary-teal-dark));
  color: white;
  font-weight: 600;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px var(--primary-teal-glow);
  transition: all var(--transition-normal);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--primary-teal-glow);
  background: linear-gradient(135deg, var(--primary-teal-light), var(--primary-teal));
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 24px;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all var(--transition-normal);
}

.btn-secondary:hover {
  border-color: var(--primary-teal);
  transform: translateY(-2px);
  background: var(--bg-card-hover);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero-section {
  padding: 150px 0 80px;
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  background: rgba(0, 173, 181, 0.12);
  border: 1px solid rgba(0, 173, 181, 0.25);
  color: var(--primary-teal);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 20px;
}

.hero-title {
  font-size: 3.4rem;
  line-height: 1.15;
  font-weight: 850;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.hero-title .highlight {
  color: var(--primary-teal);
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 32px;
  max-width: 540px;
}

.hero-cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 36px;
}

.hero-pill-info {
  display: flex;
  align-items: center;
  gap: 24px;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.pill-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pill-item svg {
  color: var(--accent-green);
}

/* Hero Phone Mockup */
.hero-mockup-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
}

.phone-mockup {
  position: relative;
  width: 320px;
  border-radius: 40px;
  background: #0f172a;
  padding: 12px;
  box-shadow: var(--shadow-lg), 0 0 50px var(--primary-teal-glow);
  border: 4px solid #334155;
}

.phone-screen {
  background: #0b132b;
  border-radius: 30px;
  padding: 20px 16px;
  color: #f8fafc;
  overflow: hidden;
  position: relative;
}

.mockup-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: #94a3b8;
  margin-bottom: 16px;
}

.mockup-app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.mockup-app-title {
  font-weight: 800;
  font-size: 1.2rem;
  color: #f8fafc;
}

.mockup-status-card {
  background: #1c2541;
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 14px;
  border: 1px solid rgba(0, 173, 181, 0.3);
}

.mockup-live-bubble {
  background: rgba(0, 173, 181, 0.15);
  border-radius: var(--radius-md);
  border: 1px solid var(--primary-teal);
  padding: 14px;
  margin-bottom: 16px;
  animation: pulse-glow 3s infinite ease-in-out;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 10px rgba(0, 173, 181, 0.2); }
  50% { box-shadow: 0 0 25px rgba(0, 173, 181, 0.5); }
}

.mockup-audio-wave {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 36px;
  margin: 10px 0;
}

.wave-bar {
  width: 4px;
  background: var(--primary-teal);
  border-radius: var(--radius-full);
  animation: sound-wave 1.2s infinite ease-in-out;
}

.wave-bar:nth-child(2) { animation-delay: 0.15s; }
.wave-bar:nth-child(3) { animation-delay: 0.3s; }
.wave-bar:nth-child(4) { animation-delay: 0.45s; }
.wave-bar:nth-child(5) { animation-delay: 0.6s; }
.wave-bar:nth-child(6) { animation-delay: 0.25s; }

@keyframes sound-wave {
  0%, 100% { height: 6px; }
  50% { height: 28px; }
}

/* Floating Badges */
.floating-badge {
  position: absolute;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 10px 16px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-md);
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 10;
  animation: float 4s infinite ease-in-out;
}

.badge-top-left {
  top: 10%;
  left: -40px;
  animation-delay: 0s;
}

.badge-bottom-right {
  bottom: 12%;
  right: -40px;
  animation-delay: 2s;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ==========================================================================
   Interactive Voice Tester Section
   ========================================================================== */

.tester-section {
  padding: 80px 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 50px;
}

.section-tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary-teal);
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.section-title {
  font-size: 2.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 14px;
}

.section-desc {
  font-size: 1.1rem;
  color: var(--text-secondary);
}

.tester-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-color);
  padding: 36px;
  box-shadow: var(--shadow-md);
  max-width: 800px;
  margin: 0 auto;
}

.tester-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.control-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.control-select, .control-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
}

.control-select:focus, .control-input:focus {
  border-color: var(--primary-teal);
}

.tester-output-box {
  background: var(--bg-input);
  border-radius: var(--radius-md);
  padding: 20px;
  border: 1px dashed var(--border-color);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tester-output-text {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ==========================================================================
   Apps Grid
   ========================================================================== */

.apps-section {
  padding: 80px 0;
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-top: 40px;
}

.app-badge-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  text-align: center;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.app-badge-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary-teal);
  box-shadow: var(--shadow-md);
}

.app-icon-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  color: var(--primary-teal);
  font-size: 1.3rem;
  font-weight: 800;
}

.app-badge-card h4 {
  font-size: 0.95rem;
  font-weight: 700;
}

.app-badge-card span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Features Section
   ========================================================================== */

.features-section {
  padding: 80px 0;
  background: var(--bg-surface);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 28px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 32px;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary-teal);
  box-shadow: var(--shadow-md);
}

.feature-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: rgba(0, 173, 181, 0.15);
  color: var(--primary-teal);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.feature-icon svg {
  width: 26px;
  height: 26px;
}

.feature-title {
  font-size: 1.3rem;
  font-weight: 750;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.feature-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ==========================================================================
   How It Works Steps
   ========================================================================== */

.how-it-works-section {
  padding: 80px 0;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
  position: relative;
}

.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 32px;
  position: relative;
}

.step-number {
  display: inline-block;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-teal);
  color: white;
  font-weight: 800;
  text-align: center;
  line-height: 36px;
  margin-bottom: 16px;
}

.step-title {
  font-size: 1.2rem;
  font-weight: 750;
  margin-bottom: 10px;
}

.step-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   Use Cases Section
   ========================================================================== */

.usecases-section {
  padding: 80px 0;
  background: var(--bg-surface);
}

.usecases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.usecase-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: left;
}

.usecase-emoji {
  font-size: 2rem;
  margin-bottom: 12px;
}

.usecase-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.usecase-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   Google Play Store CTA & QR Modal
   ========================================================================== */

.cta-banner-section {
  padding: 80px 0;
  background: linear-gradient(135deg, rgba(0, 173, 181, 0.15), rgba(139, 92, 246, 0.15));
  border-top: 1px solid var(--border-color);
}

.cta-banner-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-color);
  padding: 48px;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
  box-shadow: var(--shadow-lg);
}

.google-play-badge-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 24px;
  background: #000000;
  color: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid #334155;
  transition: all var(--transition-normal);
}

.google-play-badge-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  border-color: var(--primary-teal);
}

.qr-code-box {
  background: white;
  padding: 16px;
  border-radius: var(--radius-md);
  display: inline-block;
  margin: 20px 0;
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   Modal Component
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-color);
  width: 100%;
  max-width: 520px;
  padding: 32px;
  box-shadow: var(--shadow-lg);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-input);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.modal-close-btn:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

/* ==========================================================================
   Admin CMS Drawer
   ========================================================================== */

.admin-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 480px;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  z-index: 1100;
  transform: translateX(100%);
  transition: transform var(--transition-normal);
  display: flex;
  flex-direction: column;
}

.admin-drawer.active {
  transform: translateX(0);
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}

.admin-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.admin-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.admin-field input, .admin-field textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
}

.admin-field textarea {
  min-height: 80px;
  resize: vertical;
}

.admin-field input:focus, .admin-field textarea:focus {
  border-color: var(--primary-teal);
}

.admin-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 12px;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  padding: 60px 0 30px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-body);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand p {
  color: var(--text-secondary);
  margin-top: 12px;
  max-width: 320px;
  font-size: 0.9rem;
}

.footer-col h5 {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-primary);
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: color var(--transition-fast);
}

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

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Responsive Breakpoints */
@media (max-width: 960px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-subtitle {
    margin: 0 auto 32px;
  }
  .hero-cta-group {
    justify-content: center;
  }
  .hero-pill-info {
    justify-content: center;
  }
  .floating-badge {
    display: none;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .nav-links {
    display: none;
  }
}

@media (max-width: 600px) {
  .hero-title {
    font-size: 2.4rem;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}
