/* === IELTS-GPT v2 — Consolidated Stylesheet === */

:root {
  --brand-blue: #0066FF;
  --brand-blue-light: #e8f0ff;
  --brand-dark: #1a1a2e;
  --bg-light: #f8f9ff;
  --bg-card: #ffffff;
  --text-primary: #1a1a2e;
  --text-secondary: #555;
  --text-muted: #888;
  --border-light: #e5e7eb;
  --success: #2E7D32;
  --warning: #F57C00;
  --danger: #D32F2F;
  --radius: 12px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.1);
  --transition: 0.2s ease;
}

/* === Base === */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Inter', 'Segoe UI', Roboto, sans-serif;
  color: var(--text-primary);
  line-height: 1.6;
  background: #fafbfc;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { transition: color var(--transition); }

/* === Navbar === */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.navbar-brand {
  font-size: 1.25rem;
  letter-spacing: -0.5px;
}

/* === Hero Section (Landing Page) === */
.hero-section {
  background: linear-gradient(180deg, #fbfcff 0%, #f0f4ff 100%);
  padding: 7rem 0 4rem;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -15%;
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(0,102,255,0.03) 0%, transparent 60%);
  border-radius: 50%;
  pointer-events: none;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -1.5px;
  color: var(--text-primary);
}

.hero-title .brand-ielts { color: var(--brand-blue); }
.hero-title .brand-gpt { color: var(--text-primary); }

.hero-subtitle {
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: -0.3px;
}

.hero-description {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 480px;
}

.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(8px);
  border-radius: 50px;
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  color: var(--text-muted);
  font-weight: 500;
  border: 1px solid rgba(0,0,0,0.04);
}

.hero-features .feature-item {
  margin-bottom: 0.6rem;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 450;
}

/* === Assessment Preview Card === */
.assessment-card {
  background: white;
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.04);
  position: relative;
  border: 1px solid rgba(0,0,0,0.03);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.assessment-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 70px rgba(0,0,0,0.1), 0 1px 3px rgba(0,0,0,0.04);
}

.band-score-badge {
  position: absolute;
  top: -16px;
  right: -16px;
  width: 56px;
  height: 56px;
  background: var(--brand-blue);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 12px rgba(0,102,255,0.3);
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1;
}

.band-score-badge small {
  font-size: 0.65rem;
  font-weight: 400;
}

.score-bar-bg {
  height: 4px;
  background: #f0f0f0;
  border-radius: 2px;
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  background: var(--brand-blue);
  border-radius: 2px;
  transition: width 1s ease-out;
}

/* === Stats Section === */
.stats-section { border-top: 1px solid rgba(0,0,0,0.04); }

.stats-section .stat-number {
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -1px;
}

.stats-section .stat-label {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* === App Page === */
.task-tabs .nav-link {
  font-weight: 600;
  color: var(--text-secondary);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px 8px 0 0;
  transition: all var(--transition);
}

.task-tabs .nav-link:hover {
  color: var(--brand-blue);
  background: rgba(0,102,255,0.04);
}

.task-tabs .nav-link.active {
  color: var(--brand-blue);
  border-bottom: 3px solid var(--brand-blue);
  background: none;
}

/* === Essay Input === */
.essay-textarea {
  min-height: 220px;
  padding: 1rem;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius);
  background: #fafbfc;
  font-size: 1rem;
  line-height: 1.7;
  resize: vertical;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.essay-textarea:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(0,102,255,0.1);
  outline: none;
  background: white;
}

.essay-textarea.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(211,47,47,0.1);
}

.question-textarea {
  min-height: 80px;
}

/* === Feedback Display === */
.band-score-large {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--brand-blue);
  color: white;
  font-size: 2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0,102,255,0.3);
}

.share-buttons {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  padding: 0;
  line-height: 1;
}

.share-btn:hover {
  color: var(--brand-blue);
  border-color: var(--brand-blue);
  background: var(--brand-blue-light);
}

.share-copy-btn {
  width: auto;
  min-width: 32px;
  padding: 0 0.5rem;
  border-radius: 16px;
  font-size: 0.75rem;
  white-space: nowrap;
}

.error-item {
  border-left: 3px solid var(--danger);
}

/* === Highlighted Essay Errors === */
.highlighted-essay {
  font-size: 1rem;
}

.error-highlight {
  transition: background-color 0.2s;
}

.error-highlight:hover {
  filter: brightness(0.92);
}

.error-legend-item {
  transition: box-shadow 0.3s;
}

