/* ============================
   Reset & Variables
   ============================ */
:root {
    --bg: #0a0b14;
    --bg-card: rgba(30, 41, 59, 0.4);
    --bg-card-hover: rgba(30, 41, 59, 0.6);
    --bg-glass: rgba(15, 23, 42, 0.5);
    --text: #f8fafc;
    --text-dim: #94a3b8;
    --text-muted: #475569;
    --accent-1: #3b82f6; /* Primary Blue */
    --accent-2: #6366f1; /* Indigo */
    --accent-3: #22d3ee; /* Cyan/Light Blue */
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(59, 130, 246, 0.3);
    --glow-purple: rgba(59, 130, 246, 0.15); /* Updated to Blue Glow */
    --glow-cyan: rgba(34, 211, 238, 0.1);
    --radius: 14px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    /* Block copying */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* ============================
   Animated Background Orbs
   ============================ */
.bg-orbs {
    position: fixed; inset: 0;
    pointer-events: none; z-index: 0;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
    animation: orbFloat 20s ease-in-out infinite;
}

.orb-1 {
    width: 600px; height: 600px;
    background: radial-gradient(circle, var(--accent-1) 0%, transparent 70%);
    top: -200px; left: -100px;
    animation-duration: 25s;
}
.orb-2 {
    width: 500px; height: 500px;
    background: radial-gradient(circle, var(--accent-2) 0%, transparent 70%);
    top: 40%; right: -150px;
    animation-duration: 20s;
    animation-delay: -5s;
}
.orb-3 {
    width: 400px; height: 400px;
    background: radial-gradient(circle, var(--accent-3) 0%, transparent 70%);
    bottom: -100px; left: 30%;
    animation-duration: 22s;
    animation-delay: -10s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(60px, -40px) scale(1.1); }
    50% { transform: translate(-30px, 50px) scale(0.95); }
    75% { transform: translate(40px, 20px) scale(1.05); }
}

/* ============================
   Hero
   ============================ */
.hero {
    position: relative; z-index: 1;
    padding: 72px 24px 48px;
    text-align: center;
}

.hero-content {
    max-width: 640px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 100px;
    font-size: 0.75rem;
    color: #93c5fd;
    font-weight: 600;
    margin-bottom: 24px;
    gap: 8px;
    letter-spacing: 0.02em;
}

.creator-link-hero {
    text-decoration: none;
    color: #c4b5fd;
    background: rgba(124, 58, 237, 0.15);
    border-color: rgba(124, 58, 237, 0.3);
    transition: all 0.2s ease;
    cursor: pointer;
    margin-left: 8px;
}

.creator-link-hero:hover {
    background: rgba(124, 58, 237, 0.25);
    border-color: rgba(124, 58, 237, 0.4);
    transform: translateY(-1px);
    color: #ddd6fe;
}

.hero-title {
    font-size: clamp(2.2rem, 6vw, 3.6rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
}

.hero-title-line {
    display: block;
    color: var(--text);
}

.hero-title-gradient {
    display: block;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2), var(--accent-3));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.05rem;
    color: var(--text-dim);
    margin-bottom: 32px;
    font-weight: 400;
}

.counter {
    color: var(--accent-2);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* Hero Search */
.hero-search {
    position: relative;
    width: 100%;
    max-width: 650px;
    margin: 24px auto 0;
    z-index: 5;
}

@media (max-width: 768px) {
    .hero-search { display: none; } /* Hide hero search on mobile to avoid double-search clutter */
    .hero-subtitle { margin-bottom: 24px; }
}

.search-icon {
    position: absolute;
    left: 20px; top: 50%; transform: translateY(-50%);
    width: 20px; height: 20px;
    color: var(--text-muted);
    pointer-events: none;
    transition: color var(--transition);
}

.hero-search:focus-within .search-icon { color: var(--accent-2); }

#searchInput {
    width: 100%;
    padding: 16px 48px 16px 52px;
    background: rgba(255, 255, 255, 0.04);
    border: 1.5px solid var(--border);
    border-radius: 16px;
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

#searchInput::placeholder { color: var(--text-muted); }

#searchInput:focus {
    border-color: var(--accent-1);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 4px var(--glow-purple), 0 8px 32px rgba(0,0,0,0.3);
}

