/* ============================================================
   EduVoice — Global Styles + CSS Variables
   Mobile-first, dark theme, app-like
   ============================================================ */

/* --- CSS Custom Properties --- */
:root {
  --bg-primary:    #0F0F0F;
  --bg-secondary:  #1A1A1A;
  --bg-card:       #1E1E1E;
  --bg-input:      #2A2A2A;
  --text-primary:  #FFFFFF;
  --text-secondary:#A0A0A0;
  --text-muted:    #666666;
  --accent:        #6C63FF;
  --accent-light:  #8B83FF;
  --accent-glow:   rgba(108, 99, 255, 0.15);
  --success:       #4CAF50;
  --warning:       #FF9800;
  --danger:        #F44336;
  --border:        #2A2A2A;
  --border-light:  #333333;

  --radius-sm:     8px;
  --radius-md:     12px;
  --radius-lg:     16px;
  --radius-xl:     32px;

  --shadow:        0 2px 12px rgba(0,0,0,0.3);
  --shadow-lg:     0 8px 32px rgba(0,0,0,0.4);

  --font:          'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:     'JetBrains Mono', 'Fira Code', monospace;

  --nav-height:    64px;
  --max-width:     480px;
  --safe-bottom:   env(safe-area-inset-bottom, 0px);
}

@media (min-width: 992px) {
  :root {
    --max-width: 1120px;
  }
}

/* --- Reset --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img, video { max-width: 100%; display: block; }

/* --- Layout --- */
.app-container {
  max-width: var(--max-width);
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
}

.page-content {
  padding: 16px;
}

.page-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  position: sticky;
  top: 0;
  background: var(--bg-primary);
  z-index: 100;
  border-bottom: 1px solid var(--border);
}

.page-header .back-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 4px;
}

.page-header h1,
.page-header .page-title {
  font-size: 1.125rem;
  font-weight: 600;
  flex: 1;
}

.page-title {
  font-size: 1.125rem;
  font-weight: 600;
}

/* --- Typography --- */
h1 { font-size: 1.5rem; font-weight: 600; }
h2 { font-size: 1.25rem; font-weight: 600; }
h3 { font-size: 1.1rem; font-weight: 600; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-accent { color: var(--accent); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 2px; }

/* --- Utilities --- */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.w-full { width: 100%; }
.text-center { text-align: center; }

/* --- Spacing utilities --- */
.space-md { margin: var(--space-md, 16px); }
.p-md { padding: 16px; }

/* --- Additional responsive max-width --- */
@media (min-width: 480px) {
  .app-container {
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }
}
