/* Magspire Edu, custom styles on top of DaisyUI */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700;800&display=swap');

html {
    font-family: 'Sora', system-ui, sans-serif;
}

/* Register form: make field wrappers real blocks and space them evenly */
.register-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.register-form > * {
  margin: 0 !important;
}
.register-form .form-control {
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* Active link: soft tint that follows the theme color (light + dark) */
.sidebar-nav .menu li > a.active {
  background: color-mix(in oklch, var(--color-primary) 12%, transparent);
  color: var(--color-primary);
  font-weight: 500;
}

/* Smooth theme transition, skip on inputs to avoid input lag */
*,
*::before,
*::after {
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.15s ease;
}

input,
button,
select,
textarea {
    transition: none;
}

/* Brand monogram */
.brand-mark {
    width: 2.25rem;
    height: 2.25rem;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: var(--color-primary-content);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: -0.02em;
    border-radius: 0.65rem;
    flex-shrink: 0;
    overflow: hidden;
}

.brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.brand-mark-inverse {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

/* Brand lockup: "Magspire" + smaller "Prep" on one line, same baseline.
   Nowrap + line-height:1 stops "Prep" from dropping onto its own line,
   which is the sagging/wrap issue you were seeing. */
.brand-name {
    display: inline-flex;
    align-items: baseline;
    white-space: nowrap;
    line-height: 1;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -0.01em;
    color: var(--color-base-content);
}

.brand-prep {
    font-size: 0.75em;
    font-weight: 600;
    letter-spacing: -0.005em;
    margin-left: 0.04em;
    color: var(--color-primary);
}

/* On the colored auth-panel, "Prep" must contrast against the panel itself,
   not the site's primary color — the panel IS primary-colored in light theme,
   which made "Prep" invisible (text == background). */
.auth-panel .brand-prep {
    color: rgba(255, 255, 255, 0.75);
}

/* Same cascade issue as .brand-prep: .brand-name's own color wins over the
   text-white utility class on the auth panel since main.css loads after
   Tailwind. Force white here specifically. */
.auth-panel .brand-name {
    color: #ffffff;
}

/* Hero sections */
.auth-brand-name {
    font-size: clamp(1.1rem, 4vw, 1.25rem);
}

.page-content {
    min-height: calc(100vh - 4rem);
}

/* Page shell background: FLAT opaque colour. Do NOT put bg-base-200/30 back.
   That Tailwind utility compiles to
     color-mix(in oklab, var(--color-base-200) 30%, transparent)
   i.e. a ~2-level-alpha translucent overlay that the browser quantises once
   into the mix result and again when compositing over the page - two 8-bit
   roundings in a row, which is what renders as horizontal banding across the
   whole viewport on Chrome/Android (other engines dither it away). Pre-mixing
   the colour once, in CSS, leaves nothing for the GPU to band.
   base.html reads it as bg-[var(--shell-bg)]. */
:root {
    --shell-bg: #fdfdfe;
}

/* Theme toggle icon: sun in dark mode, moon in light mode */
[data-theme="dark"] #theme-toggle-btn .icon-moon { display: none; }
[data-theme="light"] #theme-toggle-btn .icon-sun { display: none; }

[data-theme="dark"] {
    --shell-bg: #121b2e;
}

/* Exam taking, question navigator */
.question-nav-btn {
    background-color: var(--color-base-100);
    border-color: var(--color-base-300);
    color: var(--color-base-content);
}

.question-nav-btn.question-nav-answered {
    background-color: var(--color-success);
    border-color: var(--color-success);
    color: var(--color-success-content);
}

/* Question card header (exam page and review page) */
.q-head {
  min-width: 0;
}
.q-head-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}
.q-head-group > * {
  white-space: nowrap;
}
.q-head .badge {
  flex-shrink: 0;
  height: auto;
  min-height: 1.25rem;
  padding-block: 0.15rem;
  line-height: 1.25;
}

/* Very narrow phones: the right group drops to its own line */
@media (max-width: 380px) {
  .q-head {
    flex-wrap: wrap;
    row-gap: 0.5rem;
  }
}

/* Question form, correct option highlight */
.option-wrapper {
    border: 1px solid var(--color-base-300);
    border-radius: 0.65rem;
    padding: 0.75rem;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.option-wrapper.option-selected {
    border-color: var(--color-success);
    background-color: color-mix(in oklch, var(--color-success) 8%, transparent);
}

/* Softer card shadow than the DaisyUI default */
.card.shadow-sm {
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 1px rgba(15, 23, 42, 0.03);
}

/* Scrollbar, subtle */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-thumb {
    background: var(--color-base-300);
    border-radius: 999px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

/* Mobile drawer slide-out backdrop — no blur, GPU-safe on low-end devices */
.drawer-overlay {
    background-color: rgba(15, 23, 42, 0.5) !important;
    transition: background-color 0.2s ease;
}

/* Softer and premium outlines/borders */
.btn.btn-outline {
    border-color: color-mix(in oklch, var(--color-base-content) 15%, transparent) !important;
    color: var(--color-base-content) !important;
}

.btn.btn-outline:hover {
    background-color: color-mix(in oklch, var(--color-base-content) 8%, transparent) !important;
    border-color: color-mix(in oklch, var(--color-base-content) 30%, transparent) !important;
    color: var(--color-base-content) !important;
}

.badge.badge-outline {
    border-color: color-mix(in oklch, var(--color-base-content) 20%, transparent) !important;
    color: var(--color-base-content) !important;
    background-color: transparent !important;
}

/* Softer base borders that might use base-200/base-300 or fallbacks */
[class*="border-base-200"],
[class*="border-base-300"] {
    border-color: color-mix(in oklch, var(--color-base-content) 10%, transparent) !important;
}

.input:focus {
    outline: none;
    border-color: #5b4fcf;
    border-width: 1.5px;
    box-shadow: 0 0 0 3px rgba(91, 79, 207, 0.1);
}

.btn-loading {
    pointer-events: none;
    cursor: not-allowed;
    position: relative;
    overflow: hidden;
}

.btn-loading:disabled,
.btn-loading[disabled] {
    opacity: 0.75 !important;
    --btn-color: var(--color-primary) !important;
    --btn-bg: var(--color-primary) !important;
    --btn-fg: var(--color-primary-content) !important;
    background-color: var(--color-primary) !important;
    color: var(--color-primary-content) !important;
    border-color: var(--color-primary) !important;
}

.btn-loading::after {
    content: "";
    position: absolute;
    top: 0;
    left: -40%;
    width: 20%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: btn-shimmer 1.4s ease-in-out infinite;
}

@keyframes btn-shimmer {
    0% { left: -40%; }
    100% { left: 120%; }
}

.verify-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.625rem 0.875rem;
    border-radius: 0.75rem;
    background-color: color-mix(in srgb, var(--fallback-wa, oklch(var(--wa))) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--fallback-wa, oklch(var(--wa))) 25%, transparent);
}

.verify-banner p {
    font-size: 0.8125rem;
    color: var(--fallback-bc, oklch(var(--bc) / 0.8));
    margin: 0;
}

@keyframes ellipsis-wave {

    0%,
    60%,
    100% {
        opacity: 0.3;
        transform: translateY(0);
    }

    30% {
        opacity: 1;
        transform: translateY(-3px);
    }
}

.btn-loading-dots span {
    display: inline-block;
    animation: ellipsis-wave 1.2s ease-in-out infinite;
}

.btn-loading-dots span:nth-child(2) {
    animation-delay: 0.15s;
}

.btn-loading-dots span:nth-child(3) {
    animation-delay: 0.30s;
}

/* Get started — arrow nudge */
.get-started-nav {
    white-space: nowrap;
}

.get-started-nav .get-started-arrow {
    display: inline-block;
    flex-shrink: 0;
    animation: get-started-arrow-nudge 2.5s ease-in-out infinite;
}

@keyframes get-started-arrow-nudge {
    0%, 35%, 75%, 100% {
        transform: translateX(0);
    }

    50%, 62% {
        transform: translateX(5px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .get-started-nav .get-started-arrow {
        animation: none;
    }
}

/* Shared footer — clean & minimal */
.site-footer {
    --footer-muted: color-mix(
        in srgb, var(--color-base-content) 65%, var(--color-base-100)
    );
    --footer-line: color-mix(
        in srgb, var(--color-base-content) 14%, var(--color-base-100)
    );

    margin-top: 5rem;
    border-top: 1px solid var(--footer-line);
    background: var(--color-base-100);
    color: var(--color-base-content);
}

.site-footer__inner {
    max-width: 72rem;
    margin-inline: auto;
    padding: 3rem 1.5rem 1.5rem;
}

.site-footer__brand {
    margin-bottom: 2rem;
}

.site-footer__logo {
    display: inline-flex;
    align-items: baseline;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    line-height: 1.2;
    color: var(--color-base-content);
    text-decoration: none;
}

.site-footer__logo span {
    color: var(--color-primary);
    font-size: 0.75em;
    font-weight: 600;
    letter-spacing: -0.025em;
}

.site-footer__brand p {
    margin: 0.75rem 0 0;
    color: var(--footer-muted);
    font-size: 0.875rem;
    line-height: 1.75;
}

.site-footer__layout {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 3.5rem;
}

.site-footer__links {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));  
    gap: 1.5rem;
}

.site-footer__heading,
.site-footer__eyebrow {
    margin: 0 0 1rem;
    color: var(--footer-muted);
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    line-height: 1.5;
    text-transform: uppercase;
}

.site-footer__links ul {
    display: grid;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-footer__links a {
    display: inline-block;
    padding-block: 0.375rem;
    color: var(--color-base-content);
    font-size: 0.875rem;
    line-height: 1.6;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.site-footer__links a:hover {
    color: var(--color-primary);
}

.site-footer__newsletter {
    min-width: 0;
}

.site-footer__eyebrow {
    color: var(--color-primary);
    margin-bottom: 0.625rem;
}

.site-footer__newsletter h2 {
    margin: 0 0 0.75rem;
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.3;
}

.site-footer__description {
    max-width: 28rem;
    margin: 0 0 1.25rem;
    color: var(--footer-muted);
    font-size: 0.8125rem;
    line-height: 1.8;
}

/* Pill-shaped signup */
.site-footer__form {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    width: 100%;
    max-width: 29rem;
    padding: 0.3125rem;
    border: 1px solid var(--footer-line);
    border-radius: 999px;
}

.site-footer__form:focus-within {
    border-color: var(--color-primary);
    outline: none;
}

.site-footer__form input {
    flex: 1;
    min-width: 0;
    width: 100%;
    min-height: 2.75rem;
    padding: 0.625rem 0.75rem;
    border: 0;
    border-radius: 999px;
    outline: none;
    background: transparent;
    color: var(--color-base-content);
    font-family: inherit;

    /* Avoid focus zoom on iPhone */
    font-size: 1rem;
    line-height: 1.5;
}

.site-footer__form input::placeholder {
    color: var(--footer-muted);
    opacity: 1;
}

.site-footer__form button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    gap: 0.5rem;
    min-height: 2.75rem;
    padding: 0.625rem 1rem;
    border: 0;
    border-radius: 999px;
    background: var(--color-primary);
    color: var(--color-primary-content);
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
}

.site-footer__form button:hover {
    background: color-mix(
        in srgb, var(--color-primary) 90%, black
    );
}

.site-footer__form button svg {
    flex-shrink: 0;
}

.site-footer a:focus-visible,
.site-footer button:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 4px;
}

.site-footer__bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.75rem 1.5rem;
    margin-top: 2.125rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--footer-line);
    color: var(--footer-muted);
    font-size: 0.6875rem;
    line-height: 1.8;
}