.clear-btn {
    position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
    background: none; border: none; padding: 6px; cursor: pointer;
    color: var(--text-muted); opacity: 0; transition: all var(--transition);
    border-radius: 50%;
}
.clear-btn:hover { color: var(--text); background: rgba(255,255,255,0.08); }
.clear-btn.visible { opacity: 1; }
.clear-btn svg { width: 18px; height: 18px; display: block; }

/* ============================
   Filter Bar
   ============================ */
.filter-bar {
    position: sticky;
    top: 0; z-index: 100;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border);
    padding: 10px 16px;
    /* Prevent horizontal scrolling entirely */
    overflow: visible;
}

.filter-bar-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px; /* Compact gap */
}

.desktop-filters {
    display: flex;
    align-items: center;
    gap: 12px;
}

.filter-group-inline {
    display: flex;
    gap: 6px;
}

.filter-toggle-btn {
    display: none; /* Hidden on Desktop by default */
    align-items: center;
    gap: 8px;
    padding: 8px 12px !important;
    font-size: 0.85rem !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid var(--border) !important;
    color: var(--text) !important;
    border-radius: 10px !important;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.filter-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: var(--accent-1) !important;
}

@media (max-width: 768px) {
    .filter-bar { padding: 8px 12px; }
    .filter-bar-inner { 
        gap: 6px; 
        display: flex;
        align-items: center;
        justify-content: space-between;
        overflow: hidden;
        flex-wrap: nowrap;
        padding: 0 0 2px 0;
    }
    
    .desktop-filters { display: none; }
    .filter-toggle-btn { 
        display: flex; 
        flex-shrink: 0;
        padding: 8px 10px !important;
        font-size: 0.75rem !important;
        gap: 6px;
    }
    .filter-toggle-btn span { display: block; } 
    
    .bar-search {
        order: 2;
        flex: 1; 
        margin: 0 6px;
        min-width: 80px;
        width: auto;
    }
    
    .filter-toggle-btn { order: 1; }
    #trendingTabBtn { order: 3; }
    
    #trendingTabBtn {
        padding: 8px 10px !important;
        font-size: 0.82rem !important;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        gap: 6px;
    }
    #trendingTabBtn .trending-text { display: inline !important; font-size: 0.75rem; } 

    #barSearchInput {
        font-size: 0.85rem;
        padding: 6px 0;
    }
}

@media (min-width: 480px) {
    .filter-toggle-btn span { display: inline; }
    #trendingTabBtn .trending-text { display: inline; }
}

.filter-group { display: flex; gap: 8px; flex-wrap: wrap; }

.filter-divider {
    width: 1px; height: 18px;
    background: var(--border);
    margin: 0 4px;
    flex-shrink: 0;
}

.chip {
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-dim);
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

/* Removed redundant mobile media query */

.chip:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
}

.chip.active {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    border-color: rgba(59, 130, 246, 0.4);
}

.chip-bba.active {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    border-color: rgba(99, 102, 241, 0.4);
}

.chip-bca.active {
    background: rgba(6, 182, 212, 0.12);
    color: #67e8f9;
    border-color: rgba(6, 182, 212, 0.25);
}

/* Bar Search (inside sticky filter bar) */
.bar-search {
    display: flex; align-items: center; gap: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0 12px;
    margin-left: auto;
    flex-shrink: 0;
    transition: all var(--transition);
}

.custom-shoutout-input {
    width: 100%;
    min-height: 120px;
    background: rgba(255, 255, 255, 0.05);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    color: #fff;
    font-family: inherit;
    font-size: 1.1rem;
    line-height: 1.5;
    outline: none;
    resize: none;
    transition: all 0.3s ease;
}

