/* =====================================================
   APPLE-LEVEL GRAMMAR SINGLE
   Clean • Calm • Premium • Scalable
===================================================== */

/* =====================================================
   ROOT VARIABLES (THEME-AWARE)
===================================================== */
:root {
  --bg: #f9fafb;
  --bg-card: #ffffff;
  --bg-header: rgba(255,255,255,0.85);
  --bg-nav: rgba(255,255,255,0.9);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --border: #e5e7eb;
  --accent: #2563eb;

  --radius-lg: 1.4rem;
  --radius-md: 0.85rem;

  --shadow-sm: 0 8px 26px rgba(0,0,0,.08);
  --shadow-md: 0 20px 48px rgba(0,0,0,.14);
}

/* ================= DARK ================= */
body.dark {
  --bg: #020617;
  --bg-card: #020617;
  --bg-header: rgba(2,6,23,0.9);
  --bg-nav: rgba(2,6,23,0.95);

  --text-primary: #f1f5f9;
  --text-secondary: #cbd5f5;
  --text-muted: #94a3b8;

  --border: #1e293b;
}

/* ================= DIM ================= */
body.dim {
  --bg: #0f172a;
  --bg-card: #020617;
  --bg-header: rgba(2,6,23,0.82);
  --bg-nav: rgba(2,6,23,0.9);

  --text-primary: #e5e7eb;
  --text-secondary: #cbd5f5;
  --text-muted: #94a3b8;

  --border: #1e293b;
}

/* =====================================================
   BASE RESET
===================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

.no-copy {
  user-select: none;
  -webkit-user-select: none;
}

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

.primary {
  color: var(--accent);
}

/* =====================================================
   HEADER (APPLE GLASS)
===================================================== */
.app-header {
  backdrop-filter: blur(20px);
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

.brand-title {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* =====================================================
   LANGUAGE SELECT (POLISHED)
===================================================== */
.lang-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lang-badge {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.lang-select {
  appearance: none;
  padding: 0.55rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.85rem;
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
}

body.dark .lang-select,
body.dim .lang-select {
  background: #020617;
  border-color: #374151;
  color: #e5e7eb;
}

/* =====================================================
   GRAMMAR CARD
===================================================== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.35s cubic-bezier(.22,1,.36,1),
    box-shadow 0.35s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

/* =====================================================
   SECTION HEADER
===================================================== */
.lesson-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.section-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

/* =====================================================
   ICON
===================================================== */
.icon {
  font-size: 2.2rem;
  line-height: 1;
  transition: transform 0.35s ease;
}

.card:hover .icon {
  transform: scale(1.12);
}

/* =====================================================
   TRANSLATIONS
===================================================== */
.translation {
  font-size: 0.9rem;
}

.translation-it {
  color: rgba(21,91,255,0.65);
}

.translation-en {
  color: var(--text-secondary);
}

.translation-ur {
  color: #f97316;
}

.hidden {
  display: none !important;
}

/* =====================================================
   EXAMPLES
===================================================== */
.example {
  font-style: italic;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* =====================================================
   PLAY BUTTON
===================================================== */
.play-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.play-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 18px rgba(37,99,235,.35);
}

.play-btn:active {
  transform: scale(0.94);
}

/* =====================================================
   MOBILE NAV (iOS PILL)
===================================================== */
.nav {
  backdrop-filter: blur(18px);
  background: var(--bg-nav);
  border-top: 1px solid var(--border);
}

body.dark .nav {
  background: rgba(23,32,44,0.75);
}

body.dim .nav {
  background: rgba(31,41,55,0.75);
}

/* =====================================================
   RESPONSIVE
===================================================== */
@media (min-width: 1024px) {
  .card:hover {
    transform: translateY(-3px);
  }
}

/* =====================================================
   ACCESSIBILITY
===================================================== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
