/* John's GCSE Hub - Google Material Design */

:root {
  color-scheme: light only;
  /* Google Material Design Color Palette */
  --bg: #ffffff;
  --bg-light: #F8F9FA;          /* Google light background */
  --bg-gradient: linear-gradient(135deg, #F8F9FA 0%, #E8EAED 100%);
  --text: #202124;              /* Google dark text */
  --text-light: #5F6368;        /* Google gray - secondary text */
  --muted: #80868B;             /* Subtle muted text */
  --border: #DADCE0;            /* Google border color */
  --link: #4285F4;              /* Google blue - links */
  --hover: #F8F9FA;             /* Subtle hover state */
  --hover-bg: #E8EAED;          /* Gray background hover */
  --success: #34A853;           /* Google green */
  --warning: #F9AB00;           /* Google yellow */
  --danger: #EA4335;            /* Google red */
  --info: #4285F4;              /* Google blue for info */
  --accent: #4285F4;            /* Google blue as primary accent */
  --radius: 8px;
  --radius-pill: 20px;
  --shadow: 0 1px 2px rgba(60, 64, 67, 0.3);
  --shadow-lg: 0 1px 3px rgba(60, 64, 67, 0.3), 0 4px 8px rgba(60, 64, 67, 0.15);
}

/* Dark mode disabled - always use light mode */
/*
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #191919;
    --text: #e6e6e6;
    --text-light: #a6a6a6;
    --muted: #787774;
    --border: #2f2f2f;
    --link: #7aa2ff;
    --hover: #232323;
    --hover-bg: #2a2a2a;
    --accent: #5ec362;
  }
}
*/

/* ==========================================
   Navigation styles removed - now in nav-template.css
   All pages should use nav-template.css for consistent navigation
   ========================================== */

/* ==========================================
   Footer with Environment Indicators
   ========================================== */
.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-left {
  flex: 1;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.env-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.env-prod {
  background: #e8f5e8;
  color: #2e7d32;
  border: 1px solid #4caf50;
}

.env-dev {
  background: #e3f2fd;
  color: #1565c0;
  border: 1px solid #2196f3;
}

.env-hot {
  background: #fff3e0;
  color: #ef6c00;
  border: 1px solid #ff9800;
}

.env-admin {
  background: #fce4ec;
  color: #c2185b;
  border: 1px solid #e91e63;
}

.build-info {
  font-size: 11px;
  color: var(--text-light);
  font-family: monospace;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .nav-container {
    padding: 0 16px;
  }
  
  .nav-btn {
    padding: 6px 12px;
    font-size: 13px;
  }
  
  .user-menu {
    flex-wrap: wrap;
    gap: 8px;
    padding: 6px 12px;
  }
  
  .user-greeting {
    width: 100%;
    text-align: center;
    margin-bottom: 4px;
  }
  
  .footer-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .footer-right {
    align-self: flex-end;
  }
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  color-scheme: light only;
}

body {
  font-family: 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  background: var(--bg-light);
  background: var(--bg-gradient);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Layout */
.page {
  max-width: 1600px;
  margin: 0 auto;
  padding: 20px;
}

@media (max-width: 768px) {
  .page {
    padding: 20px;
  }
}

/* Breadcrumbs (Notion-style) */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.breadcrumbs a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}

.breadcrumbs a:hover {
  color: var(--text);
}

.breadcrumbs .separator {
  opacity: 0.5;
}

/* Page Header */
.page-header {
  margin: 0 0 48px;
}

.page h1 {
  margin: 0 0 8px;
  font-weight: 700;
  font-size: 40px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text);
}

.page h1 .emoji {
  margin-right: 12px;
}

.page p.subtitle {
  margin: 4px 0 0;
  font-size: 16px;
  color: var(--text-light);
  line-height: 1.5;
}

/* Blocks */
.blocks {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.block {
  padding: 16px 12px;
  border-radius: var(--radius);
  transition: all 0.12s ease;
  cursor: default;
}

.block:hover {
  background: var(--hover);
}

.block h2 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.block h2 .emoji {
  font-size: 20px;
}

.block .meta {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 12px;
}

/* Links and Lists */
.links {
  margin: 12px 0 0;
  padding-left: 24px;
}

.links li {
  margin: 6px 0;
  line-height: 1.5;
}

.links a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.12s;
}

.links a:hover {
  color: var(--link);
}

/* Hierarchical ordered list numbering */
ol.links {
  list-style: none;
  counter-reset: item;
}

ol.links li {
  counter-increment: item;
}

ol.links li::marker {
  content: "";
}

ol.links li::before {
  content: counters(item, ".") ". ";
  color: var(--muted);
  margin-right: 8px;
  font-size: 14px;
}

ol.links ol {
  counter-reset: item;
  margin-top: 6px;
}

/* Links */
a {
  color: var(--link);
  text-decoration: none;
  text-underline-offset: 2px;
  transition: all 0.12s;
}

a:hover {
  opacity: 0.8;
}

a.subj {
  color: var(--text);
  font-weight: 500;
}

a.subj:hover {
  color: var(--link);
}

/* Tables (Notion-style) */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 16px 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead th {
  font-weight: 600;
  text-align: left;
  padding: 12px 14px;
  background: var(--hover-bg);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr {
  transition: background 0.12s;
}

tbody tr:hover {
  background: var(--hover);
}

/* Buttons and CTAs */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--accent);
  color: white;
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
  border: none;
  cursor: pointer;
}

.btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

/* Past Paper Source Links - Round Buttons */
.source-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.source-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  background: var(--accent);
  color: white;
  border-radius: 20px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.15s;
  min-width: 40px;
  text-align: center;
}

.source-links a:hover {
  background: #268456; /* Darker Notion green on hover */
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

/* Specific colors for different sources - Using softer Material Design palette md-*-200 */
/* PMT - Physics & Maths Tutor */
.source-links a[href*="physicsandmathstutor"] {
  background: #90CAF9; /* md-blue-200 */
  color: #333;
}

.source-links a[href*="physicsandmathstutor"]:hover {
  background: #64B5F6; /* md-blue-300 */
}

/* PPC - PastPapers.co */
.source-links a[href*="pastpapers.co"] {
  background: #EF9A9A; /* md-red-200 */
  color: #333;
}

.source-links a[href*="pastpapers.co"]:hover {
  background: #E57373; /* md-red-300 */
}

/* SME - Save My Exams */
.source-links a[href*="savemyexams"] {
  background: #A5D6A7; /* md-green-200 */
  color: #333;
}

.source-links a[href*="savemyexams"]:hover {
  background: #81C784; /* md-green-300 */
}

/* PAP - PapaCambridge */
.source-links a[href*="papacambridge"] {
  background: #CE93D8; /* md-purple-200 */
  color: #333;
}

.source-links a[href*="papacambridge"]:hover {
  background: #BA68C8; /* md-purple-300 */
}

/* ePP - ePastPapers */
.source-links a[href*="epastpapers"] {
  background: #FFCC80; /* md-orange-200 */
  color: #333;
}

.source-links a[href*="epastpapers"]:hover {
  background: #FFB74D; /* md-orange-300 */
}

/* CIE - Cambridge International */
.source-links a[href*="cambridgeinternational"] {
  background: #B0BEC5; /* md-blue-grey-200 */
  color: #333;
}

.source-links a[href*="cambridgeinternational"]:hover {
  background: #90A4AE; /* md-blue-grey-300 */
}

/* PEA - Pearson Edexcel */
.source-links a[href*="qualifications.pearson"] {
  background: #BCAAA4; /* md-brown-200 */
  color: #333;
}

.source-links a[href*="qualifications.pearson"]:hover {
  background: #A1887F; /* md-brown-300 */
}

/* OCR - Oxford Cambridge RSA */
.source-links a[href*="ocr.org.uk"] {
  background: #9FA8DA; /* md-indigo-200 */
  color: #333;
}

.source-links a[href*="ocr.org.uk"]:hover {
  background: #7986CB; /* md-indigo-300 */
}

/* CLT - Classics Tuition */
.source-links a[href*="classicstuition"] {
  background: #FFAB91; /* md-deep-orange-200 */
  color: #333;
}

.source-links a[href*="classicstuition"]:hover {
  background: #FF8A65; /* md-deep-orange-300 */
}

/* XTP - XtremePapers */
.source-links a[href*="xtremepape.rs"] {
  background: #F48FB1; /* md-pink-200 */
  color: #333;
}

.source-links a[href*="xtremepape.rs"]:hover {
  background: #F06292; /* md-pink-300 */
}

/* FEP - Free Exam Papers */
.source-links a[href*="freeexampapers"] {
  background: #80DEEA; /* md-cyan-200 */
  color: #333;
}

.source-links a[href*="freeexampapers"]:hover {
  background: #4DD0E1; /* md-cyan-300 */
}

/* QQD - Qualified Quest */
.source-links a[href*="qualifiedquest"] {
  background: #C5E1A5; /* md-light-green-200 */
  color: #333;
}

.source-links a[href*="qualifiedquest"]:hover {
  background: #AED581; /* md-light-green-300 */
}

/* AZP - AZ Past Papers */
.source-links a[href*="azpastpapers"] {
  background: #FFF59D; /* md-yellow-200 */
  color: #333;
}

.source-links a[href*="azpastpapers"]:hover {
  background: #FFF176; /* md-yellow-300 */
}

/* GCE - GCE Guide */
.source-links a[href*="gceguide"] {
  background: #B39DDB; /* md-deep-purple-200 */
  color: #333;
}

.source-links a[href*="gceguide"]:hover {
  background: #9575CD; /* md-deep-purple-300 */
}

/* SHI - School History */
.source-links a[href*="schoolhistory"] {
  background: #80CBC4; /* md-teal-200 */
  color: #333;
}

.source-links a[href*="schoolhistory"]:hover {
  background: #4DB6AC; /* md-teal-300 */
}

/* Cards (for menu) */
.menu-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin: 32px 0;
}

