/* ---------- Theme ---------- */
:root{
  --bg:#0b0b0b;
  --panel: rgba(255,255,255,0.06);
  --panel-strong: rgba(255,255,255,0.12);
  --glass-stroke: rgba(255,255,255,0.18);
  --txt:#f6f6f6;
  --muted:#c7c7c7;
  --orange:#ff7a18;
  --orange-strong:#ff8c32;
  --good:#39d98a;
  --shadow: 0 10px 30px rgba(0,0,0,0.45);
}

*{ box-sizing:border-box }
html,body{ height:100% }
body{
  margin:0; font-family:'Inter',system-ui,-apple-system,Segoe UI,Roboto,sans-serif;
  color:var(--txt); background:var(--bg); overflow-x:hidden;
}
.container{ width:min(1200px,92vw); margin-inline:auto }

/* ---------- Background (mirrors dashboard) ---------- */
.bg-mesh{
  position:fixed; inset:-10vmax; z-index:-3;
  background:
    radial-gradient(40vmax 40vmax at 15% 15%, rgba(255,122,24,.15), transparent 60%),
    radial-gradient(50vmax 50vmax at 85% 25%, rgba(255,122,24,.08), transparent 60%),
    radial-gradient(55vmax 55vmax at 50% 90%, rgba(255,255,255,.06), transparent 60%),
    linear-gradient(180deg, #0b0b0b 0%, #0a0a0a 100%);
  filter:saturate(1.1);
  animation: meshShift 20s ease-in-out infinite alternate;
}
@keyframes meshShift{ 0%{ transform:translateY(0)} 100%{ transform:translateY(-2vh)} }
.grid-overlay{
  position:fixed; inset:0; z-index:-2;
  background:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px) 0 0/40px 40px,
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px) 0 0/40px 40px;
  mask-image: radial-gradient(80% 60% at 50% 40%, rgba(0,0,0,.9), transparent 80%);
  pointer-events:none;
}
.orbs{ position:fixed; inset:0; z-index:-1; pointer-events:none }
.orb{ position:absolute; width:28vmax; height:28vmax; border-radius:50%;
  background: radial-gradient(closest-side, rgba(255,122,24,.20), rgba(255,122,24,0) 70%);
  filter: blur(30px); animation: float 14s ease-in-out infinite }
.o1{ top:10%; left:-8%; animation-delay:-2s }
.o2{ bottom:-10%; right:-6%; animation-duration:18s }
.o3{ top:55%; left:60%; width:22vmax; height:22vmax; animation-duration:16s }
@keyframes float{ 0%{ transform: translate(0,0) } 50%{ transform: translate(2vmax,-1vmax) } 100%{ transform: translate(-1vmax,1vmax) } }

/* ---------- Header ---------- */
.header{
  display:flex; align-items:center; justify-content:space-between; padding:24px 0;
}
.brand{ display:flex; gap:.6rem; align-items:center; color:var(--txt); text-decoration:none }
.logo{ height:80px; width:auto }
.ember-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(255,122,24,.6));
  animation: emberPulse 3s ease-in-out infinite;
}

@keyframes emberPulse {
  0%,100% { transform: scale(1); filter: drop-shadow(0 0 10px rgba(255,122,24,.5)); }
  50% { transform: scale(1.05); filter: drop-shadow(0 0 16px rgba(255,122,24,.9)); }
}
.nav{ display:flex; gap:1rem; align-items:center }
.nav a{ color:var(--txt); text-decoration:none; opacity:.9; padding:.6rem .9rem; border-radius:10px; transition:.25s }
.nav a:hover{ background: rgba(255,122,24,.12); opacity:1; }

/* Profile chip */
.profile-chip{
  display:flex; align-items:center; gap:.5rem; text-decoration:none; color:var(--txt);
  padding:.45rem .65rem; border-radius:999px;
  background: rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(8px); transition: all .25s ease;
}
.profile-chip .avatar{
  width:28px; height:28px; border-radius:50%;
  display:grid; place-items:center; background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.18);
}
.profile-chip:hover{ box-shadow: 0 10px 24px rgba(255,122,24,.2); border-color: rgba(255,122,24,.45); }

