@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;1,9..40,300&display=swap');

/* ── Variables ─────────────────────────────────────────────────────────────── */
:root {
  --bg:           #060d1a;
  --bg-2:         #0b1628;
  --bg-3:         #101f38;
  --accent:       #2563eb;
  --accent-2:     #3b82f6;
  --accent-soft:  rgba(37, 99, 235, 0.15);
  --accent-glow:  rgba(37, 99, 235, 0.35);
  --cyan:         #06b6d4;
  --cyan-soft:    rgba(6, 182, 212, 0.12);
  --text:         #f0f4ff;
  --text-2:       #8ba4c8;
  --text-3:       #4a6080;
  --border:       rgba(255, 255, 255, 0.06);
  --border-hover: rgba(37, 99, 235, 0.4);
  --card:         rgba(11, 22, 40, 0.8);
  --shadow:       0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg:    0 20px 60px rgba(0, 0, 0, 0.5);
}

/* ── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ── Body & Background ─────────────────────────────────────────────────────── */
body {
  font-family: 'DM Sans', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;

  /* Deep blue textured background */
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(37, 99, 235, 0.18) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 90% 90%, rgba(6, 182, 212, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse 60% 60% at 0% 100%, rgba(37, 99, 235, 0.06) 0%, transparent 50%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Cpath d='M0 0h60v60H0z' fill='none'/%3E%3Ccircle cx='30' cy='30' r='0.5' fill='rgba(255,255,255,0.03)'/%3E%3C/svg%3E");
}

/* ── Floating symbols ──────────────────────────────────────────────────────── */
.background-graphics {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.floating-symbol {
  position: absolute;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  color: rgba(37, 99, 235, 0.04);
  user-select: none;
  animation: floatUp 28s linear infinite;
}

.floating-symbol:nth-child(2n)  { color: rgba(6, 182, 212, 0.04); }
.floating-symbol:nth-child(3n)  { color: rgba(255, 255, 255, 0.025); }
.floating-symbol:nth-child(1)  { left: 8%;  font-size: 3.5rem; animation-duration: 22s; animation-delay: 0s; }
.floating-symbol:nth-child(2)  { left: 22%; font-size: 5rem;   animation-duration: 30s; animation-delay: -6s; }
.floating-symbol:nth-child(3)  { left: 38%; font-size: 2.5rem; animation-duration: 18s; animation-delay: -12s; }
.floating-symbol:nth-child(4)  { left: 52%; font-size: 4rem;   animation-duration: 25s; animation-delay: -3s; }
.floating-symbol:nth-child(5)  { left: 65%; font-size: 3rem;   animation-duration: 20s; animation-delay: -9s; }
.floating-symbol:nth-child(6)  { left: 80%; font-size: 6rem;   animation-duration: 32s; animation-delay: -16s; }
.floating-symbol:nth-child(7)  { left: 14%; font-size: 2rem;   animation-duration: 24s; animation-delay: -4s; }
.floating-symbol:nth-child(8)  { left: 45%; font-size: 3rem;   animation-duration: 19s; animation-delay: -8s; }
.floating-symbol:nth-child(9)  { left: 72%; font-size: 2.5rem; animation-duration: 26s; animation-delay: -14s; }
.floating-symbol:nth-child(10) { left: 90%; font-size: 4rem;   animation-duration: 22s; animation-delay: -2s; }
.floating-symbol:nth-child(11) { left: 5%;  font-size: 5rem;   animation-duration: 28s; animation-delay: -18s; }
.floating-symbol:nth-child(12) { left: 58%; font-size: 2rem;   animation-duration: 16s; animation-delay: -7s; }

@keyframes floatUp {
  0%   { transform: translateY(110vh) rotate(0deg);   opacity: 0; }
  8%   { opacity: 1; }
  92%  { opacity: 1; }
  100% { transform: translateY(-15vh) rotate(180deg); opacity: 0; }
}

/* ── Navbar ────────────────────────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  background: rgba(6, 13, 26, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

.nav-logo-img {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  object-fit: cover;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-item {
  color: var(--text-2);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 6px;
  transition: all 0.2s ease;
  font-family: 'DM Sans', sans-serif;
}

.nav-item:hover {
  color: var(--text);
  background: var(--accent-soft);
}

.nav-btn-home {
  background: var(--accent-soft);
  color: var(--accent-2);
  border: 1px solid rgba(37, 99, 235, 0.25);
  padding: 8px 18px;
  border-radius: 6px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-btn-home:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* ── Screens ───────────────────────────────────────────────────────────────── */
.screen {
  display: none;
  min-height: 100vh;
  padding: 100px 24px 60px;
  position: relative;
  z-index: 10;
  animation: screenIn 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.screen.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

@keyframes screenIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Home Screen ───────────────────────────────────────────────────────────── */
.home-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 480px;
  width: 100%;
}

.app-icon {
  font-size: 5rem;
  margin-bottom: 1.5rem;
  animation: iconFloat 4s ease-in-out infinite;
  filter: drop-shadow(0 0 24px rgba(37, 99, 235, 0.4));
}

.app-logo {
  width: 110px;
  height: 110px;
  border-radius: 22px;
  margin-bottom: 1.5rem;
  object-fit: cover;
  animation: iconFloat 4s ease-in-out infinite;
  box-shadow: 0 0 0 1px var(--border), 0 0 40px rgba(37, 99, 235, 0.3);
}

@keyframes iconFloat {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-8px); }
}