.custom-shoutout-input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-1);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

.send-custom-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    color: #fff; border: none; border-radius: 12px;
    font-weight: 800; font-size: 1.1rem; cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.3);
}

.send-custom-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(124, 58, 237, 0.4);
}

.bar-search:focus-within {
    border-color: var(--accent-1);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 2px var(--glow-purple);
}

.bar-search svg {
    width: 16px; height: 16px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.bar-search:focus-within svg { color: var(--accent-2); }

#barSearchInput {
    background: none; border: none; outline: none;
    color: var(--text); font-family: inherit;
    font-size: 0.95rem; padding: 10px 0;
    width: 100%;
}

#barSearchInput::placeholder { color: var(--text-muted); }

/* ============================
   Filter Sidebar
   ============================ */
.sidebar-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 999;
    opacity: 0; visibility: hidden;
    transition: all 0.4s ease;
}
.sidebar-overlay.active { opacity: 1; visibility: visible; }

.filter-sidebar {
    position: fixed; top: 0; left: -360px;
    width: 360px; height: 100%;
    background: #0d0e1a;
    border-right: 1px solid var(--border);
    z-index: 1000;
    display: flex; flex-direction: column;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 20px 0 60px rgba(0,0,0,0.5);
}
.filter-sidebar.active { transform: translateX(360px); }

.sidebar-header {
    padding: 24px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}
.sidebar-header h3 { font-size: 1.4rem; font-weight: 800; color: #fff; }
.sidebar-close {
    background: none; border: none; color: var(--text-muted);
    font-size: 2rem; cursor: pointer; padding: 4px; line-height: 1;
}

.sidebar-content { padding: 24px; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 32px; }
.sidebar-section label { display: block; font-size: 0.9rem; font-weight: 700; color: var(--text-dim); margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.05em; }

.apply-filters-btn {
    margin-top: auto;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    color: #fff; border: none; padding: 16px; border-radius: 12px;
    font-weight: 800; font-size: 1rem; cursor: pointer;
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.3);
    transition: all 0.3s ease;
}
.apply-filters-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(124, 58, 237, 0.4); }

/* ============================
   Results Bar
   ============================ */
.results-bar {
    max-width: 1400px; margin: 0 auto;
    padding: 20px 24px 8px;
    display: flex; align-items: center; justify-content: space-between;
    position: relative; z-index: 1;
}

#resultsText {
    font-size: 0.82rem; color: var(--text-muted); font-weight: 400;
}
#resultsText strong { color: var(--text-dim); font-weight: 600; }

.results-badge {
    font-size: 0.72rem;
    color: var(--accent-2);
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.15);
    padding: 4px 12px;
    border-radius: 100px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* ============================
   Loading
   ============================ */
.loading {
    display: flex; flex-direction: column;
    align-items: center; padding: 80px 24px;
    position: relative; z-index: 1;
}
.loading.hidden { display: none; }

.loading-dots { display: flex; gap: 8px; margin-bottom: 20px; }
.dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--accent-1);
    animation: dotPulse 1.4s ease-in-out infinite;
}
.dot:nth-child(2) { animation-delay: 0.15s; background: var(--accent-2); }
.dot:nth-child(3) { animation-delay: 0.3s; background: var(--accent-3); }

@keyframes dotPulse {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

.loading p { font-size: 0.85rem; color: var(--text-muted); }

/* ============================
   Grid
   ============================ */
.grid {
    max-width: 1400px; margin: 0 auto;
    padding: 12px 24px 80px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    position: relative; z-index: 1;
}

/* ============================
   Student Card — 3D Tilt
   ============================ */
.student-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    animation: cardIn 0.3s ease both;
    transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    transform-style: preserve-3d;
    will-change: transform;
}

