/* ═══════════════════════════════════════════════
   TREEHOUSE — Design Tokens
   ═══════════════════════════════════════════════ */
:root {
    /* Brand — Logo blue */
    --brand: oklch(0.52 0.20 253);          /* strong blue, matches logo */
    --brand-hover: oklch(0.45 0.20 253);
    --brand-light: oklch(0.92 0.05 253);    /* blue tint for hover states */
    --brand-subtle: oklch(0.96 0.02 253);   /* very light blue tint */

    /* Surfaces — Light mode */
    --bg-primary: oklch(0.97 0.005 250);    /* cool near-white */
    --bg-secondary: oklch(1 0 0);           /* pure white cards */
    --bg-elevated: oklch(0.99 0.003 250);   /* slightly elevated */

    /* Text — Light mode */
    --text-primary: oklch(0.18 0.015 260);  /* deep cool near-black */
    --text-secondary: oklch(0.48 0.012 260);
    --text-tertiary: oklch(0.65 0.008 260);

    /* Borders */
    --border-color: oklch(0.9 0.008 250);
    --border-strong: oklch(0.82 0.01 250);

    /* Shadows */
    --shadow: 0 1px 3px oklch(0.18 0.015 260 / 0.07), 0 1px 2px oklch(0.18 0.015 260 / 0.04);
    --shadow-md: 0 4px 12px oklch(0.18 0.015 260 / 0.09), 0 2px 4px oklch(0.18 0.015 260 / 0.05);
    --shadow-hover: 0 6px 20px oklch(0.18 0.015 260 / 0.13);

    /* Legacy: keep for JS-referenced inline uses */
    --shadow-hover-rgba: rgba(0,0,0,0.13);
    --primary: var(--brand);
    --primary-hover: var(--brand-hover);
    --accent: #f59e0b;
    --accent-light: rgba(245,159,11,0.1);
    --gradient-start: oklch(0.52 0.20 253);
    --gradient-end: oklch(0.45 0.20 253);

    /* Radius */
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;

    /* Header */
    --header-height: 56px;
    --tab-bar-height: 64px;
}

/* Dark mode overrides */
body.dark-mode {
    --bg-primary: oklch(0.13 0.015 253);      /* near-black, blue-tinted */
    --bg-secondary: oklch(0.18 0.015 253);    /* card bg */
    --bg-elevated: oklch(0.22 0.012 253);

    --text-primary: oklch(0.92 0.01 250);
    --text-secondary: oklch(0.64 0.012 250);
    --text-tertiary: oklch(0.50 0.010 250);

    --border-color: oklch(0.28 0.015 253);
    --border-strong: oklch(0.35 0.015 253);

    --shadow: 0 1px 3px oklch(0 0 0 / 0.35), 0 1px 2px oklch(0 0 0 / 0.20);
    --shadow-md: 0 4px 12px oklch(0 0 0 / 0.45);
    --shadow-hover: 0 6px 20px oklch(0 0 0 / 0.55);
    --shadow-hover-rgba: rgba(0,0,0,0.5);

    --brand-light: oklch(0.28 0.08 253);
    --brand-subtle: oklch(0.22 0.04 253);
}

/* ═══════════════════════════════════════════════
   Reset and Base Styles
   ═══════════════════════════════════════════════ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.25s ease, color 0.25s ease;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ═══════════════════════════════════════════════
   Header
   ═══════════════════════════════════════════════ */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-height);
    background: oklch(0.22 0.12 253 / 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid oklch(1 0 0 / 0.10);
    box-shadow: 0 1px 0 oklch(0 0 0 / 0.15);
}

body.dark-mode .header {
    background: oklch(0.16 0.10 253 / 0.97);
    border-bottom-color: oklch(1 0 0 / 0.06);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 16px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.logo-img {
    height: 32px;
    width: 32px;
    border-radius: 8px;
    object-fit: cover;
}

.logo-text {
    font-size: 1.05rem;
    font-weight: 700;
    color: white;
    letter-spacing: -0.01em;
}

/* Hamburger */
.hamburger-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: oklch(1 0 0 / 0.75);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.hamburger-btn:hover {
    background: oklch(1 0 0 / 0.1);
    color: white;
}
.hamburger-btn svg { width: 20px; height: 20px; }

/* Icon buttons in header */
.icon-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: oklch(1 0 0 / 0.7);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.icon-btn:hover { background: oklch(1 0 0 / 0.1); color: white; }
.icon-btn svg { width: 19px; height: 19px; }

/* Avatar button */
.avatar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid oklch(1 0 0 / 0.25);
    background: oklch(1 0 0 / 0.12);
    color: white;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    overflow: hidden;
    padding: 0;
}
.avatar-btn:hover { border-color: var(--brand); background: oklch(1 0 0 / 0.18); }
.avatar-btn svg { width: 20px; height: 20px; }
.header-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Token chip */
.token-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: oklch(1 0 0 / 0.12);
    color: oklch(1 0 0 / 0.85);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    border: 1px solid oklch(1 0 0 / 0.18);
}

.user-email {
    background: oklch(1 0 0 / 0.12);
    color: oklch(1 0 0 / 0.85);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.82rem;
}

/* nav (legacy, hidden buttons) */
.nav { display: flex; align-items: center; gap: 4px; }

/* Legacy - hidden btn refs still in nav */
.header .btn-secondary, .header .btn-icon {
    display: none !important;
}

/* ═══════════════════════════════════════════════
   Side Drawer
   ═══════════════════════════════════════════════ */
.drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: oklch(0 0 0 / 0.45);
    z-index: 200;
    backdrop-filter: blur(2px);
    animation: overlayFadeIn 0.2s ease;
}
.drawer-overlay.open { display: block; }

@keyframes overlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.side-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 272px;
    background: var(--bg-secondary);
    z-index: 201;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px oklch(0 0 0 / 0.18);
    overflow-y: auto;
}
.side-drawer.open { transform: translateX(0); }

body.dark-mode .side-drawer {
    background: var(--bg-secondary);
    box-shadow: 4px 0 24px oklch(0 0 0 / 0.5);
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px 12px;
    border-bottom: 1px solid var(--border-color);
}

.drawer-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}

.drawer-logo-img {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    object-fit: cover;
}

.drawer-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s;
}
.drawer-close:hover { background: var(--bg-primary); color: var(--text-primary); }
.drawer-close svg { width: 18px; height: 18px; }

.drawer-university {
    padding: 8px 16px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.drawer-nav {
    padding: 8px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.drawer-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    border: none;
    background: transparent;
    cursor: pointer;
    width: 100%;
    text-align: left;
    transition: background 0.12s, color 0.12s;
}
.drawer-link svg { width: 17px; height: 17px; flex-shrink: 0; }
.drawer-link:hover { background: var(--bg-primary); color: var(--text-primary); }
.drawer-link--danger { color: #dc2626; }
.drawer-link--danger:hover { background: #fef2f2; color: #b91c1c; }
body.dark-mode .drawer-link--danger:hover { background: oklch(0.25 0.06 20); }

.drawer-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 16px;
}

.drawer-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
}
.drawer-toggle-row span {
    display: flex;
    align-items: center;
    gap: 10px;
}
.drawer-toggle-row svg { width: 17px; height: 17px; }
.drawer-toggle-row input[type=checkbox] { cursor: pointer; }

.drawer-bottom {
    margin-top: auto;
    padding-bottom: 8px;
}

/* ═══════════════════════════════════════════════
   Bottom Tab Bar
   ═══════════════════════════════════════════════ */
.bottom-tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--tab-bar-height);
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: stretch;
    z-index: 90;
    box-shadow: 0 -1px 0 var(--border-color), 0 -4px 12px oklch(0 0 0 / 0.06);
    padding-bottom: env(safe-area-inset-bottom, 0);
}

body.dark-mode .bottom-tab-bar {
    box-shadow: 0 -1px 0 var(--border-color), 0 -4px 12px oklch(0 0 0 / 0.3);
}

.tab-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 6px 4px;
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    position: relative;
    transition: color 0.15s;
}
.tab-btn svg { width: 22px; height: 22px; stroke-width: 1.75; }
.tab-btn:hover { color: var(--text-secondary); }
.tab-btn.active { color: var(--brand); }
.tab-btn.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 2px;
    background: var(--brand);
    border-radius: 0 0 2px 2px;
}

.tab-btn .tab-badge {
    position: absolute;
    top: 4px;
    right: calc(50% - 18px);
    min-width: 16px;
    height: 16px;
    background: #dc2626;
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
}

/* ═══════════════════════════════════════════════
   Layout
   ═══════════════════════════════════════════════ */

/* Main Content */
.main {
    min-height: calc(100vh - var(--header-height));
    padding: 0;
}

/* When tab bar is visible, push content up */
body.has-tab-bar .main {
    padding-bottom: var(--tab-bar-height);
}
body.has-tab-bar footer.footer {
    display: none;
}

.screen {
    animation: fadeIn 0.3s ease-in;
}

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

/* ═══════════════════════════════════════════════
   Guest Hero (login / signup screens)
   ═══════════════════════════════════════════════ */
#loginScreen, #signupScreen, #forgotPasswordScreen, #resetPasswordScreen,
#alumniTransitionScreen, #alumniConfirmScreen, #verifyEmailScreen,
#verificationUploadScreen {
    min-height: calc(100vh - var(--header-height));
    background: linear-gradient(160deg, oklch(0.22 0.14 253) 0%, oklch(0.16 0.10 265) 50%, oklch(0.12 0.06 280) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px 40px;
}

.login-card {
    width: 100%;
    max-width: 440px;
    background: oklch(1 0 0 / 0.97);
    padding: 2rem 2rem 2rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 40px oklch(0 0 0 / 0.35);
}

body.dark-mode .login-card {
    background: oklch(0.19 0.012 155 / 0.98);
    box-shadow: 0 8px 40px oklch(0 0 0 / 0.6);
}

.login-card h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
    letter-spacing: -0.01em;
}

/* showScreen() sets this screen's display to 'block' inline, which beats the
   shared flex-centering rule for guest-hero screens (inline style wins over
   stylesheet). Center the card itself instead, with a margin auto, since
   that works regardless of the parent's display value. */
#verificationUploadScreen .login-card {
    margin: 0 auto;
}
#verificationUploadScreen .login-card h2,
#verificationUploadScreen .subtitle {
    text-align: center;
}