.site-footer__bottom p {
    margin: 0;
}

.site-footer__bottom span {
    margin-left: 0.25rem;
    color: var(--color-primary);
}

.site-footer__sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Mobile: links stay side by side; signup moves underneath */
@media (max-width: 900px) {
    .site-footer__layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.75rem;
    }

    .site-footer__newsletter {
        padding-top: 1.75rem;
        border-top: 1px solid var(--footer-line);
    }
}

@media (max-width: 650px) {
    .site-footer__links {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .site-footer__inner {
        padding: 2rem 1.5rem 1.5rem;
    }

    .site-footer__layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.75rem;
    }

    .site-footer__newsletter {
        padding-top: 1.75rem;
        border-top: 1px solid var(--footer-line);
    }

    .site-footer__bottom {
        flex-direction: column;
        gap: 0.375rem;
    }
}

/* ===== Sidebar: comfortable sizing (Option A) ===== */

/* Spacing between links */
.sidebar-nav ul.menu {
  gap: 4px;
}

/* Each link: bigger text, roomier padding, softer corners */
.sidebar-nav .menu.menu-sm li:not(.menu-title) > a {
  font-size: 15px;
  padding: 10px 14px;
  gap: 12px;
  border-radius: 10px;
}

/* Bigger icons */
.sidebar-nav .menu li > a svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Role label ("Student", "Admin", ...) */
.sidebar-nav .menu.menu-sm .menu-title {
  font-size: 12px;
  padding: 4px 14px;
}