.student-card:hover {
    border-color: var(--border-hover);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(124, 58, 237, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    z-index: 2;
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Image */
.card-img {
    width: 100%;
    aspect-ratio: 1 / 1.15;
    overflow: hidden;
    position: relative;
    background: linear-gradient(135deg, #111118, #1a1a28);
}

.card-img img {
    width: 100%; height: 100%;
    object-fit: contain;
    transition: transform 0.25s ease;
    position: relative;
    z-index: 2;
}

.student-card:hover .card-img img {
    transform: scale(1.05);
}

.card-img .initials {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; font-weight: 800;
    color: rgba(255, 255, 255, 0.08);
    background: linear-gradient(135deg, #111118, #1a1a28);
}

/* Branch Tag */
.card-tag {
    position: absolute; top: 8px; right: 8px;
    padding: 3px 9px; border-radius: 8px;
    font-size: 0.62rem; font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    z-index: 3;
}

.card-tag.bba {
    background: rgba(236, 72, 153, 0.25);
    color: #f9a8d4;
    backdrop-filter: blur(6px);
}
.card-tag.bca {
    background: rgba(6, 182, 212, 0.25);
    color: #67e8f9;
    backdrop-filter: blur(6px);
}

/* Card Body */
.card-body { padding: 12px 14px 14px; }

.card-name {
    font-size: 0.85rem; font-weight: 600;
    color: var(--text); line-height: 1.3;
    margin-bottom: 6px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.card-meta {
    display: flex; align-items: center;
    justify-content: space-between; gap: 6px;
}

.card-id {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent-2);
    font-variant-numeric: tabular-nums;
}

.card-sec {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
}

/* Creator Card Highlight */
.student-card.creator-highlight {
    border: 1.5px solid transparent;
    background-image: linear-gradient(rgba(20,20,30,0.95), rgba(20,20,30,0.95)),
                       linear-gradient(135deg, var(--accent-1), var(--accent-3), var(--accent-2));
    background-origin: border-box;
    background-clip: padding-box, border-box;
}

.creator-tag {
    position: absolute; bottom: 8px; left: 8px;
    top: auto !important; right: auto !important;
    background: rgba(124, 58, 237, 0.35) !important;
    color: #c4b5fd !important;
    backdrop-filter: blur(6px);
    z-index: 3;
}

/* Footer credit */
.footer-credit {
    margin-top: 8px;
}

.footer-credit a {
    color: var(--accent-1);
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 500;
    transition: color 0.2s;
}

.footer-credit a:hover { color: var(--accent-2); }

/* ============================
   Empty State
   ============================ */
.empty-state {
    text-align: center; padding: 80px 24px;
    position: relative; z-index: 1;
}
.empty-icon { font-size: 3rem; margin-bottom: 16px; }
.empty-state h3 { font-size: 1.1rem; color: var(--text-dim); margin-bottom: 4px; }
.empty-state p { font-size: 0.85rem; color: var(--text-muted); }

/* ============================
   FAB (Back to Top)
   ============================ */
.fab {
    position: fixed; bottom: 24px; right: 24px; z-index: 200;
    width: 48px; height: 48px; border-radius: 14px;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    border: none; color: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.35);
    opacity: 0; visibility: hidden; transform: translateY(16px) scale(0.9);
    transition: all 0.3s ease;
}
.fab.visible {
    opacity: 1; visibility: visible;
    transform: translateY(0) scale(1);
}
.fab:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 32px rgba(124, 58, 237, 0.5);
}
.fab svg { width: 22px; height: 22px; }

/* ============================
   Footer
   ============================ */
.footer {
    text-align: center; padding: 48px 24px;
    border-top: 1px solid var(--border);
    position: relative; z-index: 1;
}
.footer p { font-size: 0.8rem; color: var(--text-muted); }
.footer .footer-dim { margin-top: 4px; opacity: 0.5; font-size: 0.72rem; }

/* ============================
   Highlight
   ============================ */
mark {
    background: rgba(6, 182, 212, 0.25);
    color: var(--text);
    border-radius: 3px;
    padding: 0 2px;
}

/* ============================
   Profile Modal — Horizontal Split
   ============================ */
.modal-overlay {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex; align-items: center; justify-content: center;
    padding: 32px 20px;
    opacity: 0; visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1; visibility: visible;
}

.modal {
    position: relative;
    display: grid;
    grid-template-columns: 300px 1fr;
    background: rgba(16, 16, 24, 0.98);
    border: 1px solid var(--border-hover);
    border-radius: 18px;
    max-width: 860px;
    width: 100%;
    max-height: 85vh;
    overflow: hidden;
    transform: scale(0.92) translateY(20px);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow:
        0 32px 80px rgba(0, 0, 0, 0.65),
        0 0 0 1px rgba(124, 58, 237, 0.1),
        0 0 120px rgba(124, 58, 237, 0.06);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-close {
    position: absolute; top: 14px; right: 14px; z-index: 10;
    width: 36px; height: 36px; border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-dim); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all var(--transition);
}
.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
}
.modal-close svg { width: 18px; height: 18px; }

/* Left Panel */
.modal-left {
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #0e0e16, #131320);
    border-right: 1px solid var(--border);
    overflow: hidden;
}

.modal-photo {
    width: 100%;
    aspect-ratio: 1 / 1;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #111118, #1a1a28);
    flex-shrink: 0;
}

.modal-photo img {
    width: 100%; height: 100%;
    object-fit: contain;
    position: relative;
    z-index: 2;
}

.modal-initials {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 3.5rem; font-weight: 900;
    color: rgba(255, 255, 255, 0.06);
    background: linear-gradient(135deg, #111118, #1a1a28);
    z-index: 1;
}

.modal-info {
    padding: 20px 20px 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.modal-info h2 {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 2px;
    background: linear-gradient(135deg, var(--text), #c4b5fd);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal-student-id {
    font-size: 0.8rem;
    color: var(--accent-2);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    margin-bottom: 14px;
}

.modal-meta-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.modal-pill {
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.7rem;
    color: var(--text-dim);
    font-weight: 500;
}

/* Badge Summary (top badges on left panel) */
.modal-badge-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: auto;
}

.badge-summary-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(124, 58, 237, 0.1);
    border: 1px solid rgba(124, 58, 237, 0.15);
    border-radius: 8px;
    font-size: 0.68rem;
    color: #c4b5fd;
    font-weight: 500;
}

.badge-summary-item .badge-count {
    font-weight: 700;
    color: var(--accent-2);
}

/* Right Panel */
.modal-right {
    display: flex;
    flex-direction: column;
    padding: 24px;
    overflow-y: auto;
    max-height: 85vh;
    position: relative;
}

.modal-right::-webkit-scrollbar { width: 4px; }
.modal-right::-webkit-scrollbar-track { background: transparent; }
.modal-right::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 4px; }

.modal-right-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-shrink: 0;
    padding-right: 40px;
}