h1 {
  font-family: 'Syne', sans-serif;
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 0.75rem;
}

.home-container > p {
  color: var(--text-2);
  font-size: 1.05rem;
  font-weight: 300;
  margin-bottom: 2.5rem;
  letter-spacing: 0.02em;
}

.created-by {
  margin-top: 20px;
  margin-bottom: 0;
  font-size: 0.78rem;
  color: var(--text-3);
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── Home Action Buttons Layout ────────────────────────────────────────────── */
.home-actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 18px;
  width: 100%;
}

.home-actions button {
  width: 100%;
  max-width: 330px;
  text-align: center;
}

/* ── Browse Notes Button ───────────────────────────────────────────────────── */
#notesBtn {
  background: transparent;
  color: var(--text);
  font-family: 'Syne', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 14px 48px;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
  border: 1px solid rgba(37, 99, 235, 0.5);
  box-shadow: 0 0 20px rgba(37, 99, 235, 0.2), inset 0 0 20px rgba(37, 99, 235, 0.03);
}

#notesBtn::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 6px;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.7;
}

#notesBtn:hover {
  background: var(--accent-soft);
  box-shadow: 0 0 40px rgba(37, 99, 235, 0.4), inset 0 0 20px rgba(37, 99, 235, 0.05);
  transform: translateY(-2px);
}

#notesBtn:active { transform: translateY(0); }

/* ── View Events Button (matches Browse Notes) ─────────────────────────────── */
#eventsBtn {
  background: transparent;
  color: var(--text);
  font-family: 'Syne', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 14px 48px;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
  border: 1px solid rgba(37, 99, 235, 0.5);
  box-shadow: 0 0 20px rgba(37, 99, 235, 0.2), inset 0 0 20px rgba(37, 99, 235, 0.03);
}

#eventsBtn::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 6px;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.7;
}

#eventsBtn:hover {
  background: var(--accent-soft);
  box-shadow: 0 0 40px rgba(37, 99, 235, 0.4), inset 0 0 20px rgba(37, 99, 235, 0.05);
  transform: translateY(-2px);
}

#eventsBtn:active { transform: translateY(0); }

/* ── AI Studio Button (matches Browse Notes) ───────────────────────────────── */
#studioBtn {
  background: transparent;
  color: var(--text);
  font-family: 'Syne', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 14px 48px;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
  border: 1px solid rgba(37, 99, 235, 0.5);
  box-shadow: 0 0 20px rgba(37, 99, 235, 0.2), inset 0 0 20px rgba(37, 99, 235, 0.03);
}

#studioBtn::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 6px;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.7;
}

#studioBtn:hover {
  background: var(--accent-soft);
  box-shadow: 0 0 40px rgba(37, 99, 235, 0.4), inset 0 0 20px rgba(37, 99, 235, 0.05);
  transform: translateY(-2px);
}

#studioBtn:active { transform: translateY(0); }

/* ── Container Cards ───────────────────────────────────────────────────────── */
.container {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px;
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  position: relative; /* added this */
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg);
}

