@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;600&display=swap');

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

:root {
  --bg: #0a0a0f;
  --surface: #111118;
  --surface2: #1a1a24;
  --border: #2a2a3a;
  --accent: #6c63ff;
  --accent2: #00d4aa;
  --accent3: #ff6b6b;
  --text: #e8e8f0;
  --text2: #8888aa;
  --easy: #00d4aa;
  --medium: #ffa500;
  --hard: #ff4444;
}

body {
  font-family: 'Space Grotesk', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* NAV */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
nav .logo { font-size: 1.3rem; font-weight: 700; color: var(--accent); letter-spacing: -0.5px; }
nav .logo span { color: var(--accent2); }
nav a { color: var(--text2); text-decoration: none; font-size: 0.9rem; margin-left: 2rem; transition: color 0.2s; }
nav a:hover, nav a.active { color: var(--accent2); }

.nav-links {
  margin-left: auto;
  display: flex;
  align-items: center;
}

/* LOGOUT BUTTON - Upgraded & Bigger */
.logout-btn {
  margin-left: 2.5rem;
  padding: 0.7rem 1.6rem;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #ff4d4d, #d32f2f);
  color: #fff;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  box-shadow: 0 4px 15px rgba(255, 77, 77, 0.3);
}
.logout-btn:hover {
  background: linear-gradient(135deg, #ff5c5c, #e53935);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 25px rgba(255, 77, 77, 0.4);
}
.logout-btn:active {
  transform: translateY(0) scale(1);
}
.logout-btn i, .logout-btn span.icon { font-size: 1.1rem; }

/* LAYOUT */
.container { max-width: 1100px; margin: 0 auto; padding: 2rem; }
.page-title { font-size: 1.8rem; font-weight: 700; margin-bottom: 0.4rem; }
.page-sub { color: var(--text2); font-size: 0.95rem; margin-bottom: 2rem; }

/* CARDS */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: border-color 0.2s, transform 0.2s;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1.2rem; }

/* BUTTONS */
.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.6rem 1.4rem;
  border-radius: 8px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem; font-weight: 600;
  cursor: pointer; border: none;
  transition: all 0.2s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #5a52e0; }
.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-success { background: var(--accent2); color: #000; }

/* DIFFICULTY BADGES */
.diff-btn {
  padding: 0.5rem 1.2rem; border-radius: 20px;
  border: 2px solid transparent; cursor: pointer;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600; font-size: 0.85rem;
  transition: all 0.2s; background: transparent;
}
.diff-easy { color: var(--easy); border-color: var(--easy); }
.diff-easy.active, .diff-easy:hover { background: var(--easy); color: #000; }
.diff-medium { color: var(--medium); border-color: var(--medium); }
.diff-medium.active, .diff-medium:hover { background: var(--medium); color: #000; }
.diff-hard { color: var(--hard); border-color: var(--hard); }
.diff-hard.active, .diff-hard:hover { background: var(--hard); color: #fff; }

/* SCORE RING */
.score-ring {
  width: 100px; height: 100px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; font-weight: 700;
  background: conic-gradient(var(--accent) calc(var(--pct) * 1%), var(--surface2) 0);
  position: relative;
}
.score-ring::after {
  content: ''; position: absolute;
  width: 76px; height: 76px;
  border-radius: 50%; background: var(--surface);
}
.score-ring span { position: relative; z-index: 1; }

/* PROGRESS BAR */
.progress-bar { background: var(--surface2); border-radius: 20px; height: 8px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 20px; background: var(--accent); transition: width 0.6s ease; }

/* TAG */
.tag {
  display: inline-block; padding: 0.2rem 0.7rem;
  border-radius: 20px; font-size: 0.75rem; font-weight: 600;
  background: var(--surface2); color: var(--text2); border: 1px solid var(--border);
}
.tag.green { background: #00d4aa22; color: var(--accent2); border-color: var(--accent2); }
.tag.purple { background: #6c63ff22; color: var(--accent); border-color: var(--accent); }
.tag.red { background: #ff444422; color: var(--hard); border-color: var(--hard); }

/* MONO */
.mono { font-family: 'JetBrains Mono', monospace; }

/* CODE EDITOR MOCK */
.code-area {
  background: #050508;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--text);
  width: 100%; min-height: 180px;
  resize: vertical; outline: none;
}

/* ANIMATIONS */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn 0.4s ease forwards; }

@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }
.pulse { animation: pulse 1.5s infinite; }

/* TOAST */
.toast {
  position: fixed; bottom: 2rem; right: 2rem;
  background: var(--surface2); border: 1px solid var(--accent2);
  color: var(--accent2); padding: 0.8rem 1.4rem;
  border-radius: 8px; font-size: 0.9rem; font-weight: 500;
  opacity: 0; transform: translateY(10px);
  transition: all 0.3s; z-index: 999; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* DIVIDER */
.divider { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

/* SECTION LABEL */
.section-label { font-size: 0.75rem; font-weight: 600; color: var(--text2); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 0.8rem; }

/* STAT BOX */
.stat-box { text-align: center; padding: 1rem; }
.stat-box .val { font-size: 2rem; font-weight: 700; color: var(--accent); }
.stat-box .lbl { font-size: 0.8rem; color: var(--text2); margin-top: 0.2rem; }

/* DOMAIN CHIP */
.domain-chip {
  padding: 0.5rem 1rem; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface2);
  font-size: 0.85rem; font-weight: 500; transition: all 0.2s;
  text-align: center;
}
.domain-chip:hover { border-color: var(--accent); color: var(--accent); }
.domain-chip.selected { border-color: var(--accent); background: #6c63ff22; color: var(--accent); }

/* ALERT */
.alert { padding: 0.8rem 1.2rem; border-radius: 8px; font-size: 0.9rem; margin-bottom: 1rem; }
.alert-info { background: #6c63ff15; border: 1px solid var(--accent); color: var(--accent); }
.alert-success { background: #00d4aa15; border: 1px solid var(--accent2); color: var(--accent2); }
.alert-error { background: #ff444415; border: 1px solid var(--hard); color: var(--hard); }

/* Vyroo learner/professional product shell */
:root {
  --bg: #08090d;
  --surface: #101116;
  --surface2: #171922;
  --surface3: #20232d;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.18);
  --accent: #7c8cff;
  --accent2: #6ee7d8;
  --accent3: #ef4444;
  --text: #f6f7fb;
  --text2: #a8afbd;
  --easy: #10b981;
  --medium: #f59e0b;
  --hard: #ef4444;
  --shadow-card: 0 16px 42px rgba(0, 0, 0, 0.26);
  --shadow-float: 0 24px 70px rgba(0, 0, 0, 0.38);
}

:root[data-theme="light"] {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface2: #f1f3f6;
  --surface3: #e7eaf0;
  --border: rgba(15, 23, 42, 0.1);
  --border-strong: rgba(15, 23, 42, 0.18);
  --accent: #3f5dcb;
  --accent2: #0f766e;
  --accent3: #dc2626;
  --text: #111827;
  --text2: #4b5563;
  --easy: #047857;
  --medium: #b45309;
  --hard: #dc2626;
  --shadow-card: 0 18px 45px rgba(15, 23, 42, 0.08);
  --shadow-float: 0 24px 70px rgba(15, 23, 42, 0.16);
}

html { scroll-behavior: smooth; }

body {
  letter-spacing: 0;
  background:
    radial-gradient(circle at top left, rgba(124, 140, 255, 0.09), transparent 32rem),
    radial-gradient(circle at bottom right, rgba(110, 231, 216, 0.07), transparent 28rem),
    var(--bg);
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease, color 0.2s ease;
}

body.vyroo-ready { opacity: 1; }

nav {
  padding: 0.85rem 1.4rem;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
}

nav .logo {
  color: var(--text);
  letter-spacing: 0;
}

nav .logo span {
  color: var(--accent2);
}

nav a {
  margin-left: 1rem;
  padding: 0.48rem 0.7rem;
  border-radius: 999px;
  color: var(--text2);
}

nav a:hover,
nav a.active {
  background: var(--surface2);
  color: var(--text);
}

.container {
  width: min(1160px, calc(100% - 32px));
  padding: 2rem 0;
}

.hero-title {
  letter-spacing: 0;
}

.hero-title span {
  color: var(--text);
}

.card,
.nav-card,
.cred-mini,
.modal,
.auth-card,
.login-wrap {
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border-color: var(--border);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(14px);
}

.card,
.nav-card,
.cred-mini,
.modal {
  border-radius: 18px;
}

.card:hover,
.nav-card:hover,
.cred-mini:hover {
  border-color: var(--border-strong);
}

.quick-stats,
.grid-3 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.nav-cards,
.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stat-box .val,
.cred-mini-score {
  color: var(--text);
  letter-spacing: 0;
}

.stat-box .lbl,
.section-label,
.page-sub {
  color: var(--text2);
  letter-spacing: 0.07em;
}

.btn,
button,
input,
select,
textarea {
  font-family: 'Space Grotesk', Inter, system-ui, sans-serif;
}

.btn,
.logout-btn,
.login-btn,
.auth-btn {
  min-height: 40px;
  border-radius: 999px;
  justify-content: center;
}

.btn-primary,
.login-btn,
.auth-btn {
  background: var(--text) !important;
  color: var(--bg) !important;
}

.btn-primary:hover,
.login-btn:hover,
.auth-btn:hover {
  box-shadow: var(--shadow-card);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--surface2);
  border-color: var(--border-strong);
  color: var(--text);
}

.logout-btn {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  box-shadow: none;
  color: #f87171;
  text-transform: none;
  letter-spacing: 0;
}

.logout-btn:hover {
  background: rgba(239, 68, 68, 0.18);
  box-shadow: none;
}

input,
select,
textarea,
.code-area {
  background: var(--surface);
  border-color: var(--border);
  border-radius: 14px;
}

input:focus,
select:focus,
textarea:focus,
.code-area:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(124, 140, 255, 0.14);
}

.tag {
  background: rgba(124, 140, 255, 0.12);
  color: var(--accent);
  border-color: rgba(124, 140, 255, 0.3);
}

.tag.green { background: rgba(16, 185, 129, 0.14); color: #34d399; border-color: rgba(16, 185, 129, 0.28); }
.tag.purple { background: rgba(124, 140, 255, 0.14); color: var(--accent); border-color: rgba(124, 140, 255, 0.28); }
.tag.red { background: rgba(239, 68, 68, 0.14); color: #f87171; border-color: rgba(239, 68, 68, 0.28); }

.progress-bar {
  background: var(--surface3);
}

.progress-fill,
.score-fill {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
}

.score-ring {
  background: conic-gradient(var(--accent) calc(var(--pct) * 1%), var(--surface2) 0);
}

.score-ring::after {
  background: var(--surface);
}

.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-float);
}

.login-wrap,
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
}

.login-left {
  background:
    linear-gradient(145deg, rgba(124, 140, 255, 0.22), rgba(110, 231, 216, 0.08)),
    var(--surface2) !important;
}

/* SVG Icon System */
.svg-icon {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: inline-block;
  vertical-align: middle;
}
.svg-icon.sm {
  width: 16px;
  height: 16px;
  stroke-width: 2.2;
}
.svg-icon.lg {
  width: 36px;
  height: 36px;
}
.icon-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: rgba(124, 140, 255, 0.08);
  color: var(--accent);
  margin-bottom: 1rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-card:hover .icon-box {
  background: var(--accent);
  color: #08090d;
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 8px 20px rgba(124, 140, 255, 0.25);
}

.vyroo-theme-toggle {
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text2);
  cursor: pointer;
  transition: all 0.2s ease;
}

.vyroo-theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--surface3);
  transform: scale(1.05);
}

.vyroo-mobile-nav {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.vyroo-mobile-nav:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.vyroo-mobile-nav {
  display: none;
  margin-left: auto;
}

@media (max-width: 1020px) {
  .quick-stats,
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  nav {
    flex-wrap: wrap;
    gap: 0.8rem;
  }

  .vyroo-mobile-nav {
    display: inline-flex;
    align-items: center;
  }

  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    order: 3;
  }

  body.nav-open .nav-links {
    display: flex;
  }

  nav a {
    margin-left: 0;
  }

  .logout-btn {
    margin-left: 0;
  }

  .container {
    width: min(100% - 24px, 1160px);
  }

  .nav-cards,
  .grid-2,
  .grid-3,
  .quick-stats {
    grid-template-columns: 1fr !important;
  }

  .cred-mini {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .container {
    padding-top: 1.2rem;
  }

  .card,
  .nav-card,
  .cred-mini,
  .modal {
    padding: 1rem;
  }

  .page-title {
    font-size: 1.45rem;
  }
}