/* ---------- Common Glass / Buttons ---------- */
.glass{
  background: var(--panel);
  border: 1px solid var(--glass-stroke);
  border-radius: 22px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.btn{
  display:inline-flex; text-decoration:none; color:var(--txt);                 /* unified for alignment */
  align-items:center; justify-content:center;
  vertical-align:middle;               /* aligns buttons on one line */
  font-weight:600; font-size:1rem; line-height:1;
  padding:.9rem 1.2rem; border-radius:14px;
  border:1px solid var(--glass-stroke);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  backdrop-filter: blur(10px);
  transform: translateZ(0);
  box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
}
.btn:hover{ transform: translateY(-2px); box-shadow: 0 16px 40px rgba(255,122,24,.25), var(--shadow) }
.btn.primary{
  background:
    linear-gradient(135deg, rgba(255,122,24,.35), rgba(255,122,24,.10)),
    linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.02));
  border-color: rgba(255,122,24,.45);
  animation: breathe 3.2s ease-in-out infinite;
}
.btn.outline{ background:transparent; border-color: rgba(255,255,255,.22) }
.btn.sm{ padding:.5rem .85rem }

/* tiny link button */
.tiny-link,
.tiny-link:link,
.tiny-link:visited{
  display:inline-flex; align-items:center; gap:.45rem; font-weight:700; font-size:.95rem; color:var(--txt);
  text-decoration:none; padding:.42rem .8rem; border-radius:999px; border:1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.06); backdrop-filter: blur(8px);
  transition: border-color .2s ease, box-shadow .25s ease, transform .15s ease;
}
.tiny-link::after{ content:"›"; font-weight:800; transform: translateX(0); transition: transform .2s ease; opacity:.9 }
.tiny-link:hover{ border-color: rgba(255,122,24,.45); box-shadow: 0 10px 26px rgba(255,122,24,.25), var(--shadow); transform: translateY(-1px) }

/* ---------- Hero ---------- */
.hero{
  display:flex; align-items:center; justify-content:space-between; gap:1rem;
  padding:1rem; margin-top:.2rem;
}
.accent{ color:var(--orange-strong); text-shadow: 0 0 16px rgba(255,122,24,.35) }
.muted{ color:var(--muted) }
.fade-in{ opacity:0; transform: translateY(16px); animation: fadeUp .9s ease-out forwards }
@keyframes fadeUp{ to{ opacity:1; transform: translateY(0) } }
@keyframes breathe{ 0%,100%{ box-shadow: 0 0 0 0 rgba(255,122,24,.28), var(--shadow) } 50%{ box-shadow: 0 0 35px 4px rgba(255,122,24,.38), var(--shadow) } }

/* ---------- Blocks ---------- */
.block{ padding:1rem; margin-top:1rem }
.block-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:.5rem }
.pill{ padding:.25rem .55rem; border-radius:999px; font-size:.85rem; background: rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.18) }

/* simple chips for headings/counters */
.chip{
  display:inline-flex; align-items:center; gap:.4rem;
  padding:.35rem .7rem; border-radius:999px; font-weight:800;
  background: rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.18);
}
.chip-orange{
  background: linear-gradient(135deg, rgba(255,122,24,.35), rgba(255,122,24,.12));
  border-color: rgba(255,122,24,.55);
  color:#fff;
  box-shadow: 0 10px 22px rgba(255,122,24,.22);
}
.chip-count{ color:#fff; opacity:.9 }

/* rail (horizontal scroller) */
.rail{
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 1fr);
  gap: 1rem;
  overflow-x: auto;         /* horizontal scroll only */
  overflow-y: visible;      /* <-- allow hover to rise past the rail */
  padding-top: .6rem;       /* <-- breathing room for hover lift */
  padding-bottom: 1rem;     /* keep shadow room below */
  scroll-snap-type: x mandatory;
}
.tile{
  scroll-snap-align:start;
  padding:.8rem;
  border-radius:16px;
  background: rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.14);
  display:grid;
  gap:.35rem;
  transition: transform .15s ease, box-shadow .25s ease, border-color .2s ease;
  will-change: transform;
}

