/* ─── auriga2google — Mobile-First Phone-Driven Aesthetics ─── */
:root {
  /* Google Palette */
  --google-blue: #4285F4;
  --google-blue-hover: #3367d6;
  --google-red: #EA4335;
  --google-yellow: #FBBC05;
  --google-green: #34A853;

  /* Theme Tokens */
  --bg-color: #f8f9fa;
  --bg-card: rgba(255, 255, 255, 0.88);
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.14);

  --text-primary: #202124;
  --text-muted: #5f6368;

  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
  --font-mono: 'Space Mono', monospace;

  /* Apple Squircle Rounded Corners */
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --radius-pill: 980px;
}

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

html, body {
  max-width: 100vw;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-main);
  background: var(--bg-color);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  position: relative;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 90px; /* Space for Mobile Bottom Nav */
}

/* Background Image Layer */
.bg-image-layer {
  position: fixed;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: -2;
  opacity: 0.35;
  filter: blur(1px);
}
.bg-overlay-layer {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, rgba(248, 249, 250, 0.45) 0%, rgba(248, 249, 250, 0.92) 100%);
  z-index: -1;
}

/* ─── Fully Responsive Navbar & Header ─── */
#navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  width: 100%;
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.logo-text {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}
.logo-accent {
  color: var(--google-blue);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  transition: all 0.2s ease;
  white-space: nowrap;
}
.nav-link:hover, .nav-link.active {
  color: var(--google-blue);
  background: rgba(66, 133, 244, 0.1);
}

/* Mobile Bottom Navigation Bar (iOS Tabbar Style) */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  width: calc(100% - 32px);
  max-width: 420px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-pill);
  padding: 6px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.12);
  justify-content: space-around;
  align-items: center;
}
.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 8px 4px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
  border-radius: var(--radius-pill);
  transition: all 0.2s ease;
}
.mobile-nav-item.active {
  color: var(--google-blue);
  background: rgba(66, 133, 244, 0.12);
}

/* ─── Google Buttons & Apple Pills ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 14px;
  border: none;
  border-radius: var(--radius-pill);
  padding: 14px 24px;
  min-height: 50px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  text-align: center;
  width: 100%;
  max-width: 100%;
  word-break: break-word;
}
@media (min-width: 640px) {
  .btn { width: auto; font-size: 15px; padding: 16px 28px; }
}

.btn-google-primary, .btn-primary {
  background: var(--google-blue);
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(66, 133, 244, 0.3);
}
.btn-google-primary:hover:not(:disabled), .btn-primary:hover:not(:disabled) {
  background: var(--google-blue-hover);
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 8px 24px rgba(66, 133, 244, 0.4);
}
.btn-google-secondary, .btn-outline {
  background: #ffffff;
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.btn-google-secondary:hover:not(:disabled), .btn-outline:hover:not(:disabled) {
  background: #ffffff;
  border-color: var(--google-blue);
  color: var(--google-blue);
  transform: translateY(-2px) scale(1.01);
}

.btn-xl {
  padding: 16px 24px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
@media (min-width: 640px) {
  .btn-xl { padding: 18px 36px; font-size: 15px; }
}
.btn-sm {
  padding: 10px 18px;
  font-size: 13px;
  min-height: 44px;
}
.btn-xs {
  padding: 6px 14px;
  font-size: 11px;
  min-height: 32px;
}

/* ─── Main Container & Mobile Containment ─── */
#app {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

/* ─── Hero Section ─── */
#section-hero {
  max-width: 880px;
  margin: 16px auto 24px;
  padding: 0 14px;
  width: 100%;
}
.hero-card-apple {
  background: var(--bg-card);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-lg);
  padding: 30px 16px;
  text-align: center;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.06);
  width: 100%;
}
@media (min-width: 640px) {
  .hero-card-apple { padding: 52px 40px; }
}

.hero-logos-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 14px;
}
.hero-brand-logo {
  height: 42px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
}
@media (min-width: 640px) {
  .hero-brand-logo { height: 56px; max-width: none; }
}
.hero-arrow {
  font-size: 20px;
  color: var(--google-blue);
  font-weight: 800;
}

