/* ===========================================
   صوتي (Sawti) - CSS Styles
   Theme: Catppuccin Mocha
   =========================================== */

/* CSS Variables */
:root {
  /* Catppuccin Mocha Colors */
  --rosewater: #f5e0dc;
  --flamingo: #f2cdcd;
  --pink: #f5c2e7;
  --mauve: #cba6f7;
  --red: #f38ba8;
  --maroon: #eba0ac;
  --peach: #fab387;
  --yellow: #f9e2af;
  --green: #a6e3a1;
  --teal: #94e2d5;
  --sky: #89dceb;
  --sapphire: #74c7ec;
  --blue: #89b4fa;
  --lavender: #b4befe;

  --text: #cdd6f4;
  --subtext1: #bac2de;
  --subtext0: #a6adc8;
  --overlay2: #9399b2;
  --overlay1: #7f849c;
  --overlay0: #6c7086;
  --surface2: #585b70;
  --surface1: #45475a;
  --surface0: #313244;
  --base: #1e1e2e;
  --mantle: #181825;
  --crust: #11111b;

  /* Semantic Colors */
  --primary: var(--blue);
  --primary-hover: var(--sapphire);
  --secondary: var(--pink);
  --accent: var(--green);
  --warning: var(--yellow);
  --error: var(--red);
  --success: var(--green);

  /* Layout */
  --bg-body: var(--base);
  --bg-card: var(--surface0);
  --bg-input: var(--surface1);
  --text-primary: var(--text);
  --text-secondary: var(--subtext0);
  --border-color: var(--surface1);
  --border-radius: 12px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);

  /* Typography */
  --font-family: 'IBM Plex Sans Arabic', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ==========================================
   Header
   ========================================== */
.header {
  position: sticky;
  top: 0;
  background: var(--mantle);
  border-bottom: 1px solid var(--border-color);
  z-index: 100;
  backdrop-filter: blur(10px);
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.5rem;
  font-weight: 700;
}

.logo-icon {
  font-size: 1.8rem;
}

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

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--primary);
}

/* ==========================================
   Buttons
   ========================================== */
.btn-primary {
  background: var(--primary);
  color: var(--crust);
  padding: 10px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-hero {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--primary), var(--mauve));
  color: var(--crust);
  padding: 16px 32px;
  border-radius: 12px;
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 700;
  transition: all 0.3s;
  box-shadow: 0 4px 20px rgba(137, 180, 250, 0.3);
}

.btn-hero:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(137, 180, 250, 0.4);
}

/* ==========================================
   Hero Section
   ========================================== */
.hero {
  padding: 80px 0;
  text-align: center;
  background: linear-gradient(180deg, var(--mantle) 0%, var(--bg-body) 100%);
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  margin-bottom: 20px;
  line-height: 1.2;
}

.highlight {
  background: linear-gradient(135deg, var(--primary), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 40px;
}

/* ==========================================
   How Section
   ========================================== */
.how-section {
  padding: 80px 0;
}

.section-title {
  font-size: 2rem;
  text-align: center;
  margin-bottom: 50px;
}

.steps {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.step {
  background: var(--bg-card);
  padding: 30px;
  border-radius: var(--border-radius);
  text-align: center;
  width: 200px;
  transition: transform 0.2s;
}

.step:hover {
  transform: translateY(-5px);
}

.step-icon {
  font-size: 3rem;
  margin-bottom: 15px;
}

.step h3 {
  margin-bottom: 10px;
  color: var(--primary);
}

.step-arrow {
  font-size: 2rem;
  color: var(--overlay0);
}

/* ==========================================
   Types Section
   ========================================== */
.types-section {
  padding: 60px 0;
  background: var(--mantle);
}

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

.type-card {
  background: var(--bg-card);
  padding: 25px;
  border-radius: var(--border-radius);
  text-align: center;
  border: 1px solid var(--border-color);
  transition: all 0.2s;
}

.type-card:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
}

.type-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 15px;
}

.type-card h3 {
  margin-bottom: 8px;
}