/* Slightly taller brand area */
.drawer-side aside > div:first-child {
  height: 72px;
}

/* Scrolling: brand and user stay pinned, only the links scroll */
.drawer-side > aside {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
}
.sidebar-nav {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Sidebar scrollbar: hidden until you hover or scroll, then a floating pill */
:is(.drawer-side, .drawer-side aside, .sidebar-nav) {
  scrollbar-width: auto;
  scrollbar-color: auto;
}
:is(.drawer-side, .drawer-side aside, .sidebar-nav)::-webkit-scrollbar {
  width: 10px;
  background: transparent;
}
:is(.drawer-side, .drawer-side aside, .sidebar-nav)::-webkit-scrollbar-track {
  background: transparent;
}
:is(.drawer-side, .drawer-side aside, .sidebar-nav)::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}
:is(.drawer-side, .drawer-side aside, .sidebar-nav)::-webkit-scrollbar-thumb {
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: padding-box;
  background-color: transparent;
  transition: background-color 0.25s ease;
}
.drawer-side:hover :is(.drawer-side, .sidebar-nav)::-webkit-scrollbar-thumb,
.drawer-side:hover::-webkit-scrollbar-thumb,
.drawer-side:hover aside::-webkit-scrollbar-thumb,
.drawer-side:hover .sidebar-nav::-webkit-scrollbar-thumb,
.is-scrolling::-webkit-scrollbar-thumb {
  background-color: color-mix(in oklch, var(--color-primary) 70%, transparent);
}