/* ── Typography ────────────────────────────────────────────────────────────── */
h2 {
  font-family: 'Syne', sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
  margin-bottom: 1.8rem;
  text-align: center;
}

h3 {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  color: var(--cyan);
  font-size: 1.3rem;
  margin-bottom: 12px;
  text-align: left;
}

p {
  color: var(--text-2);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
  font-weight: 300;
}

/* ── Back Button ───────────────────────────────────────────────────────────── */
.btn-back {
  background: transparent;
  color: var(--text-3);
  border: 1px solid var(--border);
  padding: 8px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  margin-bottom: 24px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  letter-spacing: 0.01em;
}

.btn-back:hover {
  color: var(--text);
  border-color: var(--accent-2);
  background: var(--accent-soft);
}

/* ── Options Grid (Semesters & Subjects) ───────────────────────────────────── */
.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  width: 100%;
}

.option-btn {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px 16px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
}

.option-btn:hover {
  border-color: var(--border-hover);
  background: var(--accent-soft);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.2);
}

.card-icon { font-size: 2rem; display: block; }
.card-title { font-size: 0.88rem; font-weight: 600; color: var(--text); }
.card-icon-wrapper { line-height: 1; }

/* ── Module Buttons ────────────────────────────────────────────────────────── */
.modules-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.module-btn {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  width: 100%;
}

.module-btn:hover {
  border-color: var(--border-hover);
  background: var(--accent-soft);
  padding-left: 28px;
}

/* ── File Buttons ──────────────────────────────────────────────────────────── */
.files-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.file-btn {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  text-align: left;
}

.file-btn:hover {
  border-color: var(--border-hover);
  background: var(--accent-soft);
  padding-left: 28px;
}

.file-btn-title {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text);
}

.file-btn-action {
  background: var(--accent-soft);
  color: var(--accent-2);
  border: 1px solid rgba(37,99,235,0.3);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 4px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  margin-left: 12px;
  text-transform: uppercase;
  transition: all 0.2s ease;
  font-family: 'Syne', sans-serif;
}

.file-btn:hover .file-btn-action {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* ── Preview Modal ─────────────────────────────────────────────────────────── */
.preview-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.preview-modal.active { display: flex; }

.preview-modal-box {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 100%;
  max-width: 900px;
  height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.7);
  animation: modalUp 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes modalUp {
  from { opacity: 0; transform: translateY(32px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.preview-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.preview-modal-header h3 {
  font-family: 'Syne', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 85%;
  letter-spacing: -0.01em;
}

.preview-close-btn {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-2);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.preview-close-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.preview-frame-wrapper {
  flex: 1;
  min-height: 0;
  position: relative;
  background: var(--bg);
}

.preview-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  font-size: 0.9rem;
  font-family: 'DM Sans', sans-serif;
  pointer-events: none;
  letter-spacing: 0.04em;
}

.preview-frame-wrapper iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.preview-modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
}

/* ── Download Button ───────────────────────────────────────────────────────── */
.btn-preview-download {
  background: transparent;
  color: var(--text);
  font-family: 'Syne', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 11px 32px;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
  border: 1px solid rgba(37, 99, 235, 0.5);
  box-shadow: 0 0 20px rgba(37, 99, 235, 0.15);
}

.btn-preview-download::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 6px;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.8;
}

.btn-preview-download:hover {
  background: var(--accent-soft);
  box-shadow: 0 0 32px rgba(37, 99, 235, 0.35);
  transform: translateY(-1px);
}

/* ── About Page ────────────────────────────────────────────────────────────── */
.about-container { max-width: 860px; }

.about-content { margin-top: 24px; }

.about-card {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px;
  margin-bottom: 16px;
  transition: all 0.2s ease;
}

.about-card:hover {
  border-color: var(--border-hover);
  background: var(--accent-soft);
}

.about-card p {
  font-size: 0.92rem;
  color: var(--text-2);
  margin-bottom: 10px;
  text-align: left;
}

.about-icon { font-size: 2rem; margin-bottom: 12px; }

.tech-stack-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 32px;
  flex-wrap: wrap;
}

.tech-stack-row span {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-2);
  padding: 8px 18px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.8rem;
  font-family: 'Syne', sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── Sparks ────────────────────────────────────────────────────────────────── */