.type-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ==========================================
   Try Section
   ========================================== */
.try-section {
  padding: 80px 0;
}

/* Type Selector */
.type-selector {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.type-btn {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 2px solid var(--border-color);
  padding: 12px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.2s;
}

.type-btn:hover {
  border-color: var(--primary);
}

.type-btn.active {
  background: var(--primary);
  color: var(--crust);
  border-color: var(--primary);
}

/* Recorder */
.recorder-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-bottom: 40px;
}

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

.record-btn {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--mauve));
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  box-shadow: 0 4px 30px rgba(137, 180, 250, 0.3);
}

.record-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 40px rgba(137, 180, 250, 0.4);
}

.record-btn.recording {
  background: linear-gradient(135deg, var(--red), var(--maroon));
  animation: pulse 1.5s infinite;
  box-shadow: 0 4px 30px rgba(243, 139, 168, 0.4);
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.record-icon {
  font-size: 3rem;
}

.timer {
  font-size: 2rem;
  font-weight: 600;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}

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

/* Processing */
.processing {
  text-align: center;
  padding: 40px;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--surface1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Result */
.result {
  background: var(--bg-card);
  border-radius: var(--border-radius);
  padding: 30px;
  max-width: 800px;
  margin: 0 auto;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  flex-wrap: wrap;
  gap: 15px;
}

.result-header h3 {
  font-size: 1.3rem;
}

.result-actions {
  display: flex;
  gap: 10px;
}

.action-btn {
  background: var(--surface1);
  color: var(--text-primary);
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.action-btn:hover {
  background: var(--surface2);
}

.result-section {
  margin-bottom: 25px;
}

.result-section:last-child {
  margin-bottom: 0;
}

.result-section h4 {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.transcript-box {
  background: var(--surface1);
  padding: 15px;
  border-radius: 8px;
  color: var(--subtext1);
  font-size: 0.95rem;
  line-height: 1.7;
}

.content-box {
  background: var(--mantle);
  padding: 20px;
  border-radius: 8px;
  line-height: 1.8;
  white-space: pre-wrap;
}

.content-box h1, .content-box h2, .content-box h3 {
  color: var(--primary);
  margin: 20px 0 10px;
}

.content-box h1:first-child,
.content-box h2:first-child,
.content-box h3:first-child {
  margin-top: 0;
}

/* Error */
.error {
  background: rgba(243, 139, 168, 0.1);
  border: 1px solid var(--red);
  border-radius: var(--border-radius);
  padding: 30px;
  text-align: center;
  max-width: 500px;
  margin: 0 auto;
}

.error p {
  color: var(--red);
  margin-bottom: 20px;
}

/* ==========================================
   Footer
   ========================================== */
.footer {
  padding: 40px 0;
  text-align: center;
  border-top: 1px solid var(--border-color);
  margin-top: 60px;
}

.footer p {
  color: var(--text-secondary);
}

.footer-note {
  font-size: 0.85rem;
  margin-top: 10px;
}

/* ==========================================
   Utilities
   ========================================== */
.hidden {
  display: none !important;
}

/* ==========================================
   Responsive
   ========================================== */
@media (max-width: 768px) {
  .hero {
    padding: 50px 0;
  }

  .hero-title {
    font-size: 2rem;
  }

  .steps {
    flex-direction: column;
  }

  .step-arrow {
    transform: rotate(90deg);
  }

  .step {
    width: 100%;
    max-width: 300px;
  }

  .type-selector {
    flex-direction: column;
    align-items: stretch;
  }

  .type-btn {
    width: 100%;
  }

  .result-header {
    flex-direction: column;
    align-items: stretch;
  }

  .result-actions {
    justify-content: center;
  }
}

/* ==========================================
   Toast Notifications
   ========================================== */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface0);
  color: var(--text-primary);
  padding: 12px 24px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  z-index: 1000;
  animation: slideUp 0.3s ease;
}

.toast.success {
  border-right: 4px solid var(--green);
}

.toast.error {
  border-right: 4px solid var(--red);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}