.modal-right-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.modal-right-subtitle {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 2px;
    display: block;
}

/* Send Badge Button */
.send-badge-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.25), rgba(236, 72, 153, 0.2));
    border: 1px solid rgba(124, 58, 237, 0.4);
    border-radius: 14px;
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.send-badge-btn:hover {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.35), rgba(236, 72, 153, 0.3));
    border-color: var(--accent-1);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.3);
}

/* Badge Picker */
.badge-picker {
    display: none;
    flex-direction: column;
    gap: 16px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 18px;
    margin-bottom: 24px;
    animation: pickerIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.badge-picker.active {
    display: flex;
}

@keyframes pickerIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.badge-picker-header {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
}

.badge-categories {
    display: flex;
    gap: 6px;
}

.badge-cat {
    padding: 10px 20px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

.badge-cat:hover {
    color: var(--text-dim);
    background: rgba(255, 255, 255, 0.08);
}

.badge-cat.active {
    background: rgba(124, 58, 237, 0.2);
    color: #fff;
    border-color: var(--accent-1);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.2);
}

.badge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 6px;
    max-height: 180px;
    overflow-y: auto;
    padding-right: 4px;
}

.badge-grid::-webkit-scrollbar { width: 3px; }
.badge-grid::-webkit-scrollbar-track { background: transparent; }
.badge-grid::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.06); border-radius: 3px; }