.spark-symbol {
  position: fixed;
  pointer-events: none;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--cyan);
  text-shadow: 0 0 8px var(--cyan);
  z-index: 9999;
  opacity: 1;
  transform: translate(-50%, -50%);
  animation: sparkMove 0.8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
  will-change: transform, opacity;
}

@keyframes sparkMove {
  0%   { opacity: 1; transform: translate(-50%,-50%) scale(0.5) rotate(0deg); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(1.2) rotate(var(--rot)); }
}

/* ── Scrollbar ─────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ── Admin ─────────────────────────────────────────────────────────────────── */
.pin-input {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.8rem;
  letter-spacing: 0.8rem;
  text-align: center;
  width: 100%;
  max-width: 280px;
  padding: 14px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-family: 'Syne', monospace;
}

.pin-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.admin-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px;
  backdrop-filter: blur(20px);
}

.admin-section h3 { color: var(--cyan); margin-bottom: 16px; font-size: 1.1rem; }

.form-group label {
  display: block;
  color: var(--text-3);
  margin-bottom: 6px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: 'Syne', sans-serif;
  font-weight: 600;
}

.form-input {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 6px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.92rem;
  margin-bottom: 16px;
  transition: border-color 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-2);
}

.btn-primary, .btn-upload {
  background: var(--accent);
  color: white;
  border: none;
  padding: 12px 32px;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'Syne', sans-serif;
  letter-spacing: 0.04em;
  transition: all 0.2s ease;
}

.btn-primary:hover, .btn-upload:hover {
  background: var(--accent-2);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

.admin-note-card {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 10px;
  font-size: 0.88rem;
  color: var(--text-2);
  line-height: 1.6;
}

.admin-note-card strong { color: var(--text); }

.admin-note-card button {
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  padding: 5px 12px;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
  margin-top: 8px;
  margin-right: 6px;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.2s;
}

.admin-note-card button:hover {
  border-color: var(--accent);
  color: var(--text);
  background: var(--accent-soft);
}

.error-message {
  color: #f87171;
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.25);
  padding: 12px 16px;
  border-radius: 6px;
  margin: 16px 0;
  font-size: 0.88rem;
}

.success-message {
  color: #34d399;
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.25);
  padding: 12px 16px;
  border-radius: 6px;
  margin: 16px 0;
  font-size: 0.88rem;
}

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .navbar { padding: 0 20px; }
  .nav-logo { font-size: 1.1rem; }
  h1 { font-size: 2.5rem; }
  h2 { font-size: 1.5rem; }
  .container { padding: 24px 18px; }
  .options-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
  .admin-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .navbar { height: 56px; }
  .screen { padding-top: 80px; }
  h1 { font-size: 2rem; }
  .app-icon { font-size: 3.5rem; }
  #notesBtn { padding: 13px 36px; font-size: 0.88rem; }
  .preview-modal-box { height: 95vh; border-radius: 10px; }
  .preview-modal-footer { justify-content: center; }
  .btn-preview-download { width: 100%; text-align: center; }
  .options-grid { grid-template-columns: 1fr 1fr; }
}

/* ═══════════════════════════════════════════════════
   EZ NOTES 2.0 — NEW FEATURE STYLES
   ═══════════════════════════════════════════════════ */

/* ── Version badge ──────────────────────────────── */
.nav-version-badge {
  font-family: 'Syne', sans-serif;
  font-size: 0.6rem;
  font-weight: 700;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  color: white;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.06em;
  margin-left: 4px;
}

/* ── Navbar new buttons ─────────────────────────── */
.nav-btn-calendar {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border);
  padding: 7px 16px;
  border-radius: 6px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}
.nav-btn-calendar:hover {
  color: var(--text);
  border-color: var(--accent-2);
  background: var(--accent-soft);
}

.nav-btn-studio {
  background: linear-gradient(135deg, rgba(37,99,235,0.2), rgba(6,182,212,0.15));
  color: var(--accent-2);
  border: 1px solid rgba(37,99,235,0.35);
  padding: 7px 16px;
  border-radius: 6px;
  font-family: 'Syne', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.02em;
}
.nav-btn-studio:hover {
  background: linear-gradient(135deg, rgba(37,99,235,0.35), rgba(6,182,212,0.25));
  border-color: var(--accent-2);
  color: white;
}