.hero-author-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--google-blue);
  background: rgba(66, 133, 244, 0.1);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  margin-bottom: 14px;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  max-width: 100%;
  word-break: break-word;
}

.hero-title {
  font-size: clamp(26px, 7.5vw, 56px);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  margin-bottom: 14px;
  word-break: break-word;
  overflow-wrap: break-word;
}
.hero-title-accent {
  color: var(--google-blue);
}
.hero-desc {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 24px;
  line-height: 1.6;
  word-break: break-word;
}
@media (min-width: 640px) {
  .hero-desc { font-size: 16px; margin-bottom: 36px; }
}

/* Dual Button Action Layout - Mobile Stacked & Centered */
.hero-cta-grid {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  width: 100%;
}
@media (min-width: 640px) {
  .hero-cta-grid { flex-direction: row; margin-bottom: 36px; }
}

/* Status Legend */
.legend-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
}
.legend-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--text-primary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}
.pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.pill-green .pill-dot { background: var(--google-green); }
.pill-yellow .pill-dot { background: var(--google-yellow); }
.pill-red .pill-dot { background: var(--google-red); }

/* ─── Apple Cards & Content ─── */
.card-apple, .section-card-apple {
  background: var(--bg-card);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-lg);
  padding: 20px 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
  margin-bottom: 20px;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}
@media (min-width: 640px) {
  .card-apple, .section-card-apple { padding: 36px; margin-bottom: 32px; }
}

.section-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--google-blue);
  letter-spacing: 0.08em;
  margin-bottom: 6px;
  text-transform: uppercase;
}
.section-title {
  font-size: clamp(20px, 5vw, 28px);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 18px;
  word-break: break-word;
}

/* Dashboard & Onboarding */
#section-dashboard, #section-onboarding {
  max-width: 880px;
  margin: 16px auto;
  padding: 0 14px;
  width: 100%;
}
.hidden { display: none !important; }

/* ─── Settings Page ─── */
.page-header { max-width: 880px; margin: 20px auto 16px; padding: 0 14px; text-align: center; width: 100%; }
.page-title { font-size: clamp(24px, 6vw, 36px); font-weight: 800; letter-spacing: -0.03em; margin-bottom: 8px; word-break: break-word; }
.page-desc { font-size: 14px; color: var(--text-muted); word-break: break-word; }

.settings-section { max-width: 880px; margin: 0 auto 20px; padding: 0 14px; width: 100%; }
.filters-grid { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 16px; width: 100%; }
@media (min-width: 640px) {
  .filters-grid { grid-template-columns: repeat(2, 1fr); }
}

.filter-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; background: #ffffff; border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02); min-height: 50px; width: 100%;
}
.filter-name { font-size: 13px; font-weight: 600; }
.course-filter-cb { width: 22px; height: 22px; accent-color: var(--google-blue); cursor: pointer; flex-shrink: 0; }

.color-settings-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 16px; width: 100%; }
@media (min-width: 640px) {
  .color-settings-grid { grid-template-columns: repeat(3, 1fr); }
}