.badge-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    font-size: 0.9rem;
    color: var(--text-dim);
    font-weight: 600;
}

.badge-option:hover {
    background: rgba(124, 58, 237, 0.15);
    border-color: var(--accent-1);
    color: #fff;
    transform: scale(1.04);
}

.badge-option:active {
    transform: scale(0.96);
}

.badge-option .badge-emoji {
    font-size: 1.4rem;
    line-height: 1;
}

.badge-option.sent {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.25);
    color: #86efac;
    pointer-events: none;
}

/* Custom Shoutout Area */
.custom-shoutout-area {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.auth-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed var(--border-hover);
    border-radius: 12px;
    text-align: center;
}

.auth-prompt p {
    font-size: 0.82rem;
    color: var(--text-dim);
    margin-bottom: 16px;
    font-weight: 500;
}

.google-login-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: white;
    color: #3c4043;
    border: none;
    border-radius: 100px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.google-login-btn:hover {
    background: #f8f9fa;
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

.custom-input-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.custom-warning {
    font-size: 0.72rem;
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 10px 14px;
    border-radius: 8px;
    line-height: 1.4;
}

.custom-warning strong {
    color: #f87171;
}

#customShoutoutInput {
    width: 100%;
    min-height: 80px;
    resize: none;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
    transition: all 0.2s;
}

#customShoutoutInput:focus {
    border-color: var(--accent-1);
    background: rgba(255, 255, 255, 0.05);
}

.custom-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.custom-user-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.04);
    padding: 6px 14px 6px 6px;
    border-radius: 100px;
}

#customUserPhoto {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

#customUserName {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-dim);
}

.logout-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.7rem;
    padding: 0 4px;
}

.logout-btn:hover {
    color: #fca5a5;
}

.send-custom-btn {
    padding: 8px 18px;
    background: var(--accent-1);
    color: white;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.send-custom-btn:hover {
    background: #6d28d9;
}

/* Toasts */
.cooldown-toast, .success-toast {
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 12px;
    display: none;
    animation: toastIn 0.3s ease both;
    flex-shrink: 0;
}

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

.cooldown-toast {
    background: rgba(234, 179, 8, 0.1);
    border: 1px solid rgba(234, 179, 8, 0.2);
    color: #fde047;
}

.success-toast {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: #86efac;
}

.cooldown-toast.visible, .success-toast.visible {
    display: block;
}

/* Shoutout Feed */
.shoutout-feed {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
}

.shoutout-feed::-webkit-scrollbar { width: 3px; }
.shoutout-feed::-webkit-scrollbar-track { background: transparent; }
.shoutout-feed::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.06); border-radius: 3px; }

.shoutout-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--border);
    border-radius: 10px;
    animation: shoutoutIn 0.3s ease both;
    transition: background 0.2s ease;
}

.shoutout-item.custom-chat {
    align-items: flex-start;
    padding: 14px;
    border-color: rgba(124, 58, 237, 0.2);
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.03), rgba(255, 255, 255, 0.01));
}

.shoutout-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

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

/* Chat bubble styling for custom shoutouts */
.chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    margin-top: 2px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.chat-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 6px;
}