/* ── Auth nav ────────────────────────────────────── */
.nav-btn-signin {
  background: var(--accent);
  color: white;
  border: none;
  padding: 7px 18px;
  border-radius: 6px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.nav-btn-signin:hover { background: var(--accent-2); }

.nav-user-profile {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-2);
}
#userName {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
}
.nav-signout-btn {
  background: transparent;
  color: var(--text-3);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}
.nav-signout-btn:hover { color: #ef4444; border-color: rgba(239,68,68,0.4); }

/* ── Home actions ────────────────────────────────── */
.home-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 320px;
}

.btn-secondary-outline {
  background: transparent;
  color: var(--text-2);
  font-family: 'Syne', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 12px 40px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: all 0.2s ease;
  width: 100%;
}
.btn-secondary-outline:hover {
  border-color: var(--accent-2);
  color: var(--text);
  background: var(--accent-soft);
}

.btn-studio-home {
  background: linear-gradient(135deg, #2563eb22, #06b6d422);
  color: var(--accent-2);
  font-family: 'Syne', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 12px 40px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid rgba(37,99,235,0.3);
  transition: all 0.3s ease;
  width: 100%;
  position: relative;
}
.btn-studio-home::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 6px;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.6;
}
.btn-studio-home:hover {
  background: linear-gradient(135deg, #2563eb33, #06b6d433);
  transform: translateY(-2px);
}

/* ── Calendar ────────────────────────────────────── */
.calendar-container { max-width: 860px; }

.calendar-legend {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-2);
  font-family: 'DM Sans', sans-serif;
}
.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.calendar-wrapper {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 32px;
}

.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.cal-month-label {
  font-family: 'Syne', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.cal-nav-btn {
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  width: 34px;
  height: 34px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cal-nav-btn:hover { border-color: var(--accent-2); color: var(--text); }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-day-header {
  font-family: 'Syne', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-3);
  text-align: center;
  padding: 8px 0;
  text-transform: uppercase;
}
.cal-cell {
  min-height: 52px;
  border-radius: 6px;
  padding: 6px;
  position: relative;
  cursor: default;
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.15s;
}
.cal-cell.empty { background: transparent; }
.cal-cell.has-event {
  cursor: pointer;
  background: var(--bg-2);
  border-color: var(--border);
}
.cal-cell.has-event:hover { border-color: var(--accent-2); }
.cal-cell.today {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.cal-day-num {
  font-size: 0.82rem;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  color: var(--text-2);
  display: block;
}
.cal-cell.today .cal-day-num { color: var(--accent-2); font-weight: 700; }
.cal-dots {
  display: flex;
  gap: 3px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.cal-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Tooltip */
.cal-tooltip {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  min-width: 200px;
  max-width: 260px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.5);
}
.cal-tooltip-item {
  padding: 8px 12px;
  border-radius: 4px;
  margin-bottom: 8px;
  background: var(--bg-3);
}
.cal-tooltip-item:last-of-type { margin-bottom: 0; }
.cal-tooltip-type {
  font-family: 'Syne', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 2px;
}
.cal-tooltip-item strong {
  font-size: 0.88rem;
  color: var(--text);
  display: block;
  margin-bottom: 2px;
}
.cal-tooltip-item p { font-size: 0.78rem; color: var(--text-2); margin: 0; }
.cal-tooltip-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: transparent;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 2px 6px;
}

/* Upcoming events */
.upcoming-section { margin-top: 8px; }
.upcoming-heading {
  font-family: 'Syne', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}
.upcoming-list { display: flex; flex-direction: column; gap: 10px; }
.upcoming-item {
  padding: 14px 18px;
  border-radius: 8px;
  border-left-width: 3px !important;
}
.upcoming-date {
  font-family: 'Syne', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-3);
  text-transform: uppercase;
  margin-bottom: 2px;
}
.upcoming-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.upcoming-desc { font-size: 0.8rem; color: var(--text-2); }

/* ── Studio ──────────────────────────────────────── */
.studio-container {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 100px 24px 60px;
  min-height: 100vh;
  position: relative;
  z-index: 10;
}