.color-setting-item { background: #ffffff; padding: 16px; border-radius: var(--radius-md); border: 1px solid var(--border); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02); width: 100%; }
.color-setting-label { font-size: 14px; font-weight: 700; display: block; }
.color-setting-desc { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; display: block; }
.color-picker-wrap { display: flex; align-items: center; gap: 10px; width: 100%; }
.color-select { flex: 1; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: #f8f9fa; font-size: 13px; font-weight: 600; min-height: 46px; width: 100%; max-width: 100%; word-break: break-all; }
.color-preview { width: 36px; height: 36px; border-radius: var(--radius-sm); border: 1px solid var(--border); flex-shrink: 0; }

.settings-save-row { max-width: 880px; margin: 20px auto; padding: 0 14px; text-align: center; width: 100%; }

/* ─── Credits & Docs (Prevent Right-Side Overflow) ─── */
.credits-hero, .docs-layout { max-width: 880px; margin: 20px auto; padding: 0 14px; width: 100%; }
.creator-card-big { display: flex; flex-direction: column; gap: 16px; align-items: center; text-align: center; width: 100%; }
@media (min-width: 640px) {
  .creator-card-big { flex-direction: row; text-align: left; }
}

.creator-bio { font-size: 14px; color: var(--text-muted); margin-bottom: 16px; line-height: 1.6; word-break: break-word; }

.docs-layout { display: grid; grid-template-columns: 1fr; gap: 20px; width: 100%; }
@media (min-width: 768px) {
  .docs-layout { grid-template-columns: 220px 1fr; gap: 36px; }
  .docs-sidebar { display: block; }
}
.docs-sidebar { display: none; }
.docs-main { width: 100%; max-width: 100%; overflow-x: hidden; }

.doc-h2 { font-size: 19px; font-weight: 800; margin-bottom: 10px; border-bottom: 1px solid var(--border); padding-bottom: 8px; word-break: break-word; }
.doc-p { font-size: 14px; color: var(--text-muted); margin-bottom: 14px; line-height: 1.6; word-break: break-word; overflow-wrap: break-word; }

/* Pre/Code Blocks (Mobile Friendly Wrap) */
.doc-code, pre, code {
  background: #202124;
  color: #f8f9fa;
  padding: 14px;
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 12px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  overflow-wrap: anywhere;
  margin-bottom: 18px;
  max-width: 100%;
}

/* ─── Footer ─── */
#main-footer {
  background: rgba(255, 255, 255, 0.95);
  border-top: 1px solid var(--border);
  padding: 36px 14px 24px;
  margin-top: 36px;
  width: 100%;
}
.footer-inner { max-width: 1100px; margin: 0 auto; text-align: center; width: 100%; }
@media (min-width: 640px) {
  .footer-inner { text-align: left; }
}

.footer-cols { display: grid; grid-template-columns: 1fr; gap: 20px; margin-bottom: 24px; }
@media (min-width: 640px) {
  .footer-cols { grid-template-columns: repeat(3, 1fr); gap: 32px; }
}

.footer-col { display: flex; flex-direction: column; gap: 8px; align-items: center; }
@media (min-width: 640px) {
  .footer-col { align-items: flex-start; }
}

.footer-col-title { font-size: 11px; font-weight: 800; color: var(--text-muted); letter-spacing: 0.08em; }
.footer-link { color: var(--text-primary); text-decoration: none; font-size: 14px; font-weight: 600; }

.footer-creator { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text-primary); background: #ffffff; padding: 12px; border-radius: var(--radius-md); border: 1px solid var(--border); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02); margin: 0 auto; }
@media (min-width: 640px) {
  .footer-creator { margin: 0; }
}

.creator-mark { width: 32px; height: 32px; background: var(--google-blue); color: #fff; font-weight: 800; font-size: 12px; display: flex; align-items: center; justify-content: center; border-radius: 50%; }

.footer-brand {
  font-size: clamp(28px, 9vw, 90px);
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 1;
  text-align: center;
  color: rgba(0, 0, 0, 0.04);
  user-select: none;
  margin: 14px 0 20px;
  word-break: break-all;
}

.footer-bottom { display: flex; flex-direction: column; align-items: center; gap: 10px; border-top: 1px solid var(--border); padding-top: 18px; font-size: 12px; color: var(--text-muted); text-align: center; }
@media (min-width: 640px) {
  .footer-bottom { flex-direction: row; justify-content: space-between; }
}

.footer-bottom-links { display: flex; gap: 14px; }
.footer-bottom-links a { color: var(--text-muted); text-decoration: none; }

/* Toast */
.toast-container { position: fixed; bottom: 85px; right: 14px; left: 14px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; }
@media (min-width: 640px) {
  .toast-container { left: auto; bottom: 24px; }
}

/* Mobile Media Query Overrides */
@media (max-width: 640px) {
  .nav-links { display: none; }
  .mobile-bottom-nav { display: flex; }
}
