/* ========================================
   IELTSGo - Main Stylesheet
   assets/style.css
======================================== */

:root {
  --primary: #1a3c6e;
  --primary-light: #2d5da8;
  --accent: #f5a623;
  --accent-dark: #d4891a;
  --success: #27ae60;
  --danger: #e74c3c;
  --warning: #f39c12;
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #2c3e50;
  --text-light: #7f8c8d;
  --border: #dde3ec;
  --shadow: 0 4px 20px rgba(26,60,110,0.10);
  --radius: 12px;
}

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

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- NAVBAR ---- */
.navbar {
  background: var(--primary);
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 65px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  position: sticky; top: 0; z-index: 1000;
}
.nav-brand a { text-decoration: none; display: flex; flex-direction: column; }
.logo-text { font-family: 'Playfair Display', serif; font-size: 1.5rem; color: #fff; letter-spacing: 1px; }
.logo-go { color: var(--accent); }
.nav-brand small { color: rgba(255,255,255,0.65); font-size: 0.65rem; letter-spacing: 0.5px; }
.nav-links { display: flex; align-items: center; gap: 10px; }
.nav-links a { color: rgba(255,255,255,0.85); text-decoration: none; font-size: 0.9rem; font-weight: 600; padding: 6px 14px; border-radius: 6px; transition: all 0.2s; }
.nav-links a:hover, .nav-links a.active { background: rgba(255,255,255,0.15); color: #fff; }
.btn-nav { background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.3); }
.btn-nav.btn-primary { background: var(--accent); color: var(--primary) !important; border-color: var(--accent); }
.btn-nav.btn-primary:hover { background: var(--accent-dark); }
.btn-nav-logout { background: rgba(231,76,60,0.2) !important; color: #ff9999 !important; border: 1px solid rgba(231,76,60,0.4) !important; }

/* ---- FOOTER ---- */
.footer { background: var(--primary); color: rgba(255,255,255,0.6); text-align: center; padding: 18px; font-size: 0.82rem; margin-top: auto; }

/* ---- MAIN CONTENT ---- */
.main-content { flex: 1; padding: 30px 40px; max-width: 1200px; margin: 0 auto; width: 100%; }

/* ---- CARDS ---- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; margin-bottom: 20px; }
.card-title { font-family: 'Playfair Display', serif; font-size: 1.3rem; color: var(--primary); margin-bottom: 16px; padding-bottom: 12px; border-bottom: 2px solid var(--border); }

/* ---- HERO ---- */
.hero { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%); color: #fff; padding: 70px 40px; text-align: center; }
.hero h1 { font-family: 'Playfair Display', serif; font-size: 3rem; margin-bottom: 12px; }
.hero h1 span { color: var(--accent); }
.hero p { font-size: 1.15rem; opacity: 0.85; max-width: 600px; margin: 0 auto 30px; }
.hero-btns { display: flex; gap: 15px; justify-content: center; flex-wrap: wrap; }

/* ---- BUTTONS ---- */
.btn { display: inline-block; padding: 12px 28px; border-radius: 8px; font-size: 0.95rem; font-weight: 700; cursor: pointer; text-decoration: none; border: none; transition: all 0.2s; font-family: 'Nunito', sans-serif; }
.btn-primary { background: var(--accent); color: var(--primary); }
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-1px); }
.btn-secondary { background: rgba(255,255,255,0.15); color: #fff; border: 2px solid rgba(255,255,255,0.4); }
.btn-secondary:hover { background: rgba(255,255,255,0.25); }
.btn-blue { background: var(--primary); color: #fff; }
.btn-blue:hover { background: var(--primary-light); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-sm { padding: 7px 16px; font-size: 0.82rem; }
.btn-full { width: 100%; text-align: center; }

/* ---- FORMS ---- */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 700; margin-bottom: 6px; color: var(--primary); font-size: 0.9rem; }
.form-control { width: 100%; padding: 11px 14px; border: 2px solid var(--border); border-radius: 8px; font-size: 0.95rem; font-family: 'Nunito', sans-serif; transition: border 0.2s; background: #fff; color: var(--text); }
.form-control:focus { outline: none; border-color: var(--primary-light); }
textarea.form-control { resize: vertical; min-height: 120px; }
select.form-control { cursor: pointer; }

/* ---- ALERTS ---- */
.alert { padding: 13px 18px; border-radius: 8px; margin-bottom: 18px; font-weight: 600; font-size: 0.9rem; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-danger { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.alert-info { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

/* ---- SECTION CARDS (practice modules) ---- */
.section-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; margin-top: 20px; }
.section-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; text-align: center; text-decoration: none; color: var(--text); transition: all 0.25s; border-top: 4px solid transparent; }
.section-card:hover { transform: translateY(-5px); box-shadow: 0 8px 30px rgba(26,60,110,0.18); }
.section-card.listening { border-color: #3498db; }
.section-card.reading { border-color: #27ae60; }
.section-card.writing { border-color: #9b59b6; }
.section-card.speaking { border-color: #e67e22; }
.section-icon { font-size: 2.5rem; margin-bottom: 12px; }
.section-card h3 { font-family: 'Playfair Display', serif; font-size: 1.2rem; margin-bottom: 6px; color: var(--primary); }
.section-card p { font-size: 0.82rem; color: var(--text-light); }
.section-badge { display: inline-block; font-size: 0.7rem; font-weight: 700; padding: 3px 10px; border-radius: 20px; margin-top: 10px; }
.badge-blue { background: #ebf5fb; color: #2471a3; }
.badge-green { background: #e9f7ef; color: #1e8449; }
.badge-purple { background: #f5eef8; color: #7d3c98; }
.badge-orange { background: #fef9e7; color: #b7770d; }

/* ---- TIMER ---- */
.timer-bar { background: var(--primary); color: #fff; padding: 12px 20px; display: flex; justify-content: space-between; align-items: center; border-radius: 10px; margin-bottom: 20px; }
.timer-display { font-size: 1.5rem; font-weight: 800; font-family: 'Courier New', monospace; letter-spacing: 3px; }
.timer-display.warning { color: var(--accent); }
.timer-display.danger { color: #ff6b6b; animation: blink 0.8s infinite; }
@keyframes blink { 0%,100%{opacity:1;} 50%{opacity:0.4;} }

/* ---- QUESTION AREA ---- */
.question-block { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 20px; margin-bottom: 16px; }
.question-block .q-num { font-size: 0.78rem; color: var(--text-light); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.question-block .q-text { font-size: 1rem; color: var(--text); margin-bottom: 14px; line-height: 1.6; }
.question-block .options label { display: flex; align-items: flex-start; gap: 10px; padding: 9px 12px; border-radius: 7px; cursor: pointer; margin-bottom: 6px; border: 2px solid transparent; transition: all 0.15s; }
.question-block .options label:hover { background: #f0f4ff; border-color: var(--primary-light); }
.question-block .options input[type="radio"], .question-block .options input[type="checkbox"] { margin-top: 3px; accent-color: var(--primary); }
.fill-blank-input { border: none; border-bottom: 2px solid var(--primary); padding: 4px 8px; font-family: 'Nunito', sans-serif; font-size: 0.95rem; min-width: 180px; background: transparent; color: var(--text); }
.fill-blank-input:focus { outline: none; border-color: var(--accent); }

/* ---- PASSAGE TEXT ---- */
.passage-box { background: #fcfcfe; border: 1px solid var(--border); border-radius: 10px; padding: 24px; font-size: 0.95rem; line-height: 1.8; color: var(--text); max-height: 500px; overflow-y: auto; margin-bottom: 20px; }

/* ---- AUDIO PLAYER ---- */
.audio-player { background: var(--primary); color: #fff; border-radius: 10px; padding: 18px 24px; display: flex; align-items: center; gap: 18px; margin-bottom: 20px; }
.audio-player audio { flex: 1; }
.audio-player p { font-weight: 700; margin-bottom: 6px; }

/* ---- RECORDING ---- */
.record-area { background: #fff; border: 2px dashed var(--border); border-radius: 10px; padding: 30px; text-align: center; }
.record-btn { width: 80px; height: 80px; border-radius: 50%; background: var(--danger); color: #fff; border: none; font-size: 2rem; cursor: pointer; margin: 0 auto 15px; display: block; transition: all 0.2s; box-shadow: 0 4px 15px rgba(231,76,60,0.4); }
.record-btn:hover { transform: scale(1.08); }
.record-btn.recording { animation: pulse-rec 1s infinite; background: #c0392b; }
@keyframes pulse-rec { 0%,100%{box-shadow:0 4px 15px rgba(231,76,60,0.4);} 50%{box-shadow:0 4px 30px rgba(231,76,60,0.8);} }
.record-status { font-weight: 700; color: var(--primary); }

/* ---- WORD COUNT ---- */
.word-count-bar { display: flex; justify-content: flex-end; font-size: 0.82rem; color: var(--text-light); margin-top: 6px; }
.word-count-bar span { font-weight: 700; color: var(--primary); }

/* ---- SCORE DISPLAY ---- */
.score-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 15px; }
.score-card { background: var(--card); border-radius: 10px; padding: 20px; text-align: center; box-shadow: var(--shadow); }
.score-card .band { font-size: 2.5rem; font-weight: 800; color: var(--primary-light); font-family: 'Playfair Display', serif; }
.score-card .label { font-size: 0.8rem; color: var(--text-light); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-top: 6px; }
.overall-band { font-size: 4rem; font-weight: 800; color: var(--primary); font-family: 'Playfair Display', serif; text-align: center; }

/* ---- TABLE ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
table th { background: var(--primary); color: #fff; padding: 11px 14px; text-align: left; font-size: 0.82rem; letter-spacing: 0.5px; }
table td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
table tr:hover td { background: #f8faff; }
table .status-badge { padding: 3px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 700; }
.status-submitted { background: #ebf5fb; color: #2471a3; }
.status-graded { background: #e9f7ef; color: #1e8449; }
.status-in_progress { background: #fef9e7; color: #b7770d; }

/* ---- TABS ---- */
.tabs { display: flex; gap: 5px; margin-bottom: 20px; border-bottom: 2px solid var(--border); }
.tab-btn { padding: 10px 20px; background: none; border: none; font-family: 'Nunito', sans-serif; font-size: 0.92rem; font-weight: 700; color: var(--text-light); cursor: pointer; border-bottom: 3px solid transparent; transition: all 0.2s; margin-bottom: -2px; }
.tab-btn.active, .tab-btn:hover { color: var(--primary); border-bottom-color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ---- LOGIN / REGISTER ---- */
.auth-wrap { min-height: calc(100vh - 65px); display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-card { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 42px; width: 100%; max-width: 440px; }
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo .logo-text { font-size: 2rem; }
.auth-card h2 { font-family: 'Playfair Display', serif; color: var(--primary); text-align: center; margin-bottom: 6px; }
.auth-card p.subtitle { text-align: center; color: var(--text-light); font-size: 0.88rem; margin-bottom: 24px; }
.auth-card .link-row { text-align: center; margin-top: 16px; font-size: 0.88rem; color: var(--text-light); }
.auth-card .link-row a { color: var(--primary-light); font-weight: 700; }

/* ---- ADMIN SIDEBAR ---- */
.admin-layout { display: flex; min-height: calc(100vh - 65px); }
.admin-sidebar { width: 240px; background: var(--primary); color: #fff; padding: 20px 0; flex-shrink: 0; }
.admin-sidebar .side-logo { padding: 10px 20px 24px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.admin-sidebar nav a { display: flex; align-items: center; gap: 10px; padding: 12px 20px; color: rgba(255,255,255,0.8); text-decoration: none; font-size: 0.9rem; font-weight: 600; transition: all 0.2s; }
.admin-sidebar nav a:hover, .admin-sidebar nav a.active { background: rgba(255,255,255,0.12); color: #fff; }
.admin-sidebar nav a .icon { font-size: 1.1rem; width: 22px; }
.admin-sidebar .side-section { padding: 12px 20px 4px; font-size: 0.68rem; font-weight: 800; letter-spacing: 1.5px; color: rgba(255,255,255,0.4); text-transform: uppercase; }
.admin-main { flex: 1; padding: 28px 32px; overflow-x: auto; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.admin-topbar h1 { font-family: 'Playfair Display', serif; color: var(--primary); font-size: 1.5rem; }

/* ---- STATS CARDS ---- */
.stats-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--card); border-radius: 10px; padding: 20px; box-shadow: var(--shadow); border-left: 4px solid var(--primary-light); }
.stat-card .num { font-size: 2rem; font-weight: 800; color: var(--primary); }
.stat-card .lbl { font-size: 0.8rem; color: var(--text-light); font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }

/* ---- TOKEN BADGE ---- */
.token-active { color: var(--success); font-weight: 700; }
.token-expired { color: var(--danger); font-weight: 700; }
.token-none { color: var(--text-light); font-weight: 700; }

/* ---- PROGRESS BAR ---- */
.progress-wrap { background: var(--border); border-radius: 20px; height: 8px; margin: 8px 0; }
.progress-fill { height: 100%; border-radius: 20px; background: var(--primary-light); transition: width 0.4s; }

/* ---- INSTRUCTIONS BOX ---- */
.instructions { background: #fffbf0; border: 2px solid var(--accent); border-radius: 10px; padding: 22px; margin-bottom: 24px; }
.instructions h3 { color: var(--accent-dark); margin-bottom: 12px; }
.instructions ul { padding-left: 20px; }
.instructions ul li { margin-bottom: 7px; font-size: 0.9rem; color: var(--text); line-height: 1.5; }

/* ---- WRITING AREA ---- */
.writing-split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 768px) { .writing-split { grid-template-columns: 1fr; } }

/* ---- PROFILE ---- */
.profile-header { display: flex; align-items: center; gap: 20px; margin-bottom: 24px; }
.avatar { width: 70px; height: 70px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; font-weight: 800; }
.token-info-box { background: linear-gradient(135deg, #1a3c6e, #2d5da8); color: #fff; border-radius: 12px; padding: 24px; margin-bottom: 20px; }
.token-info-box h3 { margin-bottom: 12px; color: var(--accent); }
.token-key-display { font-family: 'Courier New', monospace; font-size: 1.1rem; background: rgba(255,255,255,0.12); padding: 8px 14px; border-radius: 6px; letter-spacing: 2px; display: inline-block; margin: 8px 0; }

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
  .navbar { padding: 0 16px; }
  .main-content { padding: 20px 16px; }
  .admin-sidebar { display: none; }
}