.studio-header { margin-bottom: 28px; }
.studio-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 8px;
}
.studio-subtitle { color: var(--text-2); font-size: 0.92rem; margin: 0; }
.studio-badge-row { display: flex; align-items: center; gap: 10px; }
.studio-badge {
  font-family: 'Syne', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 5px 12px;
  border-radius: 20px;
  background: var(--accent-soft);
  border: 1px solid rgba(37,99,235,0.3);
  color: var(--accent-2);
}

.btn-start-studio {
  background: var(--accent);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 6px;
  font-family: 'Syne', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-start-studio:hover:not(:disabled) {
  background: var(--accent-2);
  transform: translateY(-1px);
}
.btn-start-studio:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Studio note browser — matches browse notes style */
.studio-notes-browser {
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.studio-sem-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.studio-sem-label {
  font-family: 'Syne', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-2);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.studio-subject-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.studio-subject-label {
  font-family: 'Syne', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 4px;
  padding: 0 4px;
}
.studio-note-item {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all 0.2s ease;
}
.studio-note-item:hover {
  border-color: var(--border-hover);
  background: var(--accent-soft);
}
.studio-note-item.selected {
  border-color: rgba(37,99,235,0.5);
  background: var(--accent-soft);
}
.studio-note-label {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  cursor: pointer;
}
.studio-checkbox {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer;
}
.studio-note-info { display: flex; flex-direction: column; gap: 3px; }
.studio-note-title { font-size: 0.92rem; font-weight: 500; color: var(--text); }
.studio-note-meta {
  font-size: 0.75rem;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 6px;
}
.studio-note-meta::before {
  content: "📄";
  font-size: 0.65rem;
}

/* Upload log */
.upload-log {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.upload-log-item {
  font-size: 0.88rem;
  font-family: 'DM Sans', sans-serif;
  padding: 10px 14px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.upload-log-item.uploading { background: var(--accent-soft); color: var(--text-2); }
.upload-log-item.success { background: rgba(16,185,129,0.1); color: #34d399; }
.upload-log-item.error { background: rgba(239,68,68,0.1); color: #f87171; }
.upload-spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: var(--accent-2);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Chat */
.chat-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}
.chat-topbar-left { display: flex; align-items: center; gap: 10px; }
.notes-chip {
  font-family: 'Syne', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 4px 12px;
  border-radius: 20px;
  background: var(--accent-soft);
  border: 1px solid rgba(37,99,235,0.3);
  color: var(--accent-2);
  text-transform: uppercase;
}

.chat-messages {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  min-height: 380px;
  max-height: 480px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 14px;
}

.chat-bubble {
  max-width: 78%;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.9rem;
  line-height: 1.6;
  font-family: 'DM Sans', sans-serif;
}
.chat-bubble.user {
  align-self: flex-end;
  background: var(--accent);
  color: white;
  border-bottom-right-radius: 2px;
}
.chat-bubble.assistant {
  align-self: flex-start;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 2px;
}
.chat-bubble.typing {
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 14px 18px;
}
.chat-bubble.typing span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text-3);
  animation: typingBounce 1s ease-in-out infinite;
}
.chat-bubble.typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-bubble.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typingBounce { 0%,80%,100%{transform:translateY(0)} 40%{transform:translateY(-6px)} }

.chat-bubble code {
  background: rgba(255,255,255,0.1);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: monospace;
  font-size: 0.85em;
}

.chat-input-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.chat-input {
  flex: 1;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.92rem;
  resize: none;
  transition: border-color 0.2s;
  max-height: 120px;
}
.chat-input:focus { outline: none; border-color: var(--accent); }
.chat-send-btn {
  background: var(--accent);
  color: white;
  border: none;
  width: 44px; height: 44px;
  border-radius: 8px;
  font-size: 1.2rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
}
.chat-send-btn:hover { background: var(--accent-2); }

/* Quick Make — premium card row */
.btn-quickmake { display: none; } /* hidden, replaced by card row */
.quickmake-menu { display: none; } /* hidden, replaced by card row */

.qm-card-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.qm-card {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 14px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.22,1,0.36,1);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  text-align: left;
  position: relative;
  overflow: hidden;
}
.qm-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.22s;
  border-radius: 10px;
}
.qm-card:hover { transform: translateY(-2px); border-color: var(--border-hover); }
.qm-card:hover::before { opacity: 1; }

.qm-card.quiz::before   { background: linear-gradient(135deg, rgba(139,92,246,0.08), transparent); }
.qm-card.summary::before { background: linear-gradient(135deg, rgba(6,182,212,0.08), transparent); }
.qm-card.mindmap::before { background: linear-gradient(135deg, rgba(16,185,129,0.08), transparent); }

.qm-card:hover.quiz   { border-color: rgba(139,92,246,0.4); }
.qm-card:hover.summary { border-color: rgba(6,182,212,0.4); }
.qm-card:hover.mindmap { border-color: rgba(16,185,129,0.4); }

.qm-card-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.qm-card.quiz .qm-card-icon     { background: rgba(139,92,246,0.15); }
.qm-card.summary .qm-card-icon  { background: rgba(6,182,212,0.15); }
.qm-card.mindmap .qm-card-icon  { background: rgba(16,185,129,0.15); }

.qm-card-title {
  font-family: 'Syne', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
}
.qm-card-desc {
  font-size: 0.72rem;
  color: var(--text-3);
  line-height: 1.4;
  font-family: 'DM Sans', sans-serif;
}

@media (max-width: 480px) {
  .qm-card-row { grid-template-columns: 1fr; }
  .qm-card { flex-direction: row; align-items: center; padding: 12px 14px; }
  .qm-card-icon { flex-shrink: 0; }
}

/* Quick Make Overlay */
.qm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  backdrop-filter: blur(12px);
  z-index: 9998;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.qm-box {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%;
  max-width: 680px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalUp 0.3s cubic-bezier(0.22,1,0.36,1);
}

.qm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.qm-label {
  font-family: 'Syne', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-2);
}
.qm-close {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-2);
  width: 30px; height: 30px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.qm-close:hover { background: rgba(239,68,68,0.15); color: #ef4444; border-color: rgba(239,68,68,0.3); }

/* Quiz */
.qm-progress {
  height: 3px;
  background: var(--bg-3);
  flex-shrink: 0;
}
.qm-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--cyan));
  transition: width 0.4s ease;
}
.qm-question {
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  padding: 24px 24px 16px;
  line-height: 1.6;
}
.qm-options {
  padding: 0 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.qm-option {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  color: var(--text-2);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 12px;
}
.qm-option:hover:not(:disabled) { border-color: var(--accent-2); color: var(--text); background: var(--accent-soft); }
.qm-option.correct { background: rgba(16,185,129,0.15); border-color: #10b981; color: #34d399; }
.qm-option.wrong   { background: rgba(239,68,68,0.15);  border-color: #ef4444; color: #f87171; }
.qm-opt-letter {
  width: 24px; height: 24px;
  border-radius: 4px;
  background: var(--bg-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Syne', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}
.qm-explanation {
  margin: 0 24px 20px;
  background: rgba(37,99,235,0.1);
  border: 1px solid rgba(37,99,235,0.25);
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 0.85rem;
  color: var(--text-2);
  line-height: 1.6;
}

/* Quiz score */
.qm-score-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 24px;
  text-align: center;
}
.qm-score-emoji { font-size: 3.5rem; margin-bottom: 16px; }
.qm-score-num {
  font-family: 'Syne', sans-serif;
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}
.qm-score-pct {
  font-family: 'Syne', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent-2);
  margin-bottom: 12px;
}
.qm-score-screen p { color: var(--text-2); margin-bottom: 24px; }
.qm-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 10px 28px;
  border-radius: 6px;
  font-family: 'Syne', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  margin: 4px;
  transition: all 0.2s;
}
.qm-btn:hover { background: var(--accent-2); }
.qm-btn.secondary {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-2);
}
.qm-btn.secondary:hover { border-color: var(--accent-2); color: var(--text); }
.qm-btn.small { padding: 6px 16px; font-size: 0.78rem; }

/* Summary */
.qm-summary { max-width: 780px; }
.qm-summary-body {
  overflow-y: auto;
  padding: 24px;
  flex: 1;
  min-height: 0;
}
.qm-summary-body h2 {
  font-family: 'Syne', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin: 20px 0 8px;
  text-align: left;
}
.qm-summary-body h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent-2);
  margin: 14px 0 6px;
  text-align: left;
}
.qm-summary-body p { font-size: 0.9rem; color: var(--text-2); }
.qm-summary-body code {
  background: rgba(255,255,255,0.08);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.85em;
}
.qm-summary-body strong { color: var(--text); }