.tile:hover{
  transform: translateY(-6px); /* more lift, but now won’t get clipped */
  box-shadow: 0 18px 40px rgba(255,122,24,.3);
  border-color: rgba(255,122,24,.55);
  z-index: 2;                 /* make sure hovered card floats above neighbors */
}
.tile .row{ display:flex; align-items:center; justify-content:space-between }
.icon{
  width:44px; height:44px; border-radius:12px; display:grid; place-items:center;
  background: rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.18);
  box-shadow: inset 0 0 20px rgba(255,255,255,.06);
}
.icon.i1{ background: linear-gradient(135deg, rgba(255,122,24,.22), rgba(255,255,255,.04)) }
.icon.i2{ background: linear-gradient(135deg, rgba(255,180,120,.22), rgba(255,255,255,.04)) }
.icon.i3{ background: linear-gradient(135deg, rgba(120,220,255,.18), rgba(255,255,255,.04)) }
.icon.i4{ background: linear-gradient(135deg, rgba(200,120,255,.2), rgba(255,255,255,.04)) }
.icon.i5{ background: linear-gradient(135deg, rgba(255,122,24,.22), rgba(255,255,255,.04)) }
.icon.i6{ background: linear-gradient(135deg, rgba(90,255,190,.18), rgba(255,255,255,.04)) }
.icon.i7{ background: linear-gradient(135deg, rgba(255,150,120,.22), rgba(255,255,255,.04)) }
.icon.i8{ background: linear-gradient(135deg, rgba(255,122,24,.25), rgba(255,255,255,.05)) }

.tiny{ font-size:.92rem }

/* grid (your quizzes) */
.grid{ display:grid; grid-template-columns: repeat(3, 1fr); gap:.7rem }
.hidden{ display:none !important; }
.empty{
  display:grid; place-items:center; gap:.3rem; padding:1.2rem; border-radius:16px;
  background: rgba(255,255,255,.04); border:1px dashed rgba(255,255,255,.18);
  text-align:center;
}
.empty .bubble{
  width:56px; height:56px; border-radius:14px; display:grid; place-items:center;
  background: rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.18);
}

/* ---------- Floating Upload Button ---------- */
.fab{
  position:fixed; right:20px; bottom:22px; width:54px; height:54px; border-radius:18px;
  background: linear-gradient(135deg, rgba(255,122,24,.35), rgba(255,122,24,.10));
  color:var(--txt); font-size:1.2rem; border:1px solid rgba(255,122,24,.45);
  box-shadow: 0 20px 40px rgba(255,122,24,.25);
  cursor:pointer;
}

.fab-icon {
  width: 22px;
  height: 22px;
  color: var(--txt);
  stroke: var(--orange-strong);
  filter: drop-shadow(0 0 6px rgba(255,122,24,.6));
}

.upload-btn {
  display: inline-flex;          /* ensure icon + text align as flex children */
  align-items: center;           /* vertical centering */
  justify-content: center;
  gap: .6rem;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;                /* tighter line height for better centering */
  padding: .9rem 1.4rem;
}

.upload-btn .icon {
  width: 20px;
  height: 20px;
  stroke: var(--orange-strong);
  flex-shrink: 0;
}

/* ---------- Upload Modal ---------- */
.overlay{ position:fixed; inset:0; background: rgba(0,0,0,.45); display:none; align-items:center; justify-content:center; z-index:10 }
.overlay.show{ display:flex }
.modal{ width:min(760px,96vw); padding:1rem; border-radius:22px; position:relative }
.modal .x{
  position:absolute; top:10px; right:10px; border:1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.06); border-radius:10px; color:var(--txt);
  width:34px; height:34px; cursor:pointer;
}
.modal .head{ display:flex; gap:.8rem; align-items:center; margin-bottom:.6rem }
.logo-wrap{
  width:56px; height:56px; border-radius:16px; display:grid; place-items:center;
  background: linear-gradient(135deg, rgba(255,122,24,.28), rgba(255,122,24,.10));
  border:1px solid rgba(255,122,24,.45); box-shadow: inset 0 0 24px rgba(255,122,24,.22), var(--shadow);
}

.drop{
  border:1px dashed rgba(255,255,255,.22); border-radius:16px; padding:.8rem; transition:.2s; margin-bottom:.6rem;
  background: rgba(255,255,255,.05);
}
.drop.drag{ border-color: rgba(255,122,24,.55); box-shadow: 0 12px 28px rgba(255,122,24,.25) }
.drop-inner{ display:grid; place-items:center; gap:.35rem; text-align:center }
.drop .emoji{ font-size:2rem }
.hint{ opacity:.9 }

