/* ============================================================
   EnglishPro — Global Stylesheet
   Aesthetic: Deep navy × Amber gold — Academic Excellence
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300;1,400&family=DM+Sans:wght@300;400;500;600&family=DM+Mono:wght@400;500&display=swap');

/* ── Custom Properties ─────────────────────────────────────── */
:root {
  --navy-950: #050c1a;
  --navy-900: #081428;
  --navy-800: #0d1f3c;
  --navy-700: #122a52;
  --navy-600: #1a3a6e;
  --navy-500: #234f9e;

  --amber-400: #f5a623;
  --amber-300: #f7bc55;
  --amber-200: #fad282;
  --amber-100: #fdeec4;

  --slate-100: #e8edf5;
  --slate-200: #c8d2e4;
  --slate-300: #a0b0cc;
  --slate-400: #6b82a8;
  --slate-500: #4a5e80;

  --white: #f0f4fc;
  --success: #2ecc71;
  --error: #e74c3c;
  --warning: #f39c12;

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'DM Mono', monospace;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-amber: 0 0 24px rgba(245,166,35,0.15);

  --transition: 0.2s ease;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background-color: var(--navy-950);
  color: var(--slate-100);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Typography ────────────────────────────────────────────── */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.5rem); }

p { color: var(--slate-200); }

a { color: var(--amber-300); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--amber-200); }

/* ── Layout ────────────────────────────────────────────────── */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

.container--narrow {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Navigation ────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(5, 12, 26, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(245,166,35,0.12);
  padding: 0 24px;
}

.nav__inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav__logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--white);
  letter-spacing: 0.02em;
}

.nav__logo span { color: var(--amber-400); }

.nav__links {
  display: flex;
  gap: 32px;
  align-items: center;
  list-style: none;
}

.nav__links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--slate-300);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: color var(--transition);
}

.nav__links a:hover,
.nav__links a.active { color: var(--amber-300); }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  letter-spacing: 0.03em;
}

.btn--primary {
  background: var(--amber-400);
  color: var(--navy-950);
}
.btn--primary:hover {
  background: var(--amber-300);
  box-shadow: var(--shadow-amber);
  transform: translateY(-1px);
}

.btn--secondary {
  background: transparent;
  color: var(--amber-300);
  border: 1px solid rgba(245,166,35,0.4);
}
.btn--secondary:hover {
  border-color: var(--amber-300);
  background: rgba(245,166,35,0.08);
}

.btn--ghost {
  background: transparent;
  color: var(--slate-300);
  border: 1px solid rgba(255,255,255,0.1);
}
.btn--ghost:hover {
  border-color: rgba(255,255,255,0.2);
  color: var(--white);
}

.btn--danger {
  background: var(--error);
  color: white;
}
.btn--danger:hover { opacity: 0.85; }

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

.btn--lg { padding: 16px 36px; font-size: 1rem; }
.btn--sm { padding: 8px 18px; font-size: 0.8rem; }

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--navy-800);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.card:hover {
  border-color: rgba(245,166,35,0.2);
  box-shadow: var(--shadow-amber);
}

.card--flat { background: var(--navy-900); }

/* ── Form Elements ─────────────────────────────────────────── */
.input, .select, .textarea {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.input:focus, .select:focus, .textarea:focus {
  border-color: var(--amber-400);
  box-shadow: 0 0 0 3px rgba(245,166,35,0.12);
}

.input::placeholder, .textarea::placeholder { color: var(--slate-400); }

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b82a8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

.select option { background: var(--navy-800); }

.textarea { resize: vertical; min-height: 120px; }

.label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--slate-300);
  margin-bottom: 8px;
}

.form-group { margin-bottom: 20px; }

.form-error {
  font-size: 0.8rem;
  color: var(--error);
  margin-top: 6px;
}