/* Mind Map */
.qm-mindmap { max-width: 880px; }
.qm-mindmap-body { flex: 1; min-height: 0; overflow: hidden; }
.qm-mindmap-body canvas { display: block; }

/* Loading */
.qm-loading {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  text-align: center;
  border: none;
  background: transparent;
}
.qm-spinner {
  width: 40px; height: 40px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent-2);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin-bottom: 20px;
}
.qm-loading p { color: var(--text-2); font-size: 0.95rem; }

/* Auth Prompt */
.auth-prompt-box { max-width: 460px; }
.auth-prompt-body {
  padding: 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.auth-prompt-icon {
  font-size: 2.5rem;
  color: var(--accent-2);
  margin-bottom: 16px;
}
.auth-prompt-body h3 {
  font-family: 'Syne', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  text-align: center;
}
.auth-prompt-body p { font-size: 0.88rem; color: var(--text-2); margin-bottom: 8px; }

/* ── Subject section labels ──────────────────────── */
.subject-section-label {
  font-family: 'Syne', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-2);
  padding: 4px 0 10px 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}

#subjectList {
  display: flex !important;
  flex-direction: column !important;
  width: 100%;
  gap: 0;
}

/* ── Semester list centered ──────────────────────── */
#semesterList {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 768px) {
  .nav-btn-studio, .nav-btn-calendar { display: none; }
  .home-actions { max-width: 280px; }
  .studio-title-row { flex-direction: column; align-items: flex-start; }
  .chat-topbar { flex-direction: column; align-items: flex-start; }
  .qm-box { max-height: 95vh; }
  .qm-mindmap { max-width: 100%; }
}