/* ---------- Upload Progress ---------- */
.progress {
  margin: 1rem 0;
  padding: 0.8rem 1rem;
  border-radius: 16px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.15);
  backdrop-filter: blur(10px);
  display: grid;
  gap: 0.6rem;
  animation: fadeUp .4s ease-out;
}

.progress .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
}

.progress .row::before {
  content: "📄";
  margin-right: 0.6rem;
  font-size: 1.2rem;
}

.progress .bar {
  height: 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.15);
  overflow: hidden;
  position: relative;
}

.progress .bar > span {
  display: block;
  height: 100%;
  width: var(--p, 0%);
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    rgba(255,122,24,.9) 0%,
    rgba(255,140,50,1) 50%,
    rgba(255,122,24,.9) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 2s linear infinite;
  transition: width 0.25s ease;
}

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

.progress .small {
  font-size: 0.9rem;
  color: var(--muted);
}
.actions{ display:flex; justify-content:flex-end; gap:.6rem }

/* ---------- Footer tweaks for spacing on page bottom ---------- */
main.container{ padding-bottom: 40px }

/* ---------- Responsive ---------- */
@media (max-width: 980px){
  .grid{ grid-template-columns: 1fr 1fr }
}
@media (max-width: 680px){
  .nav a:not(.btn){ display:none }
  .grid{ grid-template-columns: 1fr }
}

/* ---------- Quiz Details Modal ---------- */
.modal.details { animation: pop .22s ease-out; }
@keyframes pop { from { transform: scale(.98); opacity: .8 } to { transform: scale(1); opacity: 1 } }

.details-icon {
  display:grid; place-items:center; font-size:1.4rem; color: var(--orange-strong);
  filter: drop-shadow(0 0 10px rgba(255,122,24,.5));
}

.metrics{
  display:grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap:.6rem; margin:.8rem 0;
}
.metric{
  padding:.9rem; border-radius:14px;
  background: rgba(255,255,255,.06);
  border:1px solid var(--glass-stroke);
  text-align:center;
}
.metric span{ display:block; font-size:.85rem; color:var(--muted) }
.metric strong{ display:block; font-size:1.2rem; margin-top:.25rem }

.topics h4, .notes h4{ margin:.6rem 0 .35rem }
.chips{ display:flex; flex-wrap:wrap; gap:.4rem }
.chips .chip{
  padding:.35rem .6rem; border-radius:999px; font-size:.92rem;
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,122,24,.35);
  backdrop-filter: blur(8px);
  transition: transform .15s ease, box-shadow .2s ease, border-color .2s ease;
}
.chips .chip:hover{ transform: translateY(-2px); box-shadow: 0 10px 26px rgba(255,122,24,.25); border-color: rgba(255,122,24,.55); }

@media (max-width: 680px){
  .metrics{ grid-template-columns: 1fr; }
}

/* ---------- Study Tips Styling ---------- */
.tips-list {
  list-style: none;
  margin: 0.4rem 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.tips-list li {
  position: relative;
  padding-left: 1.6rem;
  font-size: 0.95rem;
  color: var(--txt);
  line-height: 1.45;
  background: rgba(255,255,255,.03);
  border-radius: 12px;
  padding: .6rem .8rem .6rem 1.6rem;
  border: 1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(6px);
  transition: transform .2s ease, box-shadow .25s ease;
}

.tips-list li::before {
  content: "➤";
  position: absolute;
  left: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--orange-strong);
  text-shadow: 0 0 10px rgba(255,122,24,.7);
  font-size: 0.9rem;
}

.tips-list li:hover {
  transform: translateX(3px);
  box-shadow: 0 0 20px rgba(255,122,24,.25);
  border-color: rgba(255,122,24,.4);
}

/* Highlighted key terms */
.tips-list li .key {
  color: var(--orange-strong);
  font-weight: 600;
  text-decoration: underline;
  text-shadow: 0 0 8px rgba(255,122,24,.6);
}

/* ---------- Footer (match index) ---------- */
.footer{
  display:flex; align-items:center; justify-content:space-between;
  padding: 18px 0 40px; color:var(--muted);
}
.foot-nav{ display:flex; gap:1rem; }
.foot-nav a{ color:var(--muted); text-decoration:none; }
.foot-nav a:hover{ color:var(--txt); }

@media (max-width: 640px){
  .footer{ flex-direction:column; gap:.6rem; }
}
