@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
  --bg-primary: #070a12;
  --bg-secondary: #0d1322;
  --bg-surface: rgba(18, 26, 44, 0.65);
  --bg-card: rgba(23, 33, 56, 0.55);
  --bg-card-hover: rgba(30, 43, 72, 0.75);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(59, 130, 246, 0.35);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-glow: rgba(59, 130, 246, 0.4);
  --accent-purple: #8b5cf6;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --gradient-brand: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #d946ef 100%);
  --gradient-card: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 100%);
  --gradient-glow: radial-gradient(circle at 50% -20%, rgba(59, 130, 246, 0.25), transparent 70%);
  --shadow-glass: 0 12px 40px 0 rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 25px rgba(59, 130, 246, 0.2);
  --radius-xl: 24px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.12) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(16, 185, 129, 0.05) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: #60a5fa;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.narrow {
  max-width: 480px;
  margin-top: 3.5rem;
}

.page-top {
  padding-top: 2.5rem;
  padding-bottom: 4rem;
}

.center { text-align: center; }
.muted { color: var(--text-muted); }

.gradient-text {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.page-heading {
  margin-bottom: 2rem;
  position: relative;
}

.page-heading h2 {
  font-size: 2.25rem;
  line-height: 1.2;
  font-weight: 800;
}

.page-heading p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-top: 0.5rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: #60a5fa;
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  margin-bottom: 0.75rem;
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 10, 18, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-glass);
  padding: 1rem 0;
  transition: all var(--transition-fast);
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.brand-badge {
  background: var(--gradient-brand);
  padding: 0.25rem 0.5rem;
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.05em;
  box-shadow: var(--shadow-glow);
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  font-size: 1.5rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.nav-links a:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-links a.active {
  color: #ffffff;
  background: rgba(59, 130, 246, 0.18);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.nav-cta {
  background: var(--gradient-brand) !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.nav-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

/* Hero Section */
.hero {
  position: relative;
  padding: 5rem 0 4rem;
  text-align: center;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 350px;
  background: radial-gradient(ellipse at center, rgba(139, 92, 246, 0.25) 0%, rgba(59, 130, 246, 0.15) 50%, transparent 75%);
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: 3.25rem;
  line-height: 1.15;
  font-weight: 800;
  margin: 1.25rem 0;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.hero p {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 620px;
  margin: 0 auto 2.5rem;
}

.hero-buttons {
  display: flex;
  gap: 1.25rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Feature Cards & Grid */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.75rem;
  margin: 3rem 0;
}

.feature-card, .card {
  background: var(--bg-card);
  background-image: var(--gradient-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.feature-card::before, .card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-brand);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.feature-card:hover, .card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glow);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glass), var(--shadow-glow);
}

.feature-card:hover::before, .card:hover::before {
  opacity: 1;
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
  color: #60a5fa;
}

.feature-card h3, .card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.6rem;
}

.feature-card p, .card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

.card h4 {
  font-size: 1.15rem;
  margin-bottom: 0.4rem;
}

.card h4 a {
  color: var(--text-primary);
}

.card h4 a:hover {
  color: var(--primary);
}

.row-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #60a5fa;
  padding: 0.25rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
}

.notice {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-md);
  color: #93c5fd;
  padding: 1.25rem;
  font-weight: 500;
}

.notice.error {
  background: rgba(244, 63, 94, 0.1);
  border-color: rgba(244, 63, 94, 0.3);
  color: #fca5a5;
}

.category-section {
  margin-bottom: 2.5rem;
}