@media (max-width: 480px) {
  .nav-btn-signin span { display: none; }
  .home-actions { max-width: 100%; }
  .studio-container { padding: 80px 16px 40px; }
}

/* ── Floating Selection Bar ────────────────────────────────────────────────── */

.studio-floating-bar {
  position: absolute;
  top: 40px;
  right: 40px;
  z-index: 99;
  /* Display is managed natively by Javascript */
  align-items: center;
  animation: floatBarIn 0.3s ease;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

@keyframes floatBarIn {
  from { opacity: 0; transform: translateY(-5px); }
  to   { opacity: 1; transform: translateY(0); }
}

.studio-floating-content {
  display: flex;
  align-items: center;
  gap: 16px;
}

.float-badge {
  color: var(--text-2);
  font-family: 'Syne', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.float-badge span {
  color: var(--cyan);
  font-size: 1rem;
}

/* ── Checkbox File Items ────────────────────────────────────────────────────── */

.file-btn.studio-selection-btn {
  padding-left: 20px;
}

.file-btn.studio-selection-btn:hover {
  padding-left: 28px;
}

.file-btn.studio-selection-btn.selected {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.studio-checkbox {
  width: 20px;
  height: 20px;
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg-3);
  border: 2px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  margin-left: 12px;
}

.studio-checkbox:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.studio-checkbox:checked::after {
  content: '✓';
  position: absolute;
  top: 45%; left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 0.85rem;
  font-weight: 900;
  font-family: sans-serif;
}

.studio-checkbox:hover {
  border-color: var(--accent-2);
}

/* ── SVG Scoremeter ───────────────────────────────────────────────────────── */
.scoremeter-container {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  margin: 30px auto;
  width: 150px;
}
.circle-bg {
  stroke: rgba(255, 255, 255, 0.08); /* slight grey circle */
}
.circle-animation {
  animation: strokeProgress 1.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes strokeProgress {
  0% { stroke-dasharray: 0, 100; opacity: 0; }
}
.percentage {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
}
.qm-score-screen {
  text-align: center;
  padding: 10px 20px 30px;
}
.qm-score-desc {
  font-size: 1.15rem;
  color: var(--text-2);
  margin-bottom: 8px;
  font-weight: 500;
}
.qm-score-desc strong {
  color: var(--text);
  font-weight: 700;
}