.subtitle {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

@media (max-width: 480px) {
    .login-card {
        padding: 1.5rem 1.25rem;
        border-radius: var(--radius);
    }
}

.test-accounts {
    margin-top: 2rem;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: 8px;
    font-size: 0.9rem;
}

.test-accounts ul {
    margin-top: 0.5rem;
    margin-left: 1.5rem;
}

.test-accounts li {
    margin: 0.3rem 0;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.form-control:focus {
    outline: none;
    border-color: var(--gradient-start);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

input[type="file"].form-control {
    padding: 0.5rem;
}

/* ═══════════════════════════════════════════════
   Buttons
   ═══════════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
    white-space: nowrap;
    text-decoration: none;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
    background: var(--brand);
    color: white;
}

.btn-primary:hover {
    background: var(--brand-hover);
    box-shadow: 0 4px 12px oklch(0.52 0.20 253 / 0.35);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1.5px solid var(--border-color);
}

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

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.modules-panel-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.modules-panel-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* Module List */
.module-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

/* Activity badge on module cards */
.activity-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.18rem 0.5rem;
    border-radius: 20px;
    /* In flex column cards (browser), badge sits at start; in block cards it floats right */
    align-self: flex-start;
    margin-bottom: 0.25rem;
}
.activity-none {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #e5e7eb;
}
.activity-quiet {
    background: #fef9c3;
    color: #854d0e;
    border: 1px solid #fde68a;
}
.activity-active {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

body.dark-mode .activity-none {
    background: var(--bg-primary);
    color: var(--text-secondary);
    border-color: var(--border-color);
}

body.dark-mode .activity-quiet {
    background: rgba(133, 77, 14, 0.2);
    color: #fbbf24;
    border-color: rgba(133, 77, 14, 0.4);
}

body.dark-mode .activity-active {
    background: rgba(22, 101, 52, 0.2);
    color: #68d391;
    border-color: rgba(22, 101, 52, 0.4);
}

/* Suggested modules section */
.suggested-modules-section {
    margin-top: 2rem;
}
.suggested-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}
.suggested-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}
.suggested-card {
    border: 2px dashed #c7d2fe;
    opacity: 0.9;
}
.suggested-card:hover {
    border-color: #111827;
    opacity: 1;
}

/* Optional label in forms */
.optional-label {
    font-size: 0.8rem;
    font-weight: normal;
    color: var(--text-secondary, #888);
    margin-left: 0.25rem;
}

.module-card {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px var(--shadow);
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

/* In non-flex module cards, position badge top-right */
.module-card > .activity-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.module-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px var(--shadow-hover);
}

.module-card h3 {
    color: var(--gradient-start);
    margin-bottom: 0.5rem;
}

.module-card .module-code {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Forum Header */
.forum-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* ── Forum Tabs ─────────────────────────────────────────────── */
.forum-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0;
}

.forum-tab {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 0.5rem 1.1rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
    border-radius: 0;
}
.forum-tab:hover { color: var(--text-primary); }
.forum-tab.active {
    color: var(--text-primary);
    border-bottom-color: var(--accent);
}

/* ── Flashcard Lock Screen ───────────────────────────────────────────────── */
.fc-lock-screen {
    padding: 1.5rem 0 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.fc-lock-hero { text-align: center; padding: 0.5rem 0 0.25rem; }
.fc-lock-icon  { font-size: 2.5rem; margin-bottom: 0.5rem; }
.fc-lock-title { font-size: 1.35rem; font-weight: 700; margin: 0 0 0.4rem; }
.fc-lock-sub   { font-size: 0.9rem; color: var(--text-secondary); margin: 0; }

.fc-unlock-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.1rem 1.25rem;
}
.fc-unlock-card-header { display: flex; gap: 0.85rem; align-items: flex-start; margin-bottom: 0.85rem; }
.fc-unlock-icon { font-size: 1.6rem; flex-shrink: 0; margin-top: 2px; }
.fc-unlock-card-header strong { display: block; margin-bottom: 0.2rem; font-size: 0.95rem; }
.fc-unlock-card-header p { margin: 0; font-size: 0.83rem; color: var(--text-secondary); line-height: 1.5; }

.fc-ref-progress-wrap { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }
.fc-ref-progress-bar { flex: 1; height: 8px; background: var(--border-color); border-radius: 4px; overflow: hidden; }
.fc-ref-progress-fill {
    height: 100%;
    background: #f59e0b;
    border-radius: 4px;
    transition: width 0.4s ease;
    min-width: 4px;
}
.fc-ref-progress-label { font-size: 0.8rem; color: var(--text-secondary); white-space: nowrap; }
.fc-ref-link-row { display: flex; gap: 0.5rem; align-items: center; }
.fc-ref-link-input { flex: 1; font-size: 0.78rem; padding: 0.45rem 0.7rem; cursor: text; user-select: all; }

.fc-bundle-card { border-color: #e5e7eb; }
.fc-bundle-price-row { display: flex; align-items: baseline; gap: 0.5rem; margin-bottom: 0.85rem; }
.fc-bundle-price  { font-size: 1.6rem; font-weight: 800; color: var(--accent); }
.fc-bundle-period { font-size: 0.8rem; color: var(--text-secondary); }
.fc-bundle-btn {
    background: #111827;
    letter-spacing: .01em;
    color: #fff; border: none;
    display: flex; align-items: center; gap: 0.5rem;
    font-weight: 600; padding: 0.6rem 1.2rem; border-radius: 10px;
    cursor: pointer; transition: opacity 0.2s;
}
.fc-bundle-btn:hover { opacity: 0.88; }
.fc-coming-soon-pill {
    font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
    background: rgba(255,255,255,0.22); border-radius: 999px; padding: 2px 8px;
}
.fc-contribute-nudge {
    display: flex; gap: 0.85rem; align-items: center;
    background: var(--bg-secondary); border: 1px dashed var(--border-color);
    border-radius: 12px; padding: 0.9rem 1.1rem;
}
.fc-contribute-icon { font-size: 1.5rem; flex-shrink: 0; }
.fc-contribute-nudge div { flex: 1; }
.fc-contribute-nudge strong { display: block; font-size: 0.88rem; margin-bottom: 0.2rem; }
.fc-contribute-nudge p { margin: 0; font-size: 0.8rem; color: var(--text-secondary); }

/* ── Flashcard Preview (lock screen) ────────────────────────────────────── */
.fc-preview-header {
    font-size: 0.8rem; color: var(--text-secondary); font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.06em;
    margin-bottom: 0.6rem;
}
.fc-preview-cards { display: flex; flex-direction: column; gap: 0.5rem; }
.fc-preview-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.75rem 1rem;
}
.fc-preview-q { font-size: 0.85rem; margin-bottom: 0.35rem; }
.fc-preview-blur {
    font-size: 0.78rem; color: var(--text-secondary);
    font-style: italic;
}

/* ── Badge Toasts ────────────────────────────────────────────────────────── */
.badge-toast-container {
    position: fixed; bottom: 5rem; left: 50%; transform: translateX(-50%);
    z-index: 2000; display: flex; flex-direction: column; gap: 0.5rem;
    pointer-events: none; align-items: center;
}
.badge-toast {
    display: flex; align-items: center; gap: 0.75rem;
    background: var(--bg-secondary); border: 1px solid var(--border-color);
    border-radius: 12px; padding: 0.75rem 1.1rem;
    box-shadow: 0 4px 20px var(--shadow);
    opacity: 0; transform: translateY(12px);
    transition: opacity 0.35s ease, transform 0.35s ease;
    min-width: 240px; max-width: 320px;
}
.badge-toast-visible { opacity: 1; transform: translateY(0); }
.badge-toast-icon  { font-size: 1.8rem; flex-shrink: 0; }
.badge-toast-title { font-size: 0.85rem; font-weight: 700; color: var(--text-primary); }
.badge-toast-desc  { font-size: 0.78rem; color: var(--text-secondary); margin-top: 1px; }

/* ── Profile Badges ──────────────────────────────────────────────────────── */
.profile-badges-section { margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid var(--border-color); }
.profile-badges-title { font-size: 0.95rem; font-weight: 700; margin: 0 0 0.9rem; }
.profile-badges-grid { display: flex; flex-wrap: wrap; gap: 0.65rem; }
.profile-badges-empty { font-size: 0.85rem; color: var(--text-secondary); margin: 0; }
.profile-badge-card {
    display: flex; flex-direction: column; align-items: center;
    background: var(--bg-primary); border: 1px solid var(--border-color);
    border-radius: 12px; padding: 0.75rem 0.9rem; min-width: 80px; cursor: default;
    transition: border-color 0.2s, transform 0.15s;
}
.profile-badge-card:hover { border-color: var(--primary-color, #111827); transform: translateY(-2px); }
.profile-badge-emoji  { font-size: 1.8rem; margin-bottom: 0.3rem; }
.profile-badge-label  { font-size: 0.72rem; font-weight: 700; text-align: center; }
.profile-badge-module { font-size: 0.65rem; color: var(--text-secondary); margin-top: 2px; }

/* ── Alumni Coming Soon ──────────────────────────────────────── */
.alumni-coming-soon {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 3rem 1rem 2.5rem;
}

.alumni-cs-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    line-height: 1;
}

.alumni-cs-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0 0 0.6rem;
    color: var(--text-primary);
}

.alumni-cs-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    max-width: 460px;
    line-height: 1.6;
    margin: 0 0 2rem;
}

.alumni-cs-features {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 480px;
    margin-bottom: 2rem;
}

.alumni-cs-feature {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.9rem 1.1rem;
    text-align: left;
}

.alumni-cs-feature-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.alumni-cs-feature strong {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
    color: var(--text-primary);
}

.alumni-cs-feature p {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.alumni-cs-badge {
    display: inline-block;
    background: #111827;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.4rem 1.1rem;
    border-radius: 999px;
}

/* ── Flashcards ─────────────────────────────────────────────── */
.flashcards-panel {
    padding: 1rem 0;
}

.flashcards-empty-msg {
    text-align: center;
    color: var(--text-secondary);
    padding: 3rem 1rem;
}

.flashcard-progress {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.flashcard-phase-label {
    text-align: center;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--primary-color, #111827);
    margin-bottom: 0.75rem;
    letter-spacing: 0.03em;
}

.flashcard-progress-bar {
    flex: 1;
    height: 5px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
}

.flashcard-progress-fill {
    height: 100%;
    background: var(--primary-color, #111827);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* 3-D flip card */
.flashcard-stage {
    perspective: 1000px;
    cursor: pointer;
    margin-bottom: 1.5rem;
}

.flashcard {
    position: relative;
    min-height: 220px;
    transform-style: preserve-3d;
    transition: transform 0.45s ease;
    border-radius: 16px;
}

.flashcard.flipped { transform: rotateY(180deg); }

.flashcard-front,
.flashcard-back {
    position: absolute;
    top: 0; left: 0; right: 0;
    min-height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 16px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    box-shadow: 0 4px 20px var(--shadow);
    overflow-y: auto;
    box-sizing: border-box;
}

.flashcard-front {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
}

.flashcard-back {
    background: #1e293b;
    transform: rotateY(180deg);
}

/*
 * IMPORTANT: Anki exports embed inline color styles (e.g. style="color:#000").
 * !important on every descendant is the only way to override those.
 * Light mode → dark text on white card.
 * Dark mode  → light text on dark card.
 * Back       → always light text (fixed dark background).
 */
.flashcard-front,
.flashcard-front * {
    color: #1f2937 !important;
}
body.dark-mode .flashcard-front,
body.dark-mode .flashcard-front * {
    color: #e2e8f0 !important;
}
.flashcard-back,
.flashcard-back * {
    color: #f1f5f9 !important;
}

.flashcard-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.6;
    margin-bottom: 0.75rem;
}

.flashcard-front p,
.flashcard-back p {
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
}

/* Rich HTML content rendered inside cards */
.flashcard-front ul, .flashcard-back ul,
.flashcard-front ol, .flashcard-back ol {
    text-align: left;
    margin: 0.5rem 0;
    padding-left: 1.4rem;
}
.flashcard-front li, .flashcard-back li { margin-bottom: 0.25rem; }
.flashcard-front table, .flashcard-back table {
    border-collapse: collapse;
    font-size: 0.85rem;
    margin: 0.5rem auto;
    text-align: left;
}
.flashcard-front td, .flashcard-front th {
    border: 1px solid var(--border-color);
    padding: 0.3rem 0.5rem;
}
.flashcard-front th, .flashcard-back th { font-weight: 700; }
.flashcard-back td, .flashcard-back th {
    border: 1px solid rgba(255,255,255,0.18);
    padding: 0.3rem 0.5rem;
}

/* Cloze deletions — needs !important to beat inline Anki styles */
.flashcard-front .cloze {
    font-weight: 700 !important;
    /* colour already covered by .flashcard-front * rule above */
}
body.dark-mode .flashcard-front .cloze {
    color: #f59e0b !important;   /* amber stands out on dark bg */
}
.flashcard-back .cloze {
    background: rgba(255,255,255,0.18) !important;
    border-radius: 4px;
    padding: 0 4px;
    font-weight: 700 !important;
}
.flashcard-back .cloze-inactive { opacity: 0.6; }

.flashcard-hint {
    font-size: 0.75rem;
    opacity: 0.45;
    margin-top: 1rem;
}

.flashcard-nav {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.flashcard-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.flashcard-tick {
    background: #38a169;
    color: #fff;
    border: none;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0.6rem 1.4rem;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
}
.flashcard-tick:hover { background: #2f855a; }

.flashcard-cross {
    background: #e53e3e;
    color: #fff;
    border: none;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0.6rem 1.4rem;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
}
.flashcard-cross:hover { background: #c53030; }

.flashcard-report-btn {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    font-size: 0.82rem;
    padding: 0.5rem 0.9rem;
    border-radius: 8px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}
.flashcard-report-btn:hover { color: #e53e3e; border-color: #e53e3e; }

/* ── Flashcard Toolbar ───────────────────────────────────────────────────── */
.flashcard-toolbar {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-bottom: 0.75rem;
}

/* Contributor credit on answer face */
.flashcard-contributor {
    display: none;
    font-size: 0.7rem;
    opacity: 0.55;
    margin-top: auto;
    padding-top: 0.75rem;
    letter-spacing: 0.02em;
}

/* ── Anki-style add/edit form ────────────────────────────────────────────── */
.fc-form-sides {
    display: flex;
    gap: 0;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.fc-form-side {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.fc-form-side-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    padding: 0.6rem 0.85rem 0.3rem;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}

.fc-form-front .fc-form-side-label { color: var(--accent); }
.fc-form-back .fc-form-side-label  { color: #111827; }

.fc-form-textarea {
    border: none !important;
    border-radius: 0 !important;
    resize: none;
    font-size: 0.92rem;
    background: var(--bg-secondary);
    padding: 0.75rem 0.85rem;
    outline: none !important;
    box-shadow: none !important;
    flex: 1;
}
.fc-form-textarea:focus { background: var(--bg-secondary); }

.fc-form-divider {
    width: 1px;
    background: var(--border-color);
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .fc-form-sides { flex-direction: column; }
    .fc-form-divider { width: auto; height: 1px; }
}

/* ── Flashcard Edit Mode ─────────────────────────────────────────────────── */

.flashcards-edit-panel {
    padding-bottom: 1rem;
}

.flashcards-edit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.flashcards-edit-header h3 {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.flashcards-edit-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.fc-edit-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.75rem;
}

.fc-edit-num {
    min-width: 1.6rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-secondary);
    padding-top: 2px;
    text-align: right;
}

.fc-edit-content {
    flex: 1;
    min-width: 0;
}

.fc-edit-q {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
    /* Clamp to 2 lines for the list view */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fc-edit-a {
    font-size: 0.82rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fc-edit-actions {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex-shrink: 0;
}

.fc-delete-btn {
    color: #e53e3e;
    border: 1px solid #e53e3e;
    background: transparent;
}
.fc-delete-btn:hover { background: #fff5f5; }

.fc-edit-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.35rem; }
.fc-tag {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    background: var(--primary-color);
    color: #fff;
    opacity: 0.85;
}

@media (max-width: 600px) {
    .fc-edit-row { flex-wrap: wrap; }
    .fc-edit-actions { flex-direction: row; width: 100%; }
}

.flashcards-done {
    text-align: center;
    padding: 3rem 1rem;
}
.flashcards-done-icon { font-size: 3rem; margin-bottom: 0.75rem; }
.flashcards-done h3 { margin: 0 0 0.5rem; font-size: 1.4rem; }
.flashcards-done p { color: var(--text-secondary); margin-bottom: 1.5rem; }

.modal-sm { max-width: 420px; }
.modal-subtext { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 1rem; }
.modal-actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1rem; }
.btn-danger { background: #e53e3e; color: #fff; border: none; }
.btn-danger:hover { background: #c53030; }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.8rem; }

@media (max-width: 600px) {
    .flashcard { min-height: 180px; }
    .flashcard-front, .flashcard-back { padding: 1.25rem; }
    .flashcard-front p, .flashcard-back p { font-size: 0.9rem; }
    .flashcard-actions { gap: 0.5rem; }
    .flashcard-tick, .flashcard-cross { padding: 0.55rem 1rem; font-size: 0.88rem; }
}

.forum-header h2 {
    color: var(--text-primary);
}

.module-code {
    color: var(--gradient-start);
    font-weight: 600;
}

/* Search Bar */
.search-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.search-bar .form-control {
    flex: 1;
}

/* Composer Guidelines */
.composer-guidelines {
    background: linear-gradient(135deg, #11182715 0%, #11182715 100%);
    border-left: 4px solid #111827;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Create Post Form */
.create-post-form {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px var(--shadow);
    margin-bottom: 0;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

/* Posts List */
.posts-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.post-card {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px var(--shadow);
    transition: all 0.3s;
    position: relative;
    cursor: pointer;
}

.post-card:hover {
    box-shadow: 0 4px 15px var(--shadow-hover);
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.post-title {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    flex: 1;
}

.post-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.post-author {
    font-weight: 500;
}

.post-date {
    color: var(--text-tertiary);
}

.post-body {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.post-body.truncated {
    max-height: 3.6em;
    overflow: hidden;
    position: relative;
}

.post-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.badge-question {
    background: #e7f3ff;
    color: #0066cc;
}

.badge-attachment {
    background: #fff3e0;
    color: #c45e00;
}

.badge-link {
    background: #e8f5e9;
    color: #276727;
}

body.dark-mode .badge-question {
    background: rgba(0, 102, 204, 0.2);
    color: #60a5fa;
}

body.dark-mode .badge-attachment {
    background: rgba(196, 94, 0, 0.2);
    color: #fbbf24;
}

body.dark-mode .badge-link {
    background: rgba(39, 103, 39, 0.2);
    color: #68d391;
}

/* Verification Tick */
.verification-tick {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
}

.tick-grey {
    background: #808080;
    color: white;
}

.tick-blue {
    background: #1DA1F2;
    color: white;
    box-shadow: 0 2px 8px rgba(29, 161, 242, 0.4);
}

/* Post Actions */
.post-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.post-actions .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-verify {
    background: #28a745;
    color: white;
}

.btn-verify:hover {
    background: #218838;
}

.btn-report {
    background: #ffc107;
    color: #333;
}

.btn-report:hover {
    background: #e0a800;
}

.btn-bookmark {
    background: #17a2b8;
    color: white;
}

.btn-bookmark:hover {
    background: #138496;
}

.btn-bookmarked {
    background: #0056b3;
}

/* Modal */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
}

.modal-content {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 12px;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    width: 90%;
    position: relative;
    animation: slideUp 0.3s;
}

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

.close, .close-settings {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-tertiary);
    cursor: pointer;
    line-height: 1;
}

.close:hover, .close-settings:hover {
    color: var(--text-primary);
}

.post-detail-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.post-detail-title {
    font-size: 1.8rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.post-detail-body {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.post-attachments {
    margin: 1.5rem 0;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--bg-primary);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.attachment-item a {
    color: var(--text-primary);
    text-decoration: none;
    flex: 1;
}

.attachment-item a:hover {
    text-decoration: underline;
}

.post-links {
    margin: 1.5rem 0;
}

.link-item {
    display: block;
    padding: 0.75rem;
    background: var(--bg-primary);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    text-decoration: none;
}

.link-item:hover {
    background: var(--border-color);
}

/* Loading */
.loading {
    text-align: center;
    padding: 3rem;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #111827;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Adaptive hint text and links */
.hint-text {
    color: var(--text-secondary);
}

.link-primary {
    color: #0057a8;
    text-decoration: none;
}

body.dark-mode .link-primary {
    color: #60a5fa;
}

.link-primary:hover {
    text-decoration: underline;
}

/* Error Messages */
.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 0.75rem;
    border-radius: 8px;
    margin-top: 1rem;
    border: 1px solid #f5c6cb;
}

body.dark-mode .error-message {
    background: rgba(220, 53, 69, 0.15);
    color: #f87171;
    border-color: rgba(220, 53, 69, 0.4);
}

.success-message {
    background: #d4edda;
    color: #155724;
    padding: 0.75rem;
    border-radius: 8px;
    margin-top: 1rem;
    border: 1px solid #c3e6cb;
}

body.dark-mode .success-message {
    background: rgba(40, 167, 69, 0.15);
    color: #68d391;
    border-color: rgba(40, 167, 69, 0.4);
}

/* Footer */
.footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 3rem;
}

/* verification-tick static on mobile (merged into main responsive block below) */

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* Settings Button */
.btn-icon {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: white;
    padding: 0.5rem;
    transition: transform 0.2s;
}

.btn-icon:hover {
    transform: scale(1.1);
}

/* Settings Modal */
.settings-modal {
    max-width: 600px;
}

.settings-section {
    margin-bottom: 2rem;
}

.settings-section h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.settings-section label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.settings-section .form-control {
    margin-bottom: 1rem;
}

/* ============================================
   PILOT: Lecturer & Helper Dashboard Styles
   ============================================ */

.lecturer-question-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px var(--shadow);
    border-left: 4px solid #111827;
}

.lecturer-question-card h3 {
    margin-top: 0;
    color: var(--text-primary);
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.responses-section {
    margin-top: 2rem;
}

.responses-section h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.responses-filter {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-small.active {
    background: #111827;
    color: white;
}

.response-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.response-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-hover);
}

.response-card.top-response {
    border-left: 4px solid #fbbf24;
    background: linear-gradient(to right, rgba(251, 191, 36, 0.1), transparent);
}

.response-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.response-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.response-author strong {
    color: var(--text-primary);
}

.reputation-badge {
    background: #111827;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.top-badge {
    background: #fbbf24;
    color: #1f2937;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.response-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.response-body {
    margin: 1rem 0;
    color: var(--text-primary);
    line-height: 1.6;
}

.helper-rating-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.stars {
    color: #fbbf24;
    font-size: 1rem;
}

.helper-instructions {
    background: #dbeafe;
    border-left: 4px solid #3b82f6;
    padding: 1rem;
    margin-bottom: 2rem;
    border-radius: 8px;
}

body.dark-mode .helper-instructions {
    background: rgba(59, 130, 246, 0.1);
    border-left-color: #60a5fa;
}

.helper-instructions p {
    margin: 0;
    color: var(--text-primary);
}

.rating-widget {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: 8px;
}

.rating-stars {
    display: flex;
    gap: 0.25rem;
}

.star-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #9ca3af;
    transition: color 0.2s, transform 0.2s;
}

.star-btn:hover {
    transform: scale(1.2);
}

.star-btn.filled {
    color: #fbbf24;
}

.rating-widget input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.rating-widget button[type="submit"] {
    padding: 0.5rem 1rem;
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
    cursor: pointer;
}

/* ============================================
   Module Browser Styles
   ============================================ */

.screen-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.screen-header h2 {
    margin: 0;
    flex: 1;
}

.module-screen-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.module-screen-header h2 {
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.module-browser-controls {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px var(--shadow);
}

.search-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.search-row input {
    flex: 2;
    min-width: 200px;
}

.search-row select {
    flex: 1;
    min-width: 150px;
}

.module-browser-stats {
    margin-top: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.module-browser-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.browser-module-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 2px 8px var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.browser-module-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-hover);
}

.browser-module-card.enrolled {
    border-left: 4px solid #10b981;
}

.browser-module-card h4 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.4;
}

.browser-module-card .module-code {
    color: #111827;
    font-weight: 600;
    font-size: 0.9rem;
}

.browser-module-card .module-department {
    color: var(--text-tertiary);
    font-size: 0.85rem;
}

.browser-module-card .module-actions {
    margin-top: auto;
    padding-top: 0.75rem;
    display: flex;
    gap: 0.5rem;
}

.btn-view {
    background: #111827;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: transform 0.2s, box-shadow 0.2s;
    flex: 1;
}

.btn-view:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(17,24,39,0.25);
}

.btn-add {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.btn-add:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

.btn-remove {
    background: var(--bg-primary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s;
    white-space: nowrap;
}

.btn-remove:hover {
    background: #fee2e2;
    color: #dc2626;
    border-color: #dc2626;
}

.catalogue-link {
    display: block;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.catalogue-link:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

.browser-info-box {
    background: #dbeafe;
    border-left: 4px solid #3b82f6;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
}

body.dark-mode .browser-info-box {
    background: rgba(59, 130, 246, 0.1);
    border-left-color: #60a5fa;
}

.browser-info-box p {
    margin: 0;
    color: var(--text-primary);
    font-size: 0.95rem;
}

/* Read-only banner for module forums */
.read-only-banner {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
}

body.dark-mode .read-only-banner {
    background: rgba(245, 158, 11, 0.15);
    border-left-color: #fbbf24;
}

.read-only-banner p {
    margin: 0;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.read-only-banner a {
    color: #d97706;
    font-weight: 600;
    text-decoration: underline;
}

.read-only-banner a:hover {
    color: #b45309;
}

.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: 0 2px 8px var(--shadow);
}

#pageInfo {
    color: var(--text-secondary);
    min-width: 100px;
    text-align: center;
}

/* Delete button for posts */
.btn-delete {
    background: transparent;
    color: #dc2626;
    border: 1px solid #dc2626;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.btn-delete:hover {
    background: #dc2626;
    color: white;
}

/* Module card actions in My Modules */
.module-card-actions {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.module-card-actions .btn-small {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
}

/* Empty modules message */
.empty-modules-message {
    text-align: center;
    padding: 3rem 1.5rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    color: var(--text-secondary);
}

.empty-modules-message p {
    margin: 0.5rem 0;
}

.empty-modules-message strong {
    color: var(--text-primary);
}

/* ============================================
   Pinned Post Styles
   ============================================ */

.post-pinned {
    border: 2px solid #f59e0b;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.05) 0%, var(--bg-secondary) 100%);
}

body.dark-mode .post-pinned {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, var(--bg-secondary) 100%);
}

.badge-pinned {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

/* Pin/Unpin buttons */
.btn-pin {
    background: transparent;
    color: #f59e0b;
    border: 1px solid #f59e0b;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.btn-pin:hover {
    background: #f59e0b;
    color: white;
}

.btn-unpin {
    background: #f59e0b;
    color: white;
    border: 1px solid #f59e0b;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.btn-unpin:hover {
    background: #d97706;
    border-color: #d97706;
}

/* ============================================
   Author Badge Styles
   ============================================ */

.author-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.author-academic {
    background: #1d4ed8;
    color: white;
}

.author-admin {
    background: #dc2626;
    color: white;
}

.author-verified {
    background: #059669;
    color: white;
}

.author-tokens {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 0.5rem;
    background: var(--bg-primary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

/* ============================================
   Role Badge in Header
   ============================================ */

.role-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 0.75rem;
}

.role-student {
    background: #dbeafe;
    color: #1d4ed8;
}

.role-academic {
    background: #ede9fe;
    color: #7c3aed;
}

.role-admin {
    background: #fee2e2;
    color: #dc2626;
}

body.dark-mode .role-student {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

body.dark-mode .role-academic {
    background: rgba(124, 58, 237, 0.2);
    color: #a78bfa;
}

body.dark-mode .role-admin {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

/* ============================================
   Profile & Leaderboard Styles
   ============================================ */

.profile-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px var(--shadow);
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #111827;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    font-weight: bold;
}

.profile-info h2 {
    margin: 0 0 0.25rem 0;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-box {
    background: var(--bg-primary);
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.leaderboard-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table th,
.leaderboard-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.leaderboard-table th {
    background: var(--bg-primary);
    font-weight: 600;
}

.leaderboard-table tr:hover {
    background: var(--bg-primary);
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-weight: bold;
}

.rank-1 { background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%); color: white; }
.rank-2 { background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%); color: white; }
.rank-3 { background: linear-gradient(135deg, #d97706 0%, #92400e 100%); color: white; }

/* Radio Group for Signup Form */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.875rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: border-color 0.2s, background 0.2s;
}

.radio-option:hover {
    border-color: #111827;
    background: var(--bg-primary);
}

.radio-option-disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}
.radio-option-disabled:hover {
    border-color: #ddd;
    background: transparent;
}

.coming-soon-badge {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: var(--border-color, #e2e8f0);
    color: var(--text-secondary);
    border-radius: 4px;
    padding: 1px 6px;
    margin-left: 0.25rem;
}

.radio-option input[type="radio"] {
    accent-color: #111827;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.radio-option input[type="radio"]:checked + span,
.radio-option:has(input[type="radio"]:checked) {
    border-color: #111827;
    background: var(--bg-primary);
    font-weight: 500;
}

/* Profile Photo */
.profile-avatar-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.profile-avatar-img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #111827;
}

.change-photo-btn {
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
}

/* Leaderboard avatars */
.lb-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
}
.lb-avatar-img {
    object-fit: cover;
    border: 2px solid #111827;
}
.lb-avatar-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #111827;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
}
.lb-name-cell {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
.lb-name-cell:hover .lb-name-text {
    text-decoration: underline;
    color: var(--text-primary);
}
.lb-clickable-row {
    cursor: pointer;
    transition: background 0.12s;
}
.lb-clickable-row:hover {
    background: rgba(102, 126, 234, 0.07);
}

/* User Profile Modal */
/* View profile screen read-only text */
.view-profile-text {
    margin: 0;
    color: var(--text-secondary, #555);
    font-size: 0.95rem;
    line-height: 1.5;
}

.view-profile-modules {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.view-profile-module-tag {
    display: inline-block;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.view-profile-module-tag:hover {
    background: var(--primary-color, #111827);
    border-color: var(--primary-color, #111827);
    color: #fff;
}

/* Find People screen */
.people-results {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}
.people-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--card-bg, #fff);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    cursor: pointer;
    transition: box-shadow 0.15s;
}
.people-card:hover {
    box-shadow: 0 4px 16px rgba(102,126,234,0.18);
}
.people-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    flex-shrink: 0;
}
.people-avatar-img {
    object-fit: cover;
    border: 2px solid #111827;
}
.people-avatar-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #111827;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
}
.people-card-info {
    flex: 1;
    min-width: 0;
}
.people-card-name {
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.people-card-badges {
    margin-top: 0.2rem;
}
.people-card-meta {
    font-size: 0.82rem;
    color: var(--text-secondary, #666);
    margin-top: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.no-results-msg {
    text-align: center;
    color: var(--text-secondary, #777);
    padding: 2rem 0;
}

/* Clickable post authors */
.clickable-author {
    cursor: pointer;
}
.clickable-author:hover {
    text-decoration: underline;
    color: #111827;
}

/* Search loading + empty states */
.search-loading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 2rem;
    justify-content: center;
    color: var(--text-secondary, #666);
}
.loading-spinner-sm {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-top-color: #111827;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.no-results-state {
    text-align: center;
    padding: 2rem 1rem;
}
.no-results-hint {
    font-size: 0.85rem;
    color: var(--text-secondary, #999);
    margin-top: 0.25rem;
}

/* People card email line */
.people-card-email {
    font-size: 0.82rem;
    color: var(--text-secondary, #777);
    margin-top: 0.1rem;
}
.people-view-btn {
    flex-shrink: 0;
    white-space: nowrap;
}

/* View profile masked email + badge row */
.view-profile-email {
    font-size: 0.85rem;
    color: var(--text-secondary, #777);
    margin: 0.2rem 0 0.4rem;
}
.view-profile-badge-row {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    align-items: center;
}

/* Profile photo lightbox */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    cursor: zoom-out;
}
.lightbox-img {
    max-width: min(94vw, 1100px);
    max-height: 90vh;
    width: auto;
    height: auto;
    border-radius: 8px;
    object-fit: contain;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
    cursor: default;
}
/* Profile-avatar zoom keeps the circular crop; everything else (campus feed, posts) shows the full image */
.lightbox-img--circle {
    max-width: min(90vw, 480px);
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    object-fit: cover;
}
.lightbox-close {
    position: absolute;
    top: 1.25rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.15s;
    z-index: 1;
}
.lightbox-close:hover { opacity: 1; }

.lightbox-nav {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    pointer-events: none;
}
.lightbox-arrow {
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: pointer;
    transition: background 0.15s;
}
.lightbox-arrow:hover { background: rgba(255, 255, 255, 0.25); }
.lightbox-arrow svg { width: 24px; height: 24px; }

.lightbox-counter {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 14px;
}

/* Make profile photo imgs show a zoom cursor */
img.profile-avatar-img,
img.lb-avatar-img,
img.people-avatar-img {
    cursor: zoom-in;
}

/* Anonymous posting */
.anon-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    background: var(--bg-primary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.1rem 0.4rem;
    margin-left: 0.3rem;
    vertical-align: middle;
    letter-spacing: 0.02em;
}
.anon-author {
    color: var(--text-secondary, #777);
    font-style: italic;
}
.anonymous-label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    cursor: pointer;
}
.anonymous-label input[type="checkbox"] {
    margin-top: 0.2rem;
    flex-shrink: 0;
    accent-color: #111827;
}
.anon-hint {
    font-size: 0.82rem;
    color: var(--text-secondary, #777);
    font-weight: normal;
}

/* Contact Us screen */
.contact-us-content {
    max-width: 640px;
    margin: 2rem auto;
    padding: 0 1rem;
}
.contact-card {
    background: var(--bg-secondary, #fff);
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(102,126,234,0.10);
    padding: 2.5rem 2rem;
    text-align: center;
}
.contact-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}
.contact-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary, #1a1a2e);
}
.contact-card p {
    color: var(--text-secondary, #666);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}
.contact-email-btn {
    display: inline-block;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 10px;
    text-decoration: none;
    word-break: break-all;
}
.contact-note {
    font-size: 0.85rem;
    color: var(--text-secondary, #999);
    margin-top: 1rem;
    margin-bottom: 0;
}
.contact-divider {
    border: none;
    border-top: 1px solid var(--border, #e5e7eb);
    margin: 1.5rem 0;
}
.contact-card h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary, #1a1a2e);
}
.contact-list {
    text-align: left;
    list-style: none;
    padding: 0;
    margin: 0;
}
.contact-list li {
    padding: 0.4rem 0 0.4rem 1.5rem;
    position: relative;
    color: var(--text-secondary, #666);
    font-size: 0.95rem;
    line-height: 1.5;
}
.contact-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #111827;
    font-weight: bold;
}

/* ============================================================
   MOBILE RESPONSIVE (comprehensive)
   ============================================================ */
@media (max-width: 768px) {
    /* Header: stack logo + nav vertically */
    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 0.75rem 0;
    }

    /* Nav wraps — Contact + Logout sit on next line if needed */
    .nav {
        flex-wrap: wrap;
        gap: 0.5rem;
        width: 100%;
    }

    /* Shrink token badges on mobile */
    .user-tokens {
        flex-wrap: wrap;
    }

    .user-email {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
        word-break: break-all;
    }

    .logo-text {
        font-size: 1.4rem;
    }

    .logo-img {
        height: 38px;
    }

    /* My Modules page action buttons: wrap naturally */
    .header-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    /* Auth card */
    .login-card {
        margin: 1rem auto;
        padding: 1.5rem 1rem;
    }

    /* All screen headers (back + title rows) */
    .screen-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    /* Module grid → single column */
    .module-list {
        grid-template-columns: 1fr;
    }

    /* Forum / module screen header */
    .forum-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .module-screen-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }

    .module-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .module-actions .btn {
        flex: 1 1 auto;
        min-width: 100px;
        text-align: center;
    }

    /* Verification tick: no absolute positioning on mobile */
    .verification-tick {
        position: static;
        margin-bottom: 0.5rem;
    }

    /* Post cards */
    .post-header {
        flex-direction: column;
    }

    .post-meta {
        flex-direction: column;
        gap: 0.2rem;
        font-size: 0.85rem;
    }

    .post-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 0.4rem;
    }

    .post-actions .btn {
        flex: 1 1 auto;
        min-width: 75px;
        font-size: 0.82rem;
        padding: 0.4rem 0.6rem;
        text-align: center;
    }

    /* Post form */
    .create-post-form {
        padding: 1rem;
    }

    .form-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .form-actions .btn {
        flex: 1 1 auto;
        text-align: center;
    }

    /* Leaderboard: horizontal scroll */
    .leaderboard-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .leaderboard-table {
        min-width: 420px;
    }

    .lb-name-cell {
        white-space: nowrap;
    }

    /* Browse modules search row */
    .search-row {
        flex-direction: column;
    }

    .search-row input,
    .search-row select,
    .search-row button {
        width: 100%;
    }

    /* Module browser controls */
    .module-browser-controls {
        flex-direction: column;
        gap: 0.75rem;
    }

    .module-browser-controls select,
    .module-browser-controls input {
        width: 100%;
    }

    /* Profile page */
    .profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1rem;
    }

    .profile-stats {
        grid-template-columns: 1fr 1fr;
    }

    /* View other user's profile */
    .view-profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 0.75rem;
    }

    .view-profile-stats {
        grid-template-columns: 1fr 1fr;
    }

    /* People search cards */
    .people-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    /* Dashboard response cards */
    .response-header {
        flex-direction: column;
        gap: 0.5rem;
    }

    .response-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    /* Contact us card */
    .contact-card {
        padding: 1.5rem 1rem;
    }

    .contact-email-btn {
        font-size: 0.85rem;
        padding: 0.75rem 1rem;
        word-break: break-all;
    }

    /* Modal */
    .modal-content {
        width: 98%;
        padding: 1rem;
        max-height: 90vh;
        overflow-y: auto;
    }

    /* Lightbox */
    .lightbox-img {
        max-width: 95vw;
        max-height: 80vh;
    }
}

/* Extra small screens (< 400px) */
@media (max-width: 400px) {
    .header-actions .btn,
    .nav .btn {
        font-size: 0.82rem;
        padding: 0.4rem 0.7rem;
    }

    .user-email {
        display: none; /* hide email on very small screens to save space */
    }

    .logo-text {
        font-size: 1.2rem;
    }

    .post-actions .btn {
        font-size: 0.78rem;
        padding: 0.35rem 0.5rem;
    }
}

/* ============================================================
   ADDITIONAL MOBILE POLISH
   ============================================================ */
@media (max-width: 768px) {
    /* Module browser grid: 1 column on phones */
    .module-browser-list {
        grid-template-columns: 1fr;
    }

    /* Profile stats: 2 columns */
    .profile-stats {
        grid-template-columns: 1fr 1fr;
    }

    /* Signup card: tighter padding */
    .login-card {
        padding: 1.25rem 1rem;
    }

    /* Pagination: stack on small widths */
    .pagination-controls {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.75rem;
    }

    /* Settings modal: full width */
    .settings-modal {
        width: 100%;
        max-width: 100%;
        border-radius: 0;
        margin: 0;
    }

    /* Module card activity badge: smaller */
    .activity-badge {
        font-size: 0.7rem;
        padding: 0.15rem 0.5rem;
    }

    /* Suggested module cards */
    .suggested-modules-section {
        grid-template-columns: 1fr;
    }

    /* People view btn: full width on phones */
    .people-view-btn {
        width: 100%;
        text-align: center;
    }

    /* Token badges in header: smaller on mobile */
    .token-badge {
        font-size: 0.75rem;
        padding: 4px 8px;
    }

    /* Role badge: hide on very small headers */
    .role-badge {
        display: none;
    }

    /* Stat boxes in profile: smaller text */
    .stat-value {
        font-size: 1.2rem;
    }

    /* Radio options in signup form */
    .radio-option {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
}

/* ── REPLY THREADS ─────────────────────────────────────────────────────────── */
.btn-reply {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.82rem;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-reply:hover { background: var(--bg-primary); }

.replies-panel {
    margin-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    padding-top: 0.75rem;
}

.replies-list { margin-bottom: 0.75rem; }

.reply-item {
    background: var(--bg-primary);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
}

.reply-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.reply-meta strong { color: var(--text-primary); }
.reply-date { font-size: 0.75rem; color: var(--text-tertiary); }
.reply-delete { color: #e53e3e; font-size: 0.75rem; margin-left: auto; cursor: pointer; background: none; border: none; }
.reply-body { font-size: 0.9rem; color: var(--text-primary); white-space: pre-wrap; word-break: break-word; }

.reply-compose { display: flex; gap: 0.5rem; align-items: flex-start; }
.reply-textarea {
    flex: 1;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.5rem;
    font-size: 0.9rem;
    resize: vertical;
    background: var(--bg-secondary);
    color: var(--text-primary);
}
.reply-textarea:focus { outline: none; border-color: #111827; }
.btn-sm { padding: 6px 14px; font-size: 0.85rem; }

/* ── NOTIFICATION BELL ─────────────────────────────────────────────────────── */
.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #e53e3e;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 10px;
    pointer-events: none;
    line-height: 1.4;
}

.notif-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: 320px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    z-index: 1000;
    overflow: hidden;
}

.notif-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.btn-link {
    background: none;
    border: none;
    color: #111827;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0;
}
.btn-link:hover { text-decoration: underline; }

.notif-list { max-height: 340px; overflow-y: auto; }

.notif-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.1s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg-primary); }
.notif-unread { background: #f0f4ff; }
.notif-unread:hover { background: #e6ecff; }

.notif-msg { font-size: 0.85rem; color: var(--text-primary); margin-bottom: 0.2rem; }
.notif-time { font-size: 0.75rem; color: var(--text-tertiary); }

@media (max-width: 600px) {
    .notif-dropdown { width: calc(100vw - 2rem); right: -1rem; }
}

/* ── GROUPED MODULE BROWSE ─────────────────────────────────────────────────── */
.group-faculty {
    margin-bottom: 2rem;
}
.group-faculty-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--border-color);
}
.group-course {
    margin-bottom: 1.25rem;
    padding-left: 0.75rem;
    border-left: 3px solid #11182733;
}
.group-course-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.6rem;
}

/* ── ORANGE TICK (1 verification) ──────────────────────────────────────────── */
.tick-orange {
    background: linear-gradient(135deg, #f6ad55, #ed8936);
    color: #fff;
}

/* ── VERIFY COUNT BADGE ─────────────────────────────────────────────────────── */
.verification-tick {
    position: relative;
}
.verify-count-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #fff;
    color: #111827;
    font-size: 0.6rem;
    font-weight: 700;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid currentColor;
    line-height: 1;
}

/* ── VERIFIED / BOOKMARKED ACTIVE STATES ───────────────────────────────────── */
.btn-verify.verified-active {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: #fff;
    border-color: #38a169;
}
.btn-bookmark.bookmarked-active {
    background: #111827;
    color: #fff;
    border-color: #111827;
}

/* ── GUIDELINES CLOSE BUTTON ───────────────────────────────────────────────── */
.guidelines-close {
    float: right;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    color: inherit;
    opacity: 0.6;
    padding: 0;
    line-height: 1;
    margin-left: 0.5rem;
}
.guidelines-close:hover { opacity: 1; }

/* ── MOBILE FIXES ───────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    /* Notification bell doesn't overlap other buttons */
    #notifBellWrap { position: relative; }
    .notif-dropdown {
        position: fixed;
        top: 60px;
        left: 0.5rem;
        right: 0.5rem;
        width: auto;
    }

    /* Reply compose stacks vertically */
    .reply-compose { flex-direction: column; }
    .reply-compose .btn-sm { align-self: flex-end; }

    /* Post actions wrap cleanly */
    .post-actions { flex-wrap: wrap; gap: 0.4rem; }
    .post-actions .btn { font-size: 0.78rem; padding: 4px 8px; }

    /* Verification tick badge readable on small screens */
    .verify-count-badge { font-size: 0.55rem; width: 12px; height: 12px; }
}

/* ── TOAST NOTIFICATION ─────────────────────────────────────────────────────── */
.toast-notif {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 9999;
    box-shadow: 0 4px 16px rgba(0,0,0,.15);
    max-width: calc(100vw - 2rem);
    text-align: center;
    animation: toastIn 0.2s ease;
}
.toast-success { background: #2d3748; color: #fff; }
.toast-error   { background: #e53e3e; color: #fff; }
@keyframes toastIn { from { opacity:0; transform: translateX(-50%) translateY(8px); } to { opacity:1; transform: translateX(-50%) translateY(0); } }

/* ── ADMIN PANEL ─────────────────────────────────────────────────────────────── */
.admin-section {
    margin-top: 2rem;
    padding: 1.25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}
.admin-section h3 { margin: 0 0 0.5rem; font-size: 1rem; }

.admin-reports-table-wrap {
    overflow-x: auto;
    margin-top: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}
.admin-reports-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.admin-reports-table th {
    background: var(--bg-primary);
    padding: 0.6rem 0.8rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}
.admin-reports-table td {
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
}
.admin-reports-table tr:last-child td { border-bottom: none; }
.admin-reports-table tr:hover td { background: var(--bg-primary); }
.report-row-deleted td { opacity: 0.55; }
.report-post-title { font-weight: 500; }
.badge-deleted {
    display: inline-block;
    background: #fed7d7;
    color: #c53030;
    font-size: 0.7rem;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 4px;
    font-weight: 600;
}

body.dark-mode .badge-deleted {
    background: rgba(197, 48, 48, 0.2);
    color: #fc8181;
}
.btn-warn {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
    border-radius: 5px;
    padding: 3px 8px;
    font-size: 0.78rem;
    cursor: pointer;
    white-space: nowrap;
}
.btn-warn:hover { background: #ffc107; color: #000; }

@media (max-width: 600px) {
    .admin-reports-table th:nth-child(5),
    .admin-reports-table td:nth-child(5) { display: none; } /* hide reporter col on mobile */
}

/* ── POST ENGAGEMENT BAR ─────────────────────────────────────────────────────── */
.post-title-link {
    cursor: pointer;
}
.post-title-link:hover {
    color: var(--text-primary);
    text-decoration: underline;
    text-decoration-color: var(--text-primary);
    opacity: 0.75;
}

.post-tick-wrap {
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.post-engagement-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.75rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--border-color);
    gap: 0.5rem;
    flex-wrap: wrap;
}

.engagement-stats {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.eng-btn, .eng-stat {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.eng-stat { cursor: default; }
.eng-btn:hover { background: var(--bg-primary); color: var(--text-primary); }

.eng-icon { font-size: 0.9rem; }
.eng-count { font-weight: 600; min-width: 10px; }

/* Liked state */
.eng-btn.eng-liked {
    border-color: #e53e3e44;
    background: #fff5f5;
    color: #e53e3e;
}
.eng-btn.eng-liked:hover { background: #fed7d7; }

/* Verified-by-me state */
.eng-btn.eng-verified {
    border-color: #48bb7844;
    background: #f0fff4;
    color: #38a169;
}
.eng-btn.eng-verified:hover { background: #c6f6d5; }

/* ── ICON-ONLY ACTION BUTTONS ────────────────────────────────────────────────── */
.engagement-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.icon-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1.5px solid var(--border-color);
    background: transparent;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, min-width 0.25s ease;
    padding: 0 6px;
    gap: 0;
    overflow: hidden;
    white-space: nowrap;
}
.icon-action:hover { background: var(--bg-primary); }

.icon-action .icon-label {
    max-width: 0;
    overflow: hidden;
    white-space: nowrap;
    font-size: 0.78rem;
    font-weight: 500;
    transition: max-width 0.25s ease, margin-left 0.25s ease;
    margin-left: 0;
}
.icon-action:hover .icon-label {
    max-width: 120px;
    margin-left: 4px;
}

/* Bookmark: red outline when not saved */
.bookmark-icon {
    border-color: #e53e3e;
    color: #e53e3e;
    background: #fff;
}
.bookmark-icon:hover { background: #fff5f5; }

/* Bookmark: green fill when saved */
.bookmark-icon.bookmarked {
    background: #38a169;
    border-color: #38a169;
    color: #fff;
}
.bookmark-icon.bookmarked:hover { background: #2f855a; border-color: #2f855a; }

.report-icon { color: var(--text-secondary); }
.report-icon:hover { background: #fff5f5; border-color: #e53e3e; color: #e53e3e; }

.delete-icon { color: var(--text-secondary); }
.delete-icon:hover { background: #fff5f5; border-color: #e53e3e; color: #e53e3e; }

/* Remove old action button styles that are now replaced */
.post-actions { display: none; }

@media (max-width: 600px) {
    .eng-btn, .eng-stat { padding: 3px 8px; font-size: 0.78rem; }
    .icon-action { min-width: 28px; height: 28px; font-size: 0.8rem; }
    .icon-action:hover .icon-label { max-width: 0; margin-left: 0; }
    .post-engagement-bar { gap: 0.25rem; }
}

/* ── MCQ Quiz ─────────────────────────────────────────────────────────────── */

.quiz-panel { padding: 1rem 0; }

.quiz-toolbar { display: flex; gap: 0.5rem; margin-bottom: 1rem; }

.quiz-progress-bar-wrap {
    display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.25rem;
}
.quiz-progress-bar {
    flex: 1; height: 6px; background: var(--border-color); border-radius: 3px; overflow: hidden;
}
.quiz-progress-fill {
    height: 100%; background: var(--primary-color);
    border-radius: 3px; transition: width 0.3s ease;
}
.quiz-progress-label { font-size: 0.8rem; color: var(--text-secondary); white-space: nowrap; }

.quiz-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.5rem;
}
.quiz-question {
    font-size: 1rem; font-weight: 600; margin-bottom: 1.25rem; line-height: 1.5;
}
.quiz-options { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 1rem; }
.quiz-option {
    text-align: left; padding: 0.75rem 1rem;
    background: var(--bg-primary); border: 1.5px solid var(--border-color);
    border-radius: 10px; cursor: pointer; font-size: 0.9rem;
    transition: border-color 0.15s, background 0.15s;
}
.quiz-option:hover:not(:disabled) { border-color: var(--primary-color); }
.quiz-option.selected { border-color: var(--primary-color); background: var(--primary-light, #eef2ff); }
.quiz-option.correct { border-color: #38a169; background: #f0fff4; color: #276749; font-weight: 600; }
.quiz-option.incorrect { border-color: #e53e3e; background: #fff5f5; color: #c53030; }
.quiz-option:disabled { cursor: default; }

/* Dark mode quiz option overrides */
body.dark-mode .quiz-option { color: #e2e8f0; }
body.dark-mode .quiz-option.selected { background: rgba(102,126,234,0.2); color: #e2e8f0; }
body.dark-mode .quiz-option.correct { background: rgba(56,161,105,0.2); color: #68d391; border-color: #38a169; }
body.dark-mode .quiz-option.incorrect { background: rgba(229,62,62,0.2); color: #fc8181; border-color: #e53e3e; }

.quiz-feedback {
    padding: 0.6rem 1rem; border-radius: 8px; font-weight: 600;
    font-size: 0.9rem; margin-bottom: 0.75rem;
}
.quiz-feedback-correct { background: #f0fff4; color: #276749; border: 1px solid #c6f6d5; }
.quiz-feedback-incorrect { background: #fff5f5; color: #c53030; border: 1px solid #fed7d7; }
body.dark-mode .quiz-feedback-correct { background: rgba(56,161,105,0.15); color: #68d391; border-color: rgba(56,161,105,0.4); }
body.dark-mode .quiz-feedback-incorrect { background: rgba(229,62,62,0.15); color: #fc8181; border-color: rgba(229,62,62,0.4); }

.quiz-explanation {
    font-size: 0.85rem; color: var(--text-secondary);
    background: var(--bg-primary); border: 1px solid var(--border-color);
    border-radius: 8px; padding: 0.75rem 1rem; margin-bottom: 1rem;
    line-height: 1.55;
}

.quiz-card-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* Review mode */
.quiz-review-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1rem; font-weight: 600;
}
.quiz-review-list { display: flex; flex-direction: column; gap: 0.75rem; }
.quiz-review-item {
    display: flex; gap: 0.75rem;
    background: var(--bg-secondary); border: 1px solid var(--border-color);
    border-radius: 10px; padding: 0.85rem;
}
.quiz-review-num {
    min-width: 1.6rem; font-size: 0.78rem; font-weight: 700;
    color: var(--text-secondary); padding-top: 2px; text-align: right;
}
.quiz-review-content { flex: 1; }
.quiz-review-q { font-size: 0.88rem; font-weight: 600; margin-bottom: 0.4rem; }
.quiz-review-options { display: flex; flex-direction: column; gap: 0.25rem; }
.quiz-review-opt { font-size: 0.82rem; color: var(--text-secondary); }

/* ── Quiz type tabs ───────────────────────────────────────────────────────── */
.quiz-type-tabs {
    display: flex; gap: 0; margin-bottom: 1.25rem;
    border: 1px solid var(--border-color); border-radius: 10px; overflow: hidden;
}
.quiz-type-tab {
    flex: 1; padding: 0.55rem 1rem; border: none; background: var(--bg-secondary);
    cursor: pointer; font-size: 0.88rem; font-weight: 500; color: var(--text-secondary);
    transition: background 0.15s, color 0.15s;
}
.quiz-type-tab.active { background: var(--primary-color); color: #fff; font-weight: 600; }

/* ── SAQ ──────────────────────────────────────────────────────────────────── */
.saq-feedback { margin-top: 0.75rem; }
.saq-score-badge {
    display: inline-block; font-size: 1.4rem; font-weight: 700;
    color: var(--primary-color); margin-bottom: 0.75rem;
}
.saq-breakdown { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 0.75rem; }
.saq-point {
    display: flex; align-items: flex-start; gap: 0.5rem;
    font-size: 0.88rem; padding: 0.5rem 0.75rem;
    border-radius: 8px;
}
.saq-point.awarded { background: #f0fff4; color: #276749; }
.saq-point.missed  { background: #fff5f5; color: #c53030; }
.saq-point-icon    { font-weight: 700; flex-shrink: 0; }

.saq-extra-points {
    font-size: 0.85rem; background: #fffbeb; border: 1px solid #f6e05e;
    border-radius: 8px; padding: 0.65rem 0.85rem; margin-bottom: 0.5rem;
}
.saq-extra-points ul { margin: 0.25rem 0 0 1rem; padding: 0; }

.saq-pending-notice {
    font-size: 0.82rem; color: var(--text-secondary);
    background: var(--bg-secondary); border: 1px solid var(--border-color);
    border-radius: 8px; padding: 0.6rem 0.85rem;
}

.saq-point-editor {
    background: var(--bg-secondary); border: 1px solid var(--border-color);
    border-radius: 8px; padding: 0.75rem; margin-bottom: 0.6rem;
}

.saq-review-item {
    background: var(--bg-secondary); border: 1px solid var(--border-color);
    border-radius: 10px; padding: 1rem; margin-bottom: 0.75rem;
}
.saq-review-question { font-weight: 600; margin-bottom: 0.4rem; }
.saq-review-answer { font-size: 0.88rem; color: var(--text-secondary); margin-bottom: 0.5rem; }
.saq-review-breakdown { display: flex; flex-direction: column; gap: 0.25rem; margin-bottom: 0.5rem; font-size:0.85rem; }
.saq-review-breakdown .awarded { color: #276749; }
.saq-review-breakdown .missed  { color: #c53030; }

/* ── Notes Tab ─────────────────────────────────────────────────────────────── */

.notes-locked-state {
    text-align: center;
    padding: 3rem 2rem;
    max-width: 480px;
    margin: 0 auto;
}
.notes-locked-icon { font-size: 3rem; margin-bottom: 1rem; }
.notes-locked-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 0.5rem; color: var(--text-primary); }
.notes-locked-desc { color: var(--text-secondary); font-size: 0.95rem; margin-bottom: 1.5rem; line-height: 1.6; }

.notes-type-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0;
}
.notes-type-tab {
    background: none;
    border: none;
    padding: 0.55rem 1rem;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    border-radius: 0;
    transition: color 0.15s, border-color 0.15s;
}
.notes-type-tab:hover { color: var(--accent-color); }
.notes-type-tab.active { color: var(--accent-color); border-bottom-color: var(--accent-color); font-weight: 600; }

/* ── Survival Notes viewer ─────────────────────────────────────────────────── */

.survival-notes-viewer {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
}

/* Watermark/anti-screenshot overlay — tiled semi-transparent text */
.survival-notes-watermark-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 2;
    pointer-events: none;
    background-image: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 80px,
        rgba(0, 0, 0, 0.025) 80px,
        rgba(0, 0, 0, 0.025) 82px
    );
    background-size: 200px 200px;
}

.survival-notes-sections {
    position: relative;
    z-index: 1;
    scroll-behavior: smooth;
}

/* Prevent user text selection (anti-screenshot helper) */
.no-select {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.survival-note-section {
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 0;
}
.survival-note-section:last-child { border-bottom: none; }

.survival-note-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.survival-note-heading {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}
.survival-note-edit-btn {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.25rem 0.6rem;
    font-size: 0.78rem;
    cursor: pointer;
    color: var(--text-secondary);
    flex-shrink: 0;
}
.survival-note-edit-btn:hover { background: var(--bg-secondary); }

.survival-note-body h3 {
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 1rem 0 0.3rem;
}
.survival-note-body h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0.75rem 0 0.25rem;
}
.survival-note-body ul {
    margin: 0.25rem 0 0.5rem 1.2rem;
    padding: 0;
}
.survival-note-body li {
    font-size: 0.9rem;
    line-height: 1.65;
    color: var(--text-primary);
    margin-bottom: 0.1rem;
}
.survival-note-body p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0.35rem 0;
    line-height: 1.6;
}
.survival-note-body strong { color: var(--text-primary); }

.survival-notes-admin-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}
.survival-notes-admin-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

/* ── Three-Day Plan ─────────────────────────────────────────────────────────── */

.three-day-plan {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.plan-day-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem 1.4rem;
}

.plan-day-badge {
    display: inline-block;
    background: var(--accent-color);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.2rem 0.65rem;
    border-radius: 20px;
    margin-bottom: 0.6rem;
}

.plan-day-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.75rem;
    line-height: 1.4;
}

.plan-day-section { margin-bottom: 0.75rem; }
.plan-day-section:last-child { margin-bottom: 0; }

.plan-section-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
}

.plan-day-card ul {
    margin: 0 0 0 1.1rem;
    padding: 0;
}
.plan-day-card li {
    font-size: 0.88rem;
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 0.1rem;
}

/* modal-lg */
.modal-lg { max-width: 680px; }

/* ── Profile Referral Section ───────────────────────────────────────────────── */

.profile-referral-section {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-color);
}
.profile-referral-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.4rem;
    color: var(--text-primary);
}
.profile-referral-desc {
    font-size: 0.87rem;
    color: var(--text-secondary);
    line-height: 1.55;
    margin: 0 0 0.75rem;
}
.profile-referral-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.5rem;
}
.profile-referral-input {
    flex: 1;
    font-size: 0.82rem;
    font-family: monospace;
    background: var(--bg-secondary);
}
.profile-referral-note {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* ── Study Sprint Widget ────────────────────────────────────────────────── */
.sprint-widget {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: #111827;
    border: 1px solid rgba(255,255,255,0.08);
    color: white;
    border-radius: 14px;
    padding: .7rem 1rem;
    box-shadow: 0 4px 20px rgba(102,126,234,.4);
    z-index: 9000;
    min-width: 180px;
}
.sprint-widget-inner { display: flex; align-items: center; gap: .6rem; }
.sprint-emoji { font-size: 1.4rem; }
.sprint-info { flex: 1; }
.sprint-label { font-size: .72rem; opacity: .85; }
.sprint-timer { font-size: 1.3rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.sprint-stop-btn { background: rgba(255,255,255,.2); color: white; border: 1px solid rgba(255,255,255,.4); border-radius: 8px; padding: .3rem .6rem; cursor: pointer; font-size: .8rem; }
.sprint-stop-btn:hover { background: rgba(255,255,255,.35); }

/* ── Token Shop ──────────────────────────────────────────────────────────── */
.shop-category-tabs { display: flex; gap: .3rem; flex-wrap: wrap; margin-bottom: .75rem; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .75rem; max-height: 440px; overflow-y: auto; }
.shop-card { border: 1px solid var(--border-color); border-radius: 10px; padding: .75rem; text-align: center; background: var(--bg-primary); transition: box-shadow .15s; }
.shop-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,.08); border-color: #e5e7eb; }
.shop-item-preview { width: 56px; height: 56px; border-radius: 50%; margin: 0 auto .4rem; display: flex; align-items: center; justify-content: center; font-size: 1.6rem; border: 3px solid transparent; }
.shop-item-name { font-weight: 700; font-size: .85rem; margin-bottom: .15rem; }
.shop-item-desc { font-size: .72rem; color: var(--text-secondary); margin-bottom: .5rem; min-height: 1rem; }

/* ── Marketplace ─────────────────────────────────────────────────────────── */
.market-toolbar { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.market-filters { display: flex; gap: .4rem; flex-wrap: wrap; flex: 1; }
.form-control-sm { padding: .35rem .6rem; font-size: .82rem; border-radius: 6px; border: 1.5px solid var(--border-color); background: var(--bg-primary); color: var(--text-primary); }
.market-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .75rem; }
.listing-card { border: 1px solid var(--border-color); border-radius: 10px; overflow: hidden; cursor: pointer; background: var(--bg-primary); transition: box-shadow .15s, transform .1s; }
.listing-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); transform: translateY(-2px); }
.listing-card-img { height: 120px; background: var(--bg-secondary); background-size: cover; background-position: center; }
.listing-card-img-placeholder { display: flex; align-items: center; justify-content: center; font-size: 2.5rem; }
.listing-card-body { padding: .6rem .75rem; }
.listing-category-badge { font-size: .68rem; text-transform: uppercase; font-weight: 700; color: var(--text-secondary); letter-spacing: .04em; }
.listing-title { font-weight: 700; font-size: .9rem; margin: .2rem 0; }
.listing-price { font-weight: 700; color: var(--accent); font-size: .88rem; }
.listing-seller { font-size: .72rem; color: var(--text-secondary); }

/* ── Societies ───────────────────────────────────────────────────────────── */
.societies-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .75rem; }
.society-card { border: 1px solid var(--border-color); border-radius: 10px; overflow: hidden; cursor: pointer; background: var(--bg-primary); transition: box-shadow .15s; }
.society-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); }
.society-cover { height: 80px; background: #374151; background-size: cover; background-position: center; }
.society-cover-placeholder { display: flex; align-items: center; justify-content: center; font-size: 2rem; }
.society-card-body { padding: .6rem .75rem; }
.society-name { font-weight: 700; font-size: .9rem; margin-bottom: .2rem; }
.society-meta { font-size: .72rem; color: var(--text-secondary); }
.society-screen-header { margin-bottom: 1rem; }
.society-screen-meta { display: flex; gap: .75rem; align-items: flex-start; flex-wrap: wrap; }
.society-screen-cover { width: 60px; height: 60px; border-radius: 8px; object-fit: cover; }
.society-post-toolbar { margin-bottom: .75rem; }
.society-posts-list { display: flex; flex-direction: column; gap: .75rem; }
.society-post-card { border: 1px solid var(--border-color); border-radius: 10px; padding: .9rem 1rem; background: var(--bg-primary); }
.society-post-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .4rem; }
.society-post-type-badge { font-size: .72rem; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .04em; }
.society-post-title { font-size: 1rem; font-weight: 700; margin: 0 0 .4rem; }
.society-post-body { color: var(--text-secondary); font-size: .88rem; margin-bottom: .5rem; }
.society-post-footer { display: flex; align-items: center; justify-content: space-between; }
.event-details { margin: .5rem 0; }
.event-poster-img { width: 100%; max-height: 180px; object-fit: cover; border-radius: 8px; margin-bottom: .4rem; }
.event-meta-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; font-size: .8rem; color: var(--text-secondary); }

/* ── Companions ──────────────────────────────────────────────────────────── */
.companion-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; max-height: 400px; overflow-y: auto; }
.companion-card { border: 1.5px solid var(--border-color); border-radius: 12px; padding: .75rem; text-align: center; background: var(--bg-primary); transition: border-color .15s; }
.companion-card.companion-active { border-color: var(--accent); background: rgba(245,159,11,0.06); }
.companion-emoji { font-size: 2rem; margin-bottom: .3rem; }
.companion-info { margin-bottom: .5rem; }
.companion-name { font-weight: 700; font-size: .88rem; }
.companion-level { font-size: .72rem; color: var(--accent); font-weight: 700; }
.companion-xp-bar { height: 4px; background: var(--bg-secondary); border-radius: 2px; margin: .3rem 0; overflow: hidden; }
.companion-xp-fill { height: 100%; background: #f59e0b; border-radius: 2px; transition: width .3s; }
.companion-xp-label { font-size: .68rem; color: var(--text-secondary); }

/* ── DM Messages ─────────────────────────────────────────────────────────── */
.dm-thread-list { max-height: 400px; overflow-y: auto; }
.dm-messages { max-height: 320px; overflow-y: auto; padding: .25rem 0; display: flex; flex-direction: column; gap: .4rem; margin-bottom: .75rem; }
.dm-bubble { max-width: 80%; padding: .5rem .8rem; border-radius: 12px; font-size: .88rem; }
.dm-mine { align-self: flex-end; background: #1e293b; color: white; border-bottom-right-radius: 3px; }
.dm-theirs { align-self: flex-start; background: var(--bg-secondary); color: var(--text-primary); border-bottom-left-radius: 3px; }
.dm-time { font-size: .65rem; opacity: .7; margin-top: .15rem; }
.dm-compose { display: flex; gap: .4rem; align-items: flex-end; }
.dm-compose textarea { flex: 1; resize: none; }

/* ── Account type selector (signup) ─────────────────────────────────────── */
.account-type-tabs {
    display: flex;
    gap: .3rem;
    flex-wrap: wrap;
    margin-bottom: .6rem;
}
.acct-tab {
    flex: 1;
    min-width: 90px;
    padding: .5rem .6rem;
    border: 1.5px solid var(--border-color);
    background: var(--bg-primary);
    border-radius: 8px;
    cursor: pointer;
    font-size: .82rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: border-color .15s, color .15s, background .15s;
    text-align: center;
}
.acct-tab.active {
    border-color: #111827;
    color: #111827;
    background: rgba(102, 126, 234, .07);
}

body.dark-mode .acct-tab.active {
    border-color: #e0e0e0;
    color: #e0e0e0;
    background: rgba(102, 126, 234, .15);
}
.account-type-hint {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: .65rem .85rem;
    font-size: .83rem;
    color: var(--text-secondary);
    line-height: 1.5;
    display: flex;
    gap: .5rem;
    align-items: flex-start;
}
.account-type-hint p { margin: 0; }
.info-hint {
    border: 1px solid #3b82f6;
    background: rgba(59, 130, 246, .06);
    color: #1e40af;
}
.dark-mode .info-hint { color: #93c5fd; border-color: #3b82f6; background: rgba(59,130,246,.1); }

/* ── Profile privacy section ─────────────────────────────────────────────── */
.profile-privacy-section, .profile-social-section {
    border-top: 1px solid var(--border-color);
    padding-top: 1.25rem;
    margin-top: 1.25rem;
}
.profile-privacy-title, .profile-social-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: .75rem;
}
.visibility-toggles {
    display: flex;
    flex-direction: column;
    gap: .35rem;
}
.toggle-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .88rem;
    cursor: pointer;
    user-select: none;
}
.toggle-row input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; }
.profile-social-btns { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .5rem; }
.profile-social-note { font-size: .78rem; color: var(--text-secondary); margin: 0; line-height: 1.5; }

/* ── Connections modal ───────────────────────────────────────────────────── */
.conn-tabs {
    display: flex;
    gap: .25rem;
    margin-bottom: .75rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: .4rem;
}
.conn-tab {
    padding: .3rem .7rem;
    border: none;
    background: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: .85rem;
    color: var(--text-secondary);
}
.conn-tab.active { background: #111827; color: white; font-weight: 600; border-radius: 6px; }
.conn-list { max-height: 320px; overflow-y: auto; }
.conn-row {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .55rem .4rem;
    border-bottom: 1px solid var(--border-color);
}
.conn-row:last-child { border-bottom: none; }
.conn-avatar-img, .conn-avatar-initials {
    width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
}
.conn-avatar-initials {
    background: #111827;
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-size: .85rem; font-weight: 700;
}
.conn-row-info { flex: 1; min-width: 0; }
.conn-name { font-size: .88rem; font-weight: 600; }

/* ── Social links display ────────────────────────────────────────────────── */
.view-profile-social-links { display: flex; flex-wrap: wrap; gap: .4rem; }
.social-link-item {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .35rem .75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: .82rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: background .15s;
}
.social-link-item:hover { background: var(--border-color); }

/* ── Home / Trending Feed ─────────────────────────────────────────────────── */
.home-screen-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    margin-bottom: 1.25rem;
}
.home-tabs {
    display: flex;
    gap: .25rem;
    background: var(--bg-secondary);
    border-radius: 10px;
    padding: 4px;
    border: 1px solid var(--border-color);
}
.home-tab {
    padding: .4rem .9rem;
    border: none;
    background: transparent;
    border-radius: 7px;
    cursor: pointer;
    font-size: .9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: background .15s, color .15s;
}
.home-tab.active {
    background: #111827;
    color: white;
    box-shadow: none;
}
.trending-sort-bar {
    display: flex;
    gap: .4rem;
    margin-bottom: 1rem;
}
.sort-btn {
    padding: .35rem .85rem;
    border: 1.5px solid var(--border-color);
    background: var(--bg-primary);
    border-radius: 20px;
    cursor: pointer;
    font-size: .82rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: border-color .15s, color .15s, background .15s;
}
.sort-btn.active {
    border-color: #111827;
    background: #111827;
    color: white;
}
.trending-feed {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}
.trending-post-card {
    cursor: default;
}
.trending-module-badge {
    display: inline-block;
    background: #111827;
    color: white;
    border-radius: 4px;
    padding: 2px 7px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .02em;
    cursor: pointer;
}
.trending-module-badge:hover {
    opacity: .85;
}

/* ── Post image (feed thumbnail + detail view) ─────────────────────────────── */
.post-image-thumb {
    margin: .5rem 0;
    border-radius: 8px;
    overflow: hidden;
    cursor: zoom-in;
    max-height: 220px;
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
}
.post-image-thumb img {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    display: block;
}
.post-detail-image {
    margin: .75rem 0;
    border-radius: 10px;
    overflow: hidden;
    cursor: zoom-in;
    text-align: center;
    background: var(--bg-secondary);
}
.post-detail-image img {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 10px;
}

/* ── Post image upload area (in create form) ──────────────────────────────── */
.post-image-drop-area {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: .75rem;
    cursor: pointer;
    text-align: center;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color .2s, background .2s;
}
.post-image-drop-area:hover {
    border-color: #111827;
    background: rgba(102, 126, 234, .04);
}
.post-image-placeholder {
    display: flex;
    gap: .5rem;
    align-items: center;
    color: var(--text-secondary);
    font-size: .875rem;
}
.post-image-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #e53e3e;
    color: white;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: .7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Recent posts in profile ──────────────────────────────────────────────── */
.view-profile-recent-posts {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}
.recent-post-row {
    padding: .6rem .75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: background .15s;
}
.recent-post-row:hover {
    background: var(--bg-secondary);
}
.recent-post-title {
    font-size: .9rem;
    font-weight: 600;
    margin-bottom: .25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.recent-post-meta {
    display: flex;
    gap: .5rem;
    align-items: center;
    flex-wrap: wrap;
}

/* Bug report screenshot upload area */
.bug-screenshot-area {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.2s, background 0.2s;
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.bug-screenshot-area:hover {
    border-color: #111827;
    background: var(--bg-secondary);
}
#bugScreenshotPlaceholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}
#bugScreenshotPreview {
    position: relative;
    align-items: center;
    justify-content: center;
    width: 100%;
}
.bug-screenshot-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #e53e3e;
    color: white;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Maintenance banner */
.maintenance-banner {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    background: #fffbeb;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    color: #92400e;
}
.dark-mode .maintenance-banner {
    background: #2d2000;
    border-color: #d97706;
    color: #fcd34d;
}
.maintenance-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.05rem;
}
.maintenance-banner strong {
    display: block;
    margin-bottom: 0.2rem;
    font-size: 0.95rem;
}
.maintenance-banner p {
    margin: 0;
    line-height: 1.5;
}
.maintenance-banner a {
    color: #b45309;
    font-weight: 600;
}
.dark-mode .maintenance-banner a {
    color: #fbbf24;
}

/* ── Campus Feed ───────────────────────────────────────────────────────────── */

:root {
    --campus-blue: #2563eb;
    --campus-blue-light: rgba(37, 99, 235, 0.1);
    --campus-blue-dark: #1d4ed8;
}

.campus-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.campus-scope-toggle {
    display: inline-flex;
    gap: .25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 4px;
}
.campus-scope-btn {
    padding: .4rem .9rem;
    border: none;
    background: transparent;
    border-radius: 7px;
    cursor: pointer;
    font-size: .85rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: background .15s, color .15s;
}
.campus-scope-btn.active {
    background: var(--campus-blue);
    color: #ffffff;
}

.campus-feed-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.campus-post-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 3px var(--shadow);
}

.campus-post-banner {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .75rem .9rem;
    cursor: pointer;
}
.campus-post-banner:hover .campus-post-name { color: var(--campus-blue); }

.campus-post-avatar, .campus-post-avatar-img, .campus-post-avatar-initials {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--campus-blue-light);
    color: var(--campus-blue);
    font-weight: 700;
    font-size: .8rem;
    flex-shrink: 0;
}

.campus-post-banner-text { flex: 1; min-width: 0; }
.campus-post-name-row { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.campus-post-name { font-weight: 600; font-size: .92rem; color: var(--text-primary); transition: color .15s; }

.campus-uni-badge {
    display: inline-block;
    background: var(--campus-blue);
    color: #ffffff;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
    padding: .12rem .5rem;
    border-radius: 999px;
}

.campus-post-meta-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .76rem;
    color: var(--text-secondary);
    margin-top: .15rem;
}
.campus-post-location { color: var(--campus-blue); font-weight: 500; }

.campus-post-cat-chip {
    font-size: .72rem;
    color: var(--text-secondary);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: .2rem .55rem;
    white-space: nowrap;
}

.campus-post-img {
    display: block;
    width: 100%;
    max-height: 560px;
    object-fit: contain;
    cursor: zoom-in;
    background: var(--bg-primary);
}

/* ── Campus post image carousel (Instagram-style swipe) ──────────────── */
.campus-post-carousel {
    position: relative;
    background: var(--bg-primary);
}

.campus-post-carousel--multi .campus-carousel-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.campus-post-carousel--multi .campus-carousel-track::-webkit-scrollbar { display: none; }

.campus-carousel-slide {
    flex: 0 0 100%;
    scroll-snap-align: start;
    min-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.campus-carousel-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.3);
}
.campus-carousel-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transition: background 0.15s, transform 0.15s;
}
.campus-carousel-dot.active {
    background: #fff;
    transform: scale(1.25);
}

.campus-carousel-count {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
}

.campus-post-caption {
    padding: .65rem .9rem 0;
    font-size: .9rem;
    line-height: 1.45;
    color: var(--text-primary);
    white-space: pre-wrap;
}

.campus-post-actions {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .6rem .9rem .8rem;
}
.campus-action-btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    border: none;
    background: var(--bg-primary);
    color: var(--text-secondary);
    border-radius: 999px;
    padding: .4rem .8rem;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, color .15s, transform .1s;
}
.campus-action-btn:hover { background: var(--campus-blue-light); color: var(--campus-blue); }
.campus-action-btn:active { transform: scale(.96); }
.campus-like-btn.liked { color: #e53e3e; background: rgba(229,62,62,0.08); }
.campus-delete-btn { margin-left: auto; }

/* Create post / national share toggle */
.campus-national-toggle { background: var(--campus-blue-light); border-radius: 10px; padding: .65rem .8rem; }
.campus-toggle-row { display: flex; align-items: center; gap: .5rem; font-weight: 600; cursor: pointer; }
.campus-toggle-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--campus-blue); cursor: pointer; }

/* Comments modal */
.campus-comments-list {
    max-height: 320px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: .65rem;
    margin-bottom: .75rem;
    padding-right: .25rem;
}
.campus-comment-row { display: flex; gap: .55rem; align-items: flex-start; }
.campus-comment-avatar, .campus-comment-avatar-img, .campus-comment-avatar-initials {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--campus-blue-light);
    color: var(--campus-blue);
    font-weight: 700;
    font-size: .68rem;
    flex-shrink: 0;
}
.campus-comment-body { flex: 1; min-width: 0; }
.campus-comment-meta { display: flex; align-items: baseline; gap: .4rem; }
.campus-comment-name { font-weight: 600; font-size: .82rem; }
.campus-comment-time { font-size: .72rem; color: var(--text-secondary); }
.campus-comment-text { font-size: .85rem; color: var(--text-primary); line-height: 1.4; }
.campus-comment-composer { display: flex; gap: .5rem; }
.campus-comment-composer .form-control { flex: 1; }

.campus-post-caption-no-img {
    padding-top: 0;
    padding-bottom: .5rem;
}

/* ═══════════════════════════════════════════════
   REDESIGN ADDITIONS
   Mobile-first layout, updated cards, forms
   ═══════════════════════════════════════════════ */

/* ── Home screen ───────────────────────────── */
#homeScreen {
    padding: 0;
}

.home-screen-header {
    padding: 12px 16px 0;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    position: sticky;
    top: var(--header-height);
    z-index: 50;
}

.home-tabs {
    display: flex;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.home-tabs::-webkit-scrollbar { display: none; }

.home-tab {
    flex-shrink: 0;
    padding: 10px 14px;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.home-tab:hover { color: var(--text-primary); }
.home-tab.active {
    color: var(--brand);
    border-bottom-color: var(--brand);
}

.header-actions {
    display: none; /* covered by bottom tab bar (mobile) or sidebar nav (desktop) */
}

/* Tablet only: sidebar nav isn't shown yet, bottom tab bar feels cramped here */
@media (min-width: 768px) and (max-width: 1023px) {
    .header-actions {
        display: flex;
        gap: 8px;
        align-items: center;
        padding-bottom: 8px;
    }
}

/* ── Feed panels ────────────────────────────── */
#campusFeedPanel,
#homeFeedPanel,
#modulesFeedPanel,
#marketFeedPanel,
#societiesFeedPanel {
    padding: 12px 16px;
}

@media (min-width: 640px) {
    #campusFeedPanel,
    #homeFeedPanel,
    #modulesFeedPanel,
    #marketFeedPanel,
    #societiesFeedPanel {
        padding: 16px 20px;
    }
}

/* ── Cards ──────────────────────────────────── */
.module-card {
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s, transform 0.15s;
}
.module-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.module-card h3 {
    color: var(--brand);
}

/* Campus post cards */
.campus-post-card {
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 12px;
    transition: box-shadow 0.15s;
}
.campus-post-card:hover {
    box-shadow: var(--shadow-md);
}

/* Trending post cards */
.trending-card {
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 10px;
    transition: box-shadow 0.15s;
}
.trending-card:hover {
    box-shadow: var(--shadow-md);
}

/* ── Toolbar / filters ──────────────────────── */
.campus-toolbar,
.market-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
}

.campus-scope-toggle {
    display: flex;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border-color);
    overflow: hidden;
}

.campus-scope-btn {
    border: none;
    background: transparent;
    padding: 6px 12px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.campus-scope-btn.active {
    background: var(--brand);
    color: white;
}
.campus-scope-btn:not(.active):hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* ── Forms ──────────────────────────────────── */
.form-control {
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border-color);
    font-family: inherit;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px oklch(0.52 0.20 253 / 0.12);
}

/* ── Sort bar ───────────────────────────────── */
.trending-sort-bar {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}

.sort-btn {
    border: 1.5px solid var(--border-color);
    border-radius: 20px;
    background: transparent;
    padding: 4px 12px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.sort-btn:hover {
    border-color: var(--brand);
    color: var(--brand);
}
.sort-btn.active {
    background: var(--brand);
    border-color: var(--brand);
    color: white;
}

/* ── Profile / leaderboard screens ─────────── */
#profileScreen,
#leaderboardScreen,
#moduleBrowserScreen,
#forumScreen,
#findPeopleScreen,
#settingsScreen,
#viewUserProfileScreen,
#adminPanelScreen {
    padding: 16px;
}

@media (min-width: 640px) {
    #profileScreen,
    #leaderboardScreen,
    #moduleBrowserScreen,
    #forumScreen,
    #findPeopleScreen {
        padding: 20px 24px;
    }
}

/* ── Responsive: widen content on large screens ── */
@media (min-width: 1024px) {
    .container {
        padding: 0 32px;
    }
}

/* ── Notif badge (shared) ─────────────────── */
.notif-badge {
    position: absolute;
    top: 1px;
    right: 1px;
    min-width: 16px;
    height: 16px;
    background: #dc2626;
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    pointer-events: none;
}

/* ── Footer (hidden when tab bar is present) ── */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-tertiary);
}

/* ── Hint + link utility classes ─────────── */
.hint-text {
    color: var(--text-secondary);
    font-size: 0.82rem;
}
.link-primary {
    color: var(--brand);
    text-decoration: none;
}
.link-primary:hover {
    text-decoration: underline;
}

/* ── Screen animation ─────────────────────── */
.screen {
    animation: screenSlideIn 0.18s ease-out both;
}

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

@media (prefers-reduced-motion: reduce) {
    .screen { animation: none; }
}

/* ── Mobile tap targets ───────────────────── */
@media (max-width: 640px) {
    .btn {
        min-height: 40px;
        font-size: 0.88rem;
    }
    .btn-sm {
        min-height: 32px;
        font-size: 0.8rem;
    }
    .form-control {
        font-size: 16px; /* prevent iOS zoom */
    }
}

/* ═══════════════════════════════════════════════
   DESKTOP LAYOUT (≥1024px)
   Persistent sidebar nav replaces hamburger drawer + bottom tab bar.
   ═══════════════════════════════════════════════ */

.app-body {
    display: block;
}

@media (min-width: 1024px) {
    .app-body {
        display: flex;
        align-items: flex-start;
    }

    /* Hamburger no longer needed; nav is always visible */
    .hamburger-btn {
        display: none;
    }

    /* Drawer becomes a persistent sidebar, not an overlay */
    .drawer-overlay {
        display: none !important;
    }

    .side-drawer {
        position: sticky;
        top: var(--header-height);
        left: auto;
        bottom: auto;
        height: calc(100vh - var(--header-height));
        width: 240px;
        flex-shrink: 0;
        transform: none;
        box-shadow: none;
        border-right: 1px solid var(--border-color);
        border-radius: 0;
    }

    /* Guests have nothing to navigate to yet; sidebar nav is auth-only */
    body:not(.has-tab-bar) .side-drawer {
        display: none;
    }

    /* Logo + close button redundant once sidebar is permanent */
    .drawer-header {
        padding: 18px 16px 12px;
    }
    .drawer-close {
        display: none;
    }

    /* Bottom tab bar replaced by sidebar nav */
    .bottom-tab-bar {
        display: none !important;
    }
    body.has-tab-bar .main {
        padding-bottom: 0;
    }
    body.has-tab-bar footer.footer {
        display: block;
    }

    .main {
        flex: 1;
        min-width: 0;
    }

    /* Drawer nav links get more breathing room as a primary sidebar nav */
    .drawer-link {
        font-size: 0.92rem;
        padding: 10px 14px;
    }

    .drawer-link.active {
        background: var(--brand-subtle);
        color: var(--brand);
        font-weight: 600;
    }
    body.dark-mode .drawer-link.active {
        background: var(--brand-subtle);
        color: oklch(0.75 0.10 253);
    }
}

/* ── Home tabs hidden on desktop: sidebar nav covers Campus/Modules; keep Home/Market/Societies as a slim row ── */
@media (min-width: 1024px) {
    .home-screen-header {
        top: var(--header-height);
    }
}

/* ── Home body layout (feed + sidebar) ─────── */
.home-body {
    display: block;
}
.home-body-main {
    min-width: 0;
}
.feed-sidebar {
    display: none;
}

@media (min-width: 1024px) {
    .home-body {
        display: flex;
        gap: 24px;
        align-items: flex-start;
        padding: 20px 24px;
    }
    .home-body-main {
        flex: 1;
        min-width: 0;
    }
    .feed-sidebar {
        display: flex;
        flex-direction: column;
        gap: 12px;
        width: 272px;
        flex-shrink: 0;
        position: sticky;
        top: calc(var(--header-height) + 56px);
    }

    /* Panels no longer need their own padding; home-body supplies it */
    #campusFeedPanel,
    #homeFeedPanel,
    #modulesFeedPanel,
    #marketFeedPanel,
    #societiesFeedPanel {
        padding: 0;
    }
}

.sidebar-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 14px;
}

.profile-mini-card {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
    transition: box-shadow 0.15s;
}
.profile-mini-card:hover {
    box-shadow: var(--shadow-md);
}

.sidebar-mini-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 6px;
}
.sidebar-mini-avatar--fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-subtle);
    color: var(--brand);
}
.sidebar-mini-avatar--fallback svg {
    width: 26px;
    height: 26px;
}

.sidebar-mini-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.sidebar-mini-name {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text-primary);
}
.sidebar-mini-uni {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.sidebar-mini-stats {
    display: flex;
    gap: 14px;
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
    width: 100%;
    justify-content: center;
}
.sidebar-mini-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
}
.sidebar-mini-stats svg {
    width: 14px;
    height: 14px;
    color: var(--brand);
}

.sidebar-card-title {
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    margin-bottom: 8px;
}

.sidebar-quick-link {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 8px 6px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    text-align: left;
    transition: background 0.12s, color 0.12s;
}
.sidebar-quick-link:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}
.sidebar-quick-link svg {
    width: 16px;
    height: 16px;
    color: var(--brand);
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════
   Pigeonhole Messaging Panel
   Desktop: docked right-side panel, non-blocking (Facebook/LinkedIn style)
   Mobile: full-screen takeover
   ═══════════════════════════════════════════════ */

.dm-panel-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: oklch(0 0 0 / 0.4);
    z-index: 199;
}
.dm-panel-overlay.open {
    display: block;
}

.dm-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    background: var(--bg-secondary);
    z-index: 200;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -4px 0 24px oklch(0 0 0 / 0.18);
}
.dm-panel.open {
    transform: translateX(0);
}

.dm-panel-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.dm-panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}
.dm-panel-header h3 {
    flex: 1;
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}
.dm-panel-icon {
    width: 18px;
    height: 18px;
    color: var(--brand);
}

.dm-panel-close,
.dm-panel-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}
.dm-panel-close:hover,
.dm-panel-back:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}
.dm-panel-close svg, .dm-panel-back svg {
    width: 18px;
    height: 18px;
}

.dm-panel .dm-thread-list {
    flex: 1;
    overflow-y: auto;
    max-height: none;
    padding: 4px 0;
}

.dm-panel .dm-messages {
    flex: 1;
    overflow-y: auto;
    max-height: none;
    padding: 12px 16px;
    margin-bottom: 0;
}

.dm-panel .dm-compose {
    flex-shrink: 0;
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
}

/* Mobile: full-screen takeover, no backdrop needed since it's opaque full screen */
@media (max-width: 1023px) {
    .dm-panel {
        width: 100%;
    }
    .dm-panel-overlay {
        display: none !important;
    }
}

/* Tablet/Desktop: docked panel, doesn't block the rest of the page */
@media (min-width: 1024px) {
    .dm-panel {
        top: var(--header-height);
        width: 400px;
        box-shadow: -8px 0 32px oklch(0 0 0 / 0.14);
        border-left: 1px solid var(--border-color);
    }
    body.dark-mode .dm-panel {
        box-shadow: -8px 0 32px oklch(0 0 0 / 0.4);
    }
    /* Non-blocking: no dimmed backdrop on desktop, matching Facebook/LinkedIn docked chat */
    .dm-panel-overlay {
        display: none !important;
    }
}

/* ── Campus post compose: multi-image preview strip ──────────────────── */
.campus-img-preview-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.campus-img-preview-thumb {
    position: relative;
    width: 76px;
    height: 76px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
}
.campus-img-preview-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.campus-img-preview-remove {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 0.7rem;
    line-height: 1;
    cursor: pointer;
    z-index: 1;
}
