/* AskQuiz — Shared base styles */

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

/* Design tokens */
:root {
  --primary: #6C5CE7;
  --primary-dark: #5A4BD1;
  --primary-light: #A29BFE;
  --accent: #00CEC9;
  --bg: #0F0E17;
  --bg-card: #1A1A2E;
  --bg-input: #16213E;
  --text: #FFFFFE;
  --text-muted: #A7A9BE;
  --success: #00B894;
  --error: #FF6B6B;
  --radius: 12px;
}

/* Base */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--primary-light); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--primary-light); outline-offset: 2px; }

/* Skip to content */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--primary);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0 0 8px 8px;
  z-index: 200;
  font-weight: 600;
}
.skip-link:focus { top: 0; }

/* Header */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}
.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
}
.logo span { color: var(--primary-light); }

/* Nav */
nav { display: flex; gap: 1.5rem; align-items: center; }
nav a { color: var(--text-muted); font-size: 0.9rem; font-weight: 500; }
nav a:hover { color: var(--text); text-decoration: none; }
nav a.active { color: var(--primary-light); }
.signin-link { color: var(--primary-light); font-size: 0.9rem; font-weight: 600; cursor: pointer; background: none; border: none; font-family: inherit; }
.signin-link:hover { color: var(--text); text-decoration: none; }
.signout-link { color: var(--text-muted); font-size: 0.85rem; cursor: pointer; background: none; border: none; font-family: inherit; }
.signout-link:hover { color: var(--text); }

/* Hamburger */
.hamburger { display: none; background: none; border: none; cursor: pointer; padding: 0.5rem; }
.hamburger svg { width: 24px; height: 24px; stroke: var(--text); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 15px rgba(108,92,231,0.4); text-decoration: none; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-secondary {
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.1);
}
.btn-secondary:hover { text-decoration: none; }
.btn-accent {
  background: linear-gradient(135deg, var(--accent) 0%, #00B894 100%);
  color: var(--bg);
  font-weight: 700;
}
.btn-accent:hover { transform: translateY(-1px); text-decoration: none; }
.btn-full { width: 100%; }
.btn-small { background: var(--bg-input); border: 1px solid rgba(255,255,255,0.08); color: var(--text-muted); border-radius: 6px; padding: 0.3rem 0.5rem; cursor: pointer; font-size: 0.85rem; font-family: inherit; transition: all 0.2s; }
.btn-small:hover { border-color: var(--primary); color: var(--text); }

/* Form inputs */
input[type="text"], input[type="email"], textarea, select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
}
textarea { min-height: 140px; resize: vertical; }

/* Footer */
footer {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  max-width: 1200px;
  margin: 0 auto;
}
footer a { color: var(--text-muted); }

/* Toast */
.qg-toast {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--success);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  z-index: 9999;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.qg-toast.fade-out {
  opacity: 0;
  transition: opacity 0.3s;
}

/* Modal */
.stats-modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 100; align-items: center; justify-content: center; }
.stats-modal-overlay.visible { display: flex; }
.stats-modal { background: var(--bg-card); border-radius: var(--radius); padding: 2rem; max-width: 500px; width: 90%; border: 1px solid rgba(255,255,255,0.1); max-height: 80vh; overflow-y: auto; }
.stats-modal h3 { margin-bottom: 1rem; }
.modal-actions { margin-top: 1rem; text-align: right; }

/* Utility */
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* Responsive — hamburger */
@media (max-width: 768px) {
  .hamburger { display: block; }
  nav {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    background: var(--bg-card);
    flex-direction: column;
    padding: 1rem 2rem;
    gap: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    z-index: 50;
  }
  nav.open { display: flex; }
  header { position: relative; }
}
