/* ==========================================================
   Guro Hub — style.css
   Custom component styling on top of Tailwind's utility classes.
   Design tokens (colors/fonts) are registered in the Tailwind
   config inside index.html; this file holds the things Tailwind
   utilities alone can't express: shapes, transitions, animation.
   ========================================================== */

* {
  font-family: 'Work Sans', sans-serif;
}
.font-display {
  font-family: 'Fraunces', serif;
  font-optical-sizing: auto;
}

/* Subtle ledger-line texture used as the app's background,
   evoking ruled notebook paper. */
.ledger-bg {
  background-image: repeating-linear-gradient(
    to bottom, transparent, transparent 35px, rgba(22, 48, 42, 0.045) 36px
  );
}

/* ----------------------------------------------------------
   Manila-folder tab navigation — the signature motif.
   Used for both the Login/Sign-up tabs and dashboard tabs.
   ---------------------------------------------------------- */
.folder-tab {
  position: relative;
  clip-path: polygon(10% 0%, 90% 0%, 100% 100%, 0% 100%);
  padding: 0.85rem 1.6rem 0.65rem;
  background: #DCC488;
  color: #3F4A45;
  border: none;
  transition: transform 0.15s ease, background-color 0.15s ease;
  transform: translateY(6px);
}
.folder-tab[data-active="true"] {
  background: #FBF6EA;
  color: #16302A;
  transform: translateY(0);
  font-weight: 600;
}
.folder-tab:not([data-active="true"]):hover {
  background: #EAD9A8;
  transform: translateY(3px);
}

/* ----------------------------------------------------------
   Auth Hub
   ---------------------------------------------------------- */
.auth-panel {
  display: none;
}
.auth-panel[data-visible="true"] {
  display: block;
  animation: fadeSlideIn 0.25s ease;
}

.account-type-btn {
  border-color: #DCC488;
  color: #3F4A45;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.account-type-btn[data-active="true"] {
  border-color: #16302A;
  background-color: #FBF6EA;
  color: #16302A;
}

.plan-card {
  border-color: #DCC488;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.plan-card[data-selected="true"] {
  border-color: #C08A28;
  background-color: #FDF8EC;
}

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

/* ----------------------------------------------------------
   App shell dashboards
   ---------------------------------------------------------- */
.dashboard {
  display: none;
}
.dashboard[data-active="true"] {
  display: block;
}

.dash-panel {
  display: none;
}
.dash-panel[data-visible="true"] {
  display: block;
  animation: fadeSlideIn 0.2s ease;
}

/* ----------------------------------------------------------
   Seat plan drag & drop
   ---------------------------------------------------------- */
.seat-slot.drag-over {
  background-color: #EAF2F5;
  border-color: #2C6E8E;
}
.seat-card {
  cursor: grab;
}
.seat-card:active {
  cursor: grabbing;
}

/* ----------------------------------------------------------
   Recitation Roulette
   ---------------------------------------------------------- */
#rouletteName {
  transition: opacity 0.06s linear;
}
@keyframes roulettePulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.04); }
  100% { transform: scale(1); }
}
.roulette-landed {
  animation: roulettePulse 0.3s ease;
}

/* ----------------------------------------------------------
   Student check-in mode buttons
   ---------------------------------------------------------- */
.mode-btn {
  border-color: #DCC488;
  color: #16302A;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.mode-btn[data-active="true"] {
  background-color: #16302A;
  color: #FBF6EA;
  border-color: #16302A;
}