.chat-sender {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-time {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.chat-bubble {
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 14px;
    border-radius: 4px 14px 14px 14px;
    word-break: break-word;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.chat-menu-btn {
    background: none; border: none; color: var(--text-muted); cursor: pointer;
    font-size: 1.2rem; line-height: 1; padding: 0 4px; border-radius: 4px;
    transition: 0.2s; font-weight: bold;
}
.chat-menu-btn:hover { color: #fca5a5; background: rgba(255,255,255,0.05); }

/* Refined Share Button */
.shoutout-share-btn {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: #93c5fd;
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 0.68rem;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-left: auto;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.shoutout-share-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
    color: #fff;
}

.preset-btn-del {
    position: absolute; right: 10px; top: 10px;
    background: none; border: none; color: var(--text-muted); cursor: pointer;
    font-size: 0.9rem; line-height: 1; padding: 4px;
    transition: 0.2s; border-radius: 50%; width: 24px; height: 24px;
    display: flex; align-items: center; justify-content: center;
}
.preset-btn-del:hover { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }

.chat-admin-actions {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}

.chat-btn-del, .chat-btn-block {
    background: rgba(239, 68, 68, 0.1); color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 4px 8px; border-radius: 6px; font-size: 0.65rem; cursor: pointer;
    font-weight: 600;
}

.chat-btn-block {
    background: rgba(245, 158, 11, 0.1); color: #fcd34d;
    border-color: rgba(245, 158, 11, 0.2);
}

.shoutout-emoji {
    font-size: 1.5rem;
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 10px;
    flex-shrink: 0;
}

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

.shoutout-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}

.shoutout-time {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 400;
}

.shoutout-anonymous {
    font-size: 0.62rem;
    color: var(--text-muted);
    opacity: 0.6;
    font-style: italic;
}

/* Shoutout Loading */
.shoutout-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 32px 0;
    color: var(--text-muted);
    font-size: 0.78rem;
}

/* Shoutout Empty State */
.shoutout-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    flex: 1;
}

.shoutout-empty-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

.shoutout-empty p {
    font-size: 0.9rem;
    color: var(--text-dim);
    font-weight: 600;
    margin-bottom: 4px;
}

.shoutout-empty span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

body.modal-open { overflow: hidden; }

/* ============================
   Responsive
   ============================ */
@media (max-width: 768px) {
    .hero { padding: 48px 20px 36px; }
    .hero-title { font-size: 2rem; }
    .hero-subtitle { font-size: 0.9rem; }

    .filter-bar { padding: 10px 0; border-bottom: 1px solid var(--border); }
    .filter-divider { height: 20px; width: 1px; border-left: 1px solid rgba(255,255,255,0.1); flex-shrink: 0; display: block; margin: 0 4px; }
    /* filter-bar-inner and bar-search handled in top media query to avoid conflicts */
    .chip { padding: 8px 16px; font-size: 0.82rem; flex-shrink: 0; }

    .grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px; padding: 10px 16px 60px;
    }

    .results-bar { padding: 14px 16px 6px; }
    .card-body { padding: 10px 12px 12px; }
    .card-name { font-size: 0.78rem; }
    .card-id { font-size: 0.68rem; }

    /* Modal stacks vertically on mobile */
    .modal-overlay { padding: 16px 12px; }
    .modal {
        grid-template-columns: 1fr;
        max-width: 440px;
        max-height: 92vh;
        border-radius: 20px;
    }
    .modal-left {
        flex-direction: row;
        border-right: none;
        border-bottom: 1px solid var(--border);
        background: rgba(255, 255, 255, 0.02);
    }
    .modal-photo {
        width: 180px; /* Increased and consistent size */
        height: 180px;
        aspect-ratio: 1/1;
        flex-shrink: 0;
        margin: 16px auto; /* Centered */
        border-radius: 20px;
    }
    .modal-initials { font-size: 2.2rem; }
    .modal-info { 
        padding: 10px 16px; 
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .modal-info h2 { font-size: 1.2rem; }
    .modal-student-id { margin-bottom: 8px; font-size: 0.8rem; }
    .modal-meta-pills { margin-bottom: 8px; justify-content: center; }
    .modal-pill { padding: 4px 12px; font-size: 0.75rem; }
    
    .modal-right { 
        padding: 20px 16px; 
        max-height: 60vh; 
        min-height: 300px;
    }
    
    .modal-right-header { 
        flex-direction: column; 
        align-items: center; 
        text-align: center;
        gap: 16px; 
        margin-bottom: 24px;
        padding-right: 0; 
    }
    
    .send-badge-btn { 
        align-self: center; 
        justify-content: center; 
        width: auto;
        min-width: 180px;
        padding: 10px 24px !important;
        font-size: 0.9rem !important;
        border-radius: 100px !important;
        margin-top: 4px;
    }

    /* Cancel state removed as requested */
    .send-badge-btn.active {
        display: none !important;
    }
    
    .badge-grid { grid-template-columns: repeat(2, 1fr); max-height: 200px; }
    .badge-categories { flex-wrap: wrap; justify-content: center; gap: 6px; }
    .badge-cat { padding: 8px 14px; font-size: 0.75rem; }

    #customShoutoutInput {
        min-height: 140px !important; /* Larger text area */
        font-size: 1rem !important;
        background: rgba(255, 255, 255, 0.04) !important;
        padding: 16px !important;
    }
}