/* Firefox: same idea with the standard properties */
@supports not selector(::-webkit-scrollbar) {
  :is(.drawer-side, .drawer-side aside, .sidebar-nav) {
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
  }
  .drawer-side:hover, .drawer-side:hover aside, .drawer-side:hover .sidebar-nav {
    scrollbar-color: color-mix(in oklch, var(--color-primary) 55%, transparent) transparent;
  }
}

/* Notification bell: gentle shake at intervals while there are unread notifications */
.bell-has-unread .bell-icon {
  transform-origin: 50% 10%;
  animation: bell-shake 6s ease-in-out infinite;
}

@keyframes bell-shake {
  0%, 12%, 100% { transform: rotate(0deg); }
  2%  { transform: rotate(14deg); }
  4%  { transform: rotate(-12deg); }
  6%  { transform: rotate(9deg); }
  8%  { transform: rotate(-6deg); }
  10% { transform: rotate(3deg); }
}

@media (prefers-reduced-motion: reduce) {
  .bell-has-unread .bell-icon { animation: none; }
}

/* Close cross in the mobile left panel */
.drawer-brand-row {
  justify-content: space-between;
}
.drawer-close {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  margin-right: -0.5rem;
  cursor: pointer;
  color: color-mix(in oklch, var(--color-base-content) 60%, transparent);
}
.drawer-close:hover {
  color: var(--color-base-content);
}
@media (min-width: 1024px) {
  .drawer-close { display: none; }
}