/* A step that's waiting on a prior step to complete */
.step-locked {
  opacity: 0.4;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

/* Mood tracker */
.mood-btn {
  transition: transform 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}
.mood-btn[data-selected="true"] {
  background-color: #16302A;
  color: #FBF6EA;
  transform: scale(1.06);
}

/* Camera verification ring states */
.cam-ring {
  box-shadow: 0 0 0 3px #2C6E8E;
  transition: box-shadow 0.2s ease;
}
.cam-ring-done {
  box-shadow: 0 0 0 3px #4C7A4A;
  transition: box-shadow 0.2s ease;
}

@keyframes pulseLive {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}
.animate-pulse {
  animation: pulseLive 1.4s ease-in-out infinite;
}

@keyframes successPop {
  0%   { transform: scale(0.4); opacity: 0; }
  60%  { transform: scale(1.12); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
.success-pop {
  animation: successPop 0.35s ease;
}

/* ----------------------------------------------------------
   Modal (roster CSV import)
   ---------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(22, 48, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 90;
}
.modal-overlay.hidden {
  display: none;
}
.modal-card {
  border: 1px solid #DCC488;
  animation: fadeSlideIn 0.2s ease;
  max-height: 90vh;
  overflow-y: auto;
}

/* Star Shop perk redeem feedback */
.perk-row {
  transition: background-color 0.15s ease, opacity 0.15s ease;
}
.perk-row.redeemed {
  opacity: 0.5;
}
.perk-row:disabled {
  cursor: not-allowed;
}

/* ----------------------------------------------------------
   Toast
   ---------------------------------------------------------- */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: #16302A;
  color: #FBF6EA;
  padding: 0.85rem 1.25rem;
  border-radius: 4px;
  font-size: 0.9rem;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  z-index: 100;
  max-width: 320px;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ----------------------------------------------------------
   Notifications dropdown
   ---------------------------------------------------------- */
#notifDropdown:not(.hidden) {
  animation: fadeSlideIn 0.15s ease;
}

/* ----------------------------------------------------------
   Printable seat plan — only the seat plan card survives print
   ---------------------------------------------------------- */
@media print {
  body.printing-seatplan #authScreen,
  body.printing-seatplan header,
  body.printing-seatplan .no-print,
  body.printing-seatplan .dashboard:not([data-dashboard="teacher"]),
  body.printing-seatplan .dash-panel:not(#classroomPanel) {
    display: none !important;
  }
  body.printing-seatplan #classroomPanel { display: block !important; }
  body.printing-seatplan main { padding: 0; max-width: 100%; }
}

/* ----------------------------------------------------------
   Subject chooser pills (student check-in)
   ---------------------------------------------------------- */
.subject-pill {
  border: 1px solid #DCC488;
  color: #16302A;
  background: #fff;
  font-size: 0.75rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.subject-pill-active {
  border-color: #16302A;
  background: #16302A;
  color: #FBF6EA;
}
.subject-pill-done:not(.subject-pill-active) {
  border-color: #2C6E8E;
  color: #2C6E8E;
  background: #EAF2F5;
}

/* ----------------------------------------------------------
   Profile photo avatars (2x2 ID-style) — used in the header
   and every role's Profile/My ID tab. Each avatar is a
   fallback-initials circle with an <img> overlay that's
   revealed once a photo is uploaded.
   ---------------------------------------------------------- */
.avatar-upload-label {
  border: 1px solid #16302A;
  color: #16302A;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.avatar-upload-label:hover {
  background-color: #16302A;
  color: #FBF6EA;
}

/* ----------------------------------------------------------
   Portal chooser (Student / Parent / Teacher / Principal picker
   on the "/" landing route) and the scrollable dashboard nav
   ---------------------------------------------------------- */
.portal-card {
  border: 1px solid #DCC488;
  border-radius: 6px;
  padding: 1rem 0.75rem;
  text-align: center;
  background: #FBF6EA;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.portal-card:hover {
  border-color: #16302A;
  transform: translateY(-1px);
}

/* Dashboard tabs scroll horizontally on narrow screens instead of
   wrapping into several rows — a teacher has 8 tabs, which would
   otherwise eat a third of a phone screen before any content shows. */
.tabs-scroll {
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

/* ----------------------------------------------------------
   Small-screen safety nets
   ---------------------------------------------------------- */
@media (max-width: 480px) {
  .toast {
    left: 1rem;
    right: 1rem;
    max-width: none;
  }
  .modal-card {
    max-height: 85vh;
  }
}

/* ----------------------------------------------------------
   Misc
   ---------------------------------------------------------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #DCC488; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