/* === Progress Bar === */
.progress {
  height: 24px;
  border-radius: 8px;
  background-color: var(--border-light);
  overflow: hidden;
}

.progress-bar {
  background: var(--brand-blue);
  font-size: 0.8rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: width 0.3s;
}

/* === Buttons === */
.btn-brand {
  background: #0066FF;
  color: white;
  border: none;
  padding: 0.75rem 2rem;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.1px;
  border-radius: 980px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: none;
  position: relative;
  overflow: hidden;
}

.btn-brand:hover {
  background: #0052cc;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,102,255,0.25);
}

.btn-brand:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn-brand:disabled {
  opacity: 0.5;
  transform: none;
  box-shadow: none;
}

.btn-brand.btn-lg {
  padding: 0.9rem 2.5rem;
  font-size: 1.05rem;
}

.btn-outline-dark {
  border-radius: 980px;
  font-weight: 500;
}

/* === Cards === */
.card {
  border: 1px solid rgba(0,0,0,0.04);
  border-radius: 16px;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  background: white;
}

.card:hover {
  box-shadow: 0 8px 30px rgba(0,0,0,0.06);
}

/* === Accordion === */
.accordion-button:focus {
  box-shadow: 0 0 0 3px rgba(0,102,255,0.1);
}

.accordion-button:not(.collapsed) {
  background: var(--brand-blue-light);
  color: var(--brand-blue);
}

/* === Timer Widget === */
.timer-widget {
  background: white;
  display: inline-flex;
  border-radius: 8px;
  padding: 0.25rem 0.5rem;
  box-shadow: var(--shadow-sm);
}

/* === Usage Display === */
#usage-display {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 0.5rem 1rem;
}

/* === Auth Pages === */
.auth-container {
  max-width: 420px;
  margin: 3rem auto;
}

.auth-card {
  border-radius: 16px;
  box-shadow: var(--shadow-md);
}

/* === Score Cards in Feedback === */
.card .progress {
  height: 4px;
  border-radius: 2px;
}

/* === Footer === */
footer.footer {
  border-top: 1px solid rgba(255,255,255,0.1);
}

.footer a {
  transition: color var(--transition);
}

.footer a:hover {
  color: #aaa !important;
}

/* === Question Bank === */
#topic-filter {
  border-radius: 6px;
  font-size: 0.85rem;
}

/* === Band-9 Rewrite === */
#band9-output .card {
  border-radius: var(--radius);
}

/* === Form Controls === */
.form-control:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(0,102,255,0.1);
}

.form-select:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(0,102,255,0.1);
}

/* === Content Pages (features, privacy, terms) === */
.content-page {
  max-width: 800px;
  margin: 0 auto;
}

.content-page h1 {
  font-weight: 700;
  color: var(--text-primary);
}

.content-page h5 {
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 1.5rem;
}

/* === Feature Cards === */
.feature-card {
  border: none;
  border-radius: var(--radius);
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.feature-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

/* === Samples Page === */
.question-card {
  margin-bottom: 2rem;
}

.band-tab {
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 0.4rem 1rem;
  background: white;
  cursor: pointer;
  font-weight: 500;
  transition: all var(--transition);
  margin-right: 0.5rem;
}

.band-tab:hover {
  border-color: var(--brand-blue);
  color: var(--brand-blue);
}

.band-tab.active {
  background: var(--brand-blue);
  color: white;
  border-color: var(--brand-blue);
}

/* === Responsive === */
@media (max-width: 768px) {
  .hero-title { font-size: 2.4rem; letter-spacing: -1px; }
  .hero-subtitle { font-size: 1.1rem; }
  .hero-section { padding: 4rem 0 2.5rem; }
  .assessment-card { margin-top: 2rem; padding: 1.5rem; }
  .essay-textarea { min-height: 160px; }
  .band-score-large { width: 64px; height: 64px; font-size: 1.6rem; }
  .stats-section .stat-number { font-size: 2rem; }
  .feature-card { margin-bottom: 1rem; }
}

@media (max-width: 576px) {
  .hero-section { padding: 3rem 0 2rem; }
  .hero-title { font-size: 1.9rem; letter-spacing: -0.5px; }
  .task-tabs .nav-link { padding: 0.5rem 1rem; font-size: 0.9rem; }
  .btn-brand.btn-lg { padding: 0.7rem 1.5rem; font-size: 0.95rem; }
  .question-textarea { min-height: 60px; }
}

/* === Smooth transitions === */
.d-none { display: none !important; }

.fade-in {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