@media (max-width: 480px) {
    .hero { padding: 36px 16px 28px; }
    .hero-badge { font-size: 0.68rem; padding: 5px 12px; }
    .hero-title { font-size: 1.7rem; }
    #searchInput { padding: 14px 44px 14px 46px; font-size: 0.9rem; }

    .grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .card-sec { display: none; }

    .modal { max-width: 100%; border-radius: 0; height: 95vh; }
    .modal-left { 
        flex-direction: column; 
        align-items: center; 
        padding: 20px 10px;
        text-align: center;
    }
    .modal-photo { 
        width: 180px !important; 
        height: 180px !important; 
        margin: 10px auto !important; 
        border-radius: 20px;
    }
    .modal-info h2 { font-size: 1.3rem; }
    .modal-right { max-height: 55vh; }
    .badge-grid { grid-template-columns: repeat(2, 1fr); }
    #customShoutoutInput { min-height: 160px !important; }
}

/* ============================
   Notice Board Modal
   ============================ */
.notice-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(10, 11, 20, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    display: none; /* Controlled by JS */
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.notice-overlay.active {
    display: flex;
    opacity: 1;
}

.notice-modal {
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: 28px;
    width: 100%;
    max-width: 500px;
    padding: 32px;
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5), 0 0 40px var(--glow-purple);
    transform: translateY(30px) scale(0.95);
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.notice-overlay.active .notice-modal {
    transform: translateY(0) scale(1);
}

.notice-header {
    text-align: center;
    margin-bottom: 24px;
}

.notice-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 12px;
}

.notice-header h2 {
    font-size: 0.85rem;
    letter-spacing: 0.3em;
    color: var(--accent-1);
    font-weight: 800;
    margin: 0;
}

.notice-content h3 {
    font-size: 1.5rem;
    margin-bottom: 16px;
    color: #fff;
    font-weight: 700;
    line-height: 1.3;
}

.notice-content p {
    color: var(--text-dim);
    line-height: 1.6;
    margin-bottom: 20px;
    font-size: 1rem;
}

.notice-feature {
    display: flex;
    gap: 16px;
    background: rgba(255, 255, 255, 0.03);
    padding: 16px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 24px;
}

.feature-dot {
    width: 10px; height: 10px;
    background: var(--accent-2);
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
    box-shadow: 0 0 10px var(--accent-2);
}

.notice-feature strong {
    color: var(--text);
    display: block;
    margin-bottom: 4px;
}

.notice-feature p {
    margin: 0;
    font-size: 0.9rem;
}

.notice-cta {
    text-align: center;
    padding: 12px;
    border-top: 1px solid var(--border);
    margin-top: 8px;
}

.notice-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    border: none;
    border-radius: 16px;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.notice-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.5);
    filter: brightness(1.1);
}

@media (max-width: 480px) {
    .notice-modal { padding: 24px; border-radius: 24px; }
    .notice-content h3 { font-size: 1.3rem; }
    .notice-content p { font-size: 0.9rem; }
}