.category-section h3 {
  font-size: 1.35rem;
  color: var(--text-primary);
  padding-bottom: 0.75rem;
  border-bottom: 2px solid rgba(59, 130, 246, 0.4);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

input, textarea, select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-family: inherit;
  background: rgba(13, 19, 34, 0.7);
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

input::placeholder, textarea::placeholder {
  color: var(--text-muted);
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: rgba(18, 26, 44, 0.9);
}

textarea {
  min-height: 110px;
  resize: vertical;
}

.code-input {
  min-height: 240px;
  font-family: 'SFMono-Regular', Consolas, 'Fira Code', monospace;
  font-size: 0.9rem;
  background: #090d16;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-primary {
  background: var(--gradient-brand);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(139, 92, 246, 0.45);
  color: #ffffff;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  transform: translateY(-2px);
}

.btn-danger {
  background: rgba(244, 63, 94, 0.2);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: #fca5a5;
}

.btn-danger:hover {
  background: rgba(244, 63, 94, 0.8);
  color: #ffffff;
}

.btn-small {
  font-size: 0.825rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
}

/* Footer */
footer {
  margin-top: auto;
  padding: 2.5rem 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--border-glass);
  background: rgba(7, 10, 18, 0.5);
  backdrop-filter: blur(10px);
}

/* Content & Reading Experience */
.content-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  box-shadow: var(--shadow-glass);
}

.content {
  margin: 2rem 0;
  font-size: 1.05rem;
  color: #e2e8f0;
}

.content h1, .content h2, .content h3 {
  margin: 1.75rem 0 0.75rem;
  color: var(--text-primary);
}

.content p {
  margin: 1rem 0;
  line-height: 1.75;
}

.content ul, .content ol {
  margin: 1rem 0 1rem 1.75rem;
}

.content li {
  margin-bottom: 0.4rem;
}

.content code {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: #93c5fd;
  border-radius: 6px;
  padding: 0.2rem 0.45rem;
  font-size: 0.9em;
}

.content pre {
  background: #090d16;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  color: #e2e8f0;
  overflow-x: auto;
  padding: 1.25rem;
  margin: 1.5rem 0;
}

.content pre code {
  background: transparent;
  border: none;
  padding: 0;
  color: inherit;
}

.action-row {
  border-top: 1px solid var(--border-glass);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
}

.action-row.compact {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}

/* Quiz UI */
.quiz-question {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  transition: all var(--transition-fast);
}

.quiz-question:hover {
  border-color: rgba(59, 130, 246, 0.3);
}

.quiz-question .q-text {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  color: var(--text-primary);
}

.quiz-question .q-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.quiz-question .q-options label {
  display: flex;
  align-items: center;
  padding: 0.85rem 1.25rem;
  background: rgba(13, 19, 34, 0.5);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.quiz-question .q-options label:hover {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.4);
}

.quiz-question .q-options input {
  margin-right: 0.85rem;
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.result-box {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(59, 130, 246, 0.2));
  backdrop-filter: blur(20px);
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: var(--radius-xl);
  color: white;
  margin-bottom: 2rem;
  padding: 2.5rem;
  text-align: center;
  box-shadow: var(--shadow-glass);
}

.score {
  font-family: 'Outfit', sans-serif;
  font-size: 3.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #34d399, #60a5fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 1rem 0;
}

.section-title {
  font-size: 1.35rem;
  margin: 2.5rem 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Admin Grid */
.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.admin-grid .wide {
  grid-column: 1 / -1;
}

.admin-grid .card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.mini-row {
  border-top: 1px solid var(--border-glass);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 0;
}

.admin-row {
  align-items: center;
}

.row-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn 0.4s ease-out forwards;
}

/* Responsive Media Queries */
@media (max-width: 900px) {
  .hero h1 { font-size: 2.5rem; }
  .admin-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: rgba(9, 13, 22, 0.95);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-bottom: 1px solid var(--border-glass);
    flex-direction: column;
    padding: 1.5rem;
    gap: 1rem;
    transform: translateY(-150%);
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition-normal);
  }

  .nav-links.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links a {
    width: 100%;
    text-align: center;
    padding: 0.75rem;
  }

  .hero { padding: 3.5rem 0 2.5rem; }
  .hero h1 { font-size: 2rem; }
  .hero p { font-size: 1rem; }
  
  .row-card, .admin-row {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .row-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .content-card { padding: 1.5rem; }
}