/* ── Badges ────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge--toefl { background: rgba(35,79,158,0.3); color: #88aaee; border: 1px solid rgba(35,79,158,0.5); }
.badge--ielts { background: rgba(46,204,113,0.1); color: #5ee09a; border: 1px solid rgba(46,204,113,0.3); }
.badge--amber { background: rgba(245,166,35,0.12); color: var(--amber-300); border: 1px solid rgba(245,166,35,0.3); }

.difficulty-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.difficulty-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--navy-700);
  transition: background var(--transition);
}

.difficulty-dots span.active { background: var(--amber-400); }

/* ── Score Display ─────────────────────────────────────────── */
.score-ring {
  position: relative;
  width: 120px;
  height: 120px;
  flex-shrink: 0;
}

.score-ring svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.score-ring__track {
  fill: none;
  stroke: rgba(255,255,255,0.06);
  stroke-width: 6;
}

.score-ring__fill {
  fill: none;
  stroke: var(--amber-400);
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.score-ring__label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.score-ring__value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 300;
  color: var(--white);
  line-height: 1;
}

.score-ring__max {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--slate-400);
  margin-top: 2px;
}

/* ── Dimension Bars ────────────────────────────────────────── */
.dim-bar { margin-bottom: 16px; }

.dim-bar__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}

.dim-bar__name {
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--slate-300);
}

.dim-bar__score {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--amber-300);
}

.dim-bar__track {
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
}

.dim-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--amber-400), var(--amber-300));
  border-radius: 2px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0;
}

/* ── Correction Items ──────────────────────────────────────── */
.correction-item {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-left: 3px solid var(--amber-400);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 16px 20px;
  margin-bottom: 12px;
}

.correction-item__original {
  font-size: 0.9rem;
  color: var(--error);
  text-decoration: line-through;
  opacity: 0.8;
  margin-bottom: 6px;
}

.correction-item__revised {
  font-size: 0.9rem;
  color: var(--success);
  margin-bottom: 8px;
}

.correction-item__reason {
  font-size: 0.8rem;
  color: var(--slate-300);
  font-style: italic;
}

/* ── Toast Notifications ───────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--navy-800);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  animation: slideInRight 0.3s ease;
  max-width: 360px;
}

.toast--success { border-left: 3px solid var(--success); }
.toast--error   { border-left: 3px solid var(--error); }
.toast--info    { border-left: 3px solid var(--amber-400); }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ── Loading States ────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg,
    rgba(255,255,255,0.03) 0%,
    rgba(255,255,255,0.06) 50%,
    rgba(255,255,255,0.03) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(245,166,35,0.2);
  border-top-color: var(--amber-400);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Section Divider ───────────────────────────────────────── */
.section-title {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--amber-400);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(245,166,35,0.15);
}

/* ── Word Counter ──────────────────────────────────────────── */
.word-counter {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--slate-400);
  transition: color var(--transition);
}

.word-counter.ok { color: var(--success); }
.word-counter.warn { color: var(--warning); }

/* ── Page Hero ─────────────────────────────────────────────── */
.page-hero {
  padding: 64px 0 48px;
}

.page-hero__eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--amber-400);
  margin-bottom: 12px;
}

/* ── Misc Utilities ────────────────────────────────────────── */
.mt-4  { margin-top: 4px;  }
.mt-8  { margin-top: 8px;  }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }

.mb-4  { margin-bottom: 4px;  }
.mb-8  { margin-bottom: 8px;  }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }

.gap-8  { gap: 8px;  }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

.text-center { text-align: center; }
.text-right  { text-align: right; }

.text-amber { color: var(--amber-300); }
.text-muted { color: var(--slate-400); }
.text-sm    { font-size: 0.875rem; }
.text-xs    { font-size: 0.75rem; }

.font-mono { font-family: var(--font-mono); }
.font-display { font-family: var(--font-display); }

.hidden { display: none !important; }

.divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin: 24px 0;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .nav__links { gap: 16px; }
  .nav__links a { font-size: 0.75rem; }
  .container, .container--narrow { padding: 0 16px; }
  .btn--lg { padding: 14px 24px; }
}

@media (max-width: 480px) {
  .nav__links { display: none; }
}