.menu-card {
  display: block;
  padding: 32px 24px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.menu-card:hover {
  border-color: var(--link);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.menu-card-icon {
  font-size: 48px;
  margin-bottom: 16px;
  display: block;
  line-height: 1;
}

.menu-card-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.menu-card-desc {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.6;
}

/* Divider */
hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}

/* Footer */
footer {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
}

footer a {
  color: var(--muted);
}

footer a:hover {
  color: var(--text);
}

/* Code */
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  background: var(--hover-bg);
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--text);
}

/* Nav Links */
.nav-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  margin-bottom: 24px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  border-radius: var(--radius);
  transition: all 0.12s;
}

.nav-back:hover {
  background: var(--hover);
  color: var(--text);
}

/* Dev Banner */
.dev-banner {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 12px;
  text-align: center;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.5px;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow);
}

/* Callouts (Notion-style) */
.callout {
  display: flex;
  gap: 12px;
  padding: 16px;
  margin: 16px 0;
  border-radius: var(--radius);
  border-left: 3px solid;
  background: var(--hover-bg);
}

.callout-info {
  border-left-color: var(--info); /* Notion light blue */
}

.callout-success {
  border-left-color: var(--success); /* Notion green */
}

.callout-warning {
  border-left-color: var(--warning); /* Notion orange */
}

.callout-danger {
  border-left-color: var(--danger); /* Notion red */
}

.callout-icon {
  font-size: 20px;
  line-height: 1;
}

.callout-content {
  flex: 1;
  font-size: 14px;
  line-height: 1.5;
}

/* Empty states */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--muted);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

/* Focus styles */
:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

/* Selection */
::selection {
  background: rgba(47, 106, 217, 0.2);
  color: var(--text);
}

/* ==========================================
   Modal Styles
   ========================================== */
.modal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-content {
  background-color: var(--bg);
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 450px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 24px 12px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
}

.modal-close {
  background: none;
  border: none;
  font-size: 32px;
  color: var(--text-light);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.15s;
}

.modal-close:hover {
  background: var(--hover-bg);
  color: var(--text);
}

.modal-body {
  padding: 24px;
}

.modal-subtitle {
  margin: 0 0 20px 0;
  color: var(--text-light);
  font-size: 14px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: var(--text);
  font-size: 14px;
}

.form-group input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  transition: all 0.15s;
  box-sizing: border-box;
}

.form-group input:focus {
  outline: none;
  border-color: var(--link);
  box-shadow: 0 0 0 3px rgba(47, 106, 217, 0.1);
}

.form-group input::placeholder {
  color: var(--muted);
}

.btn {
  padding: 10px 16px;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: #289960;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(47, 163, 107, 0.25);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-full {
  width: 100%;
  margin-top: 8px;
}

.alert {
  padding: 12px 14px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.5;
}

.alert-error {
  background: #ffebee;
  color: #c62828;
  border-left: 4px solid var(--danger);
}

.modal-footer-text {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-light);
}

.modal-footer-text a {
  color: var(--link);
  text-decoration: none;
  font-weight: 500;
}

.modal-footer-text a:hover {
  text-decoration: underline;
}

/* Mobile Responsive */
@media (max-width: 600px) {
  .modal-content {
    width: 95%;
    max-height: 95vh;
  }
  
  .modal-header,
  .modal-body {
    padding: 20px;
  }
}
/* ==========================================
   Empty State & Error Messages
   ========================================== */
.empty-state {
  text-align: center;
  padding: 40px;
}

.empty-message {
  color: var(--muted);
  font-size: 16px;
  margin-bottom: 12px;
}

.empty-help {
  color: var(--text-light);
  font-size: 14px;
  margin-top: 10px;
}

.error-message {
  color: var(--danger);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
}

.error-details {
  color: var(--muted);
  font-size: 14px;
  margin-top: 10px;
}

.error-help {
  color: var(--text-light);
  font-size: 13px;
  margin-top: 10px;
}

.link-primary {
  color: var(--link);
  text-decoration: none;
  font-weight: 500;
}

.link-primary:hover {
  text-decoration: underline;
}

/* ==========================================
   Draft Badge & Row Highlighting  
   ========================================== */
.badge-draft {
  background: #fff3cd;
  color: #856404;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.75em;
  font-weight: 600;
  margin-left: 8px;
}

.row-draft {
  background: #fff9e6;
}

.row-draft:hover {
  background: #fff3cd;
}

.hidden {
  display: none !important;
}

.loading-message {
  color: var(--text-light);
  font-size: 16px;
}

/* ==========================================
   Subject Grid
   ========================================== */
.subject-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.subject-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all 0.2s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}

.subject-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.subject-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.subject-card h3 {
  margin: 0 0 8px 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.subject-code {
  color: var(--text-light);
  font-size: 14px;
  margin: 0 0 12px 0;
}

.subject-stats {
  margin: 12px 0;
}

.stat {
  display: inline-block;
  background: var(--hover);
  color: var(--text-light);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.subject-card .btn {
  margin-top: 16px;
  width: 100%;
  text-align: center;
}