/* =============================================
   DRB NETWORK DATABASE — Premium Dark Theme
   ============================================= */

:root {
    /* --- Core Palette --- */
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.07);
    --bg-glass: rgba(17, 24, 39, 0.7);

    /* --- Accent --- */
    --carolina-blue: #7BAFD4;
    --carolina-blue-bright: #93c5e8;
    --accent-glow: rgba(123, 175, 212, 0.25);
    --accent-gradient: linear-gradient(135deg, #7BAFD4, #5a9bc8);
    --gold: #d4a853;
    --gold-soft: rgba(212, 168, 83, 0.15);

    /* --- Text --- */
    --text-primary: #e8ecf1;
    --text-secondary: #9aa4b4;
    --text-muted: #8090a5;

    /* --- Borders --- */
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(123, 175, 212, 0.2);

    /* --- Sizing --- */
    --header-height: 72px;

    /* --- Year Colors --- */
    --year-yellow: #fbbf24;
    --year-purple: #a78bfa;
    --year-green: #34d399;
    --year-orange: #fb923c;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Ambient Background Glow --- */
.bg-glow {
    position: fixed;
    top: -30%;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 600px;
    background: radial-gradient(ellipse, rgba(123, 175, 212, 0.06) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* =============================================
   LOGIN SCREEN
   ============================================= */
#login-screen {
    position: fixed;
    inset: 0;
    background-color: var(--bg-primary);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    z-index: 2000;
    overflow-y: auto;
    padding: 40px 20px;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

#login-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.login-box {
    background: linear-gradient(180deg, rgba(20, 25, 37, 0.96), rgba(14, 19, 30, 0.94));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 42px 44px;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.38), 0 0 110px rgba(123, 175, 212, 0.08);
    text-align: left;
    max-width: 760px;
    width: 100%;
    margin: auto 0;
}

.login-hero {
    max-width: 100%;
    margin-bottom: 26px;
}

.login-kicker {
    margin: 0 0 12px;
    font-size: 0.74em;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--carolina-blue);
}

.login-box h1 {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: clamp(2.15rem, 3.8vw, 2.95rem);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 10px;
    letter-spacing: -0.02em;
}

.login-box p {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.96em;
}

.login-intro {
    margin: 0;
    max-width: none;
}

.login-access-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.login-panel {
    border: 1px solid var(--border-color);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.03);
    padding: 28px;
}

.login-panel-unified {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(123, 175, 212, 0.08));
    border: 1px solid rgba(123, 175, 212, 0.15);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.login-panel-grid {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.login-panel-block {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-primary-pane {
    padding-right: 0;
}

.login-secondary-pane {
    padding: 22px 0 0;
    border-radius: 0;
    background: transparent;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.login-panel-block .login-panel-header {
    margin-bottom: 0;
}

.login-panel-primary {
    background: linear-gradient(180deg, rgba(123, 175, 212, 0.08), rgba(255, 255, 255, 0.02));
}

.login-panel-secondary {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(123, 175, 212, 0.03));
}

.login-panel-header {
    margin-bottom: 16px;
}

.login-panel-eyebrow {
    margin: 0 0 10px;
    font-size: 0.72em;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--carolina-blue);
}

.login-panel-header h2 {
    margin: 0 0 8px;
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 1.45em;
    color: var(--text-primary);
}

.login-panel-header p {
    margin: 0;
    max-width: none;
}

#login-form #email-step,
#login-form #otp-step {
    display: grid;
    gap: 12px;
}

#login-form input {
    width: 100%;
    padding: 15px 16px;
    font-size: 1em;
    font-family: 'Inter', sans-serif;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    color: var(--text-primary);
    outline: none;
    margin-bottom: 0;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#login-form input:focus {
    border-color: var(--carolina-blue);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

#login-form input::placeholder {
    color: var(--text-muted);
}

#login-form button {
    width: 100%;
    padding: 15px 18px;
    font-size: 0.96em;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    color: white;
    background: var(--accent-gradient);
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 15px var(--accent-glow);
}

#login-form button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 25px rgba(123, 175, 212, 0.4);
}

#login-form button:disabled {
    background: var(--text-muted);
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

#login-form #resend-btn {
    background: transparent;
    color: var(--text-muted);
    border: none;
    width: auto;
    margin-top: 0;
    padding: 0;
    font-size: 0.88em;
    align-self: flex-start;
    box-shadow: none;
}

#login-form #resend-btn:hover {
    background: transparent;
    color: var(--text-primary);
    transform: none;
    box-shadow: none;
}

#login-message,
#otp-message {
    margin: 0;
    font-size: 0.85em;
    min-height: 1.2em;
    color: var(--text-secondary);
}

#login-message.error,
#otp-message.error { color: #ef4444; }

#survey-link-container {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 16px;
}

.request-access-copy,
.request-access-note {
    margin: 0;
    font-size: 0.84em;
    color: var(--text-muted);
}

.request-access-note {
    max-width: none;
    line-height: 1.5;
}

.login-request-list {
    margin: 18px 0 0;
    padding-left: 18px;
    color: var(--text-secondary);
    font-size: 0.88em;
    line-height: 1.7;
}

.login-request-list li + li {
    margin-top: 6px;
}

.request-access-trigger {
    width: auto;
    min-width: 220px;
    padding: 14px 16px;
    font-size: 0.92em;
    font-weight: 600;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    cursor: pointer;
    position: relative;
    z-index: 10;
    transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.request-access-trigger:hover {
    border-color: rgba(123, 175, 212, 0.55);
    background: rgba(123, 175, 212, 0.08);
    transform: translateY(-1px);
}

/* Premium Login Redesign Elements */
.premium-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.75em;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--carolina-blue);
    box-shadow: 0 0 8px var(--carolina-blue);
}

.request-features {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
}

.request-feature-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-height: 0;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
}

.request-feature-item:last-child {
    grid-column: auto;
}

.feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 10px;
    background: rgba(123, 175, 212, 0.1);
    color: var(--carolina-blue);
    flex-shrink: 0;
}

.feature-text {
    font-size: 0.88em;
    color: var(--text-secondary);
    line-height: 1.35;
    padding-top: 0;
}

.request-access-trigger {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.request-access-trigger .trigger-icon {
    transition: transform 0.2s ease;
}

.request-access-trigger:hover .trigger-icon {
    transform: translateX(3px);
}

@media (max-width: 920px) {
    .login-box {
        max-width: 680px;
        padding: 34px 30px;
    }
}


/* --- Hide main content initially --- */
#page-top-bar, #filter-panel, #app-container { display: none; }

body.logged-in #login-screen { display: none; }
body.logged-in #page-top-bar,
body.logged-in #filter-panel,
body.logged-in #app-container { display: block; }
body.logged-in #page-top-bar { display: flex; }

/* =============================================
   HEADER
   ============================================= */
#page-top-bar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(10, 14, 23, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    padding: 0 24px;
    height: var(--header-height);
    justify-content: space-between;
    align-items: center;
}

#page-header { text-align: left; }

#page-header h1 {
    font-family: 'Outfit', 'Inter', sans-serif;
    color: var(--text-primary);
    margin: 0;
    font-size: 1.35em;
    font-weight: 700;
    letter-spacing: -0.02em;
}

#page-header p {
    font-style: italic;
    color: var(--text-muted);
    margin: 3px 0 0 0;
    font-size: 0.8em;
    letter-spacing: 0.5px;
}

/* --- Header Controls --- */
.header-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

#sort-control {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 999px;
    padding: 3px;
    border: 1px solid rgba(123, 175, 212, 0.25);
}

.sort-btn {
    min-height: 30px;
    padding: 0 12px;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.sort-btn.active {
    color: var(--text-primary);
    background: rgba(123, 175, 212, 0.16);
    box-shadow: inset 0 0 0 1px rgba(123, 175, 212, 0.24);
}

.sort-btn:hover:not(.active) {
    color: var(--text-primary);
}

#toggle-filters-btn {
    min-height: 38px;
    padding: 0 14px;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(123, 175, 212, 0.25);
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#toggle-filters-btn:hover {
    background: rgba(123, 175, 212, 0.12);
    border-color: var(--border-glow);
    color: var(--carolina-blue);
}

.filter-badge {
    display: inline-block;
    background: var(--carolina-blue);
    color: var(--bg-primary);
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border-radius: 999px;
    margin-left: 6px;
    vertical-align: middle;
}

.results-summary {
    text-align: center;
    padding: 8px 16px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-color);
}

/* --- Skeleton Loading --- */
.skeleton-card {
    background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 12px;
    height: 80px;
}
.skeleton-card.tall { height: 280px; }
@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* --- Search Bar --- */
.header-search {
    flex: 1;
    max-width: 300px;
    margin: 0 12px;
}

#search-input {
    width: 100%;
    padding: 10px 16px;
    font-size: 0.85em;
    font-family: 'Inter', sans-serif;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#search-input:focus {
    border-color: var(--carolina-blue);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: rgba(255, 255, 255, 0.07);
}

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

/* --- View Toggle --- */
.view-toggle {
    display: flex;
    gap: 3px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 3px;
    border: 1px solid var(--border-color);
}

.view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
}

.view-btn.active {
    background: rgba(123, 175, 212, 0.15);
    color: var(--carolina-blue);
}

.view-btn:hover:not(.active) { color: var(--text-secondary); }

/* --- Logout Button --- */
.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    background: transparent;
    border: 1px solid rgba(123, 175, 212, 0.25);
    border-radius: 999px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

/* =============================================
   FILTER PANEL
   ============================================= */
#filter-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-out, opacity 0.3s ease-out, padding 0.5s ease-out;
    padding: 0;
}

body.filters-visible #filter-panel {
    max-height: 70vh;
    opacity: 1;
    overflow-y: auto;
    padding: 25px;
}

#filter-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    max-width: 1400px;
    margin: 0 auto;
}

.filter-group { display: flex; flex-direction: column; gap: 8px; }
.master-filter-control { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; position: relative; }
.master-filter-control input[type="checkbox"] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.master-filter-control .filter-label-text { font-weight: 600; font-size: 0.9em; color: var(--text-primary); cursor: pointer; }

.custom-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    display: inline-block;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
    background: rgba(255,255,255,0.03);
    pointer-events: none;
}

.master-filter-control input:checked + .custom-checkbox {
    background: var(--accent-gradient);
    border-color: var(--carolina-blue);
    box-shadow: 0 0 8px var(--accent-glow);
}

.custom-checkbox::after {
    content: '';
    position: absolute;
    display: none;
    left: 5px; top: 1px;
    width: 5px; height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    pointer-events: none;
}

.master-filter-control input:checked + .custom-checkbox::after { display: block; }

.master-filter-control .arrow {
    margin-left: auto;
    border: solid var(--text-muted);
    border-width: 0 2px 2px 0;
    display: inline-block;
    padding: 3px;
    transform: rotate(45deg);
    transition: transform 0.3s ease-out;
}

.master-filter-control.expanded .arrow { transform: rotate(-135deg); }

.options-container {
    padding-left: 26px; /* Indent sub-items to sit below parent category label */
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s ease-out, opacity 0.3s ease-out, margin-top 0.4s ease-out;
}

.options-container.expanded {
    margin-top: 10px;
    max-height: 250px;
    overflow-y: auto;
    opacity: 1;
}

.sub-filter-group { display: flex; align-items: center; gap: 8px; }
.sub-filter-group label { font-weight: 400; font-size: 0.85em; color: var(--text-secondary); cursor: pointer; }
.major-category-group, .university-category-group, .industry-category-group { margin-bottom: 10px; }
.major-category-group > .sub-filter-group > label,
.university-category-group > .sub-filter-group > label,
.industry-category-group > .sub-filter-group > label { font-weight: 600; }
.major-sub-options, .university-sub-options, .industry-sub-options {
    padding-left: 26px; /* Indent sub-items to sit below parent category label */
    display: flex; flex-direction: column; gap: 10px; margin-top: 8px;
}

.filter-close-mobile {
    display: none;
    position: sticky;
    top: 0;
    z-index: 1;
    align-self: flex-end;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    margin-bottom: 8px;
}

/* =============================================
   APP CONTAINER
   ============================================= */
#app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 24px;
    position: relative;
    z-index: 1;
}

#main-content { width: 100%; }

/* =============================================
   STATS DASHBOARD
   ============================================= */
#dashboard-view {
    padding: 0;
    max-width: 1200px;
    margin: 0 auto;
}

#stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 48px;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px;
    padding: 28px 20px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity 0.25s;
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-glow);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3), 0 0 40px var(--accent-glow);
}

.stat-card:hover::before { opacity: 1; }

.stat-card.stat-anniversary::before { background: linear-gradient(90deg, #7BAFD4, #5a9bc8); } /* Blue */
.stat-card.stat-total::before { background: linear-gradient(90deg, #facc15, #eab308); } /* Yellow */
.stat-card.stat-cities::before { background: linear-gradient(90deg, #a78bfa, #8b5cf6); } /* Purple */
.stat-card.stat-industries::before { background: linear-gradient(90deg, #34d399, #10b981); } /* Green */
.stat-card.stat-classes::before { background: linear-gradient(90deg, #fb923c, #f97316); } /* Orange */

.stat-number {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 3em;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 8px;
}

.stat-card.stat-anniversary .stat-number { color: #7BAFD4; text-shadow: 0 0 30px rgba(123, 175, 212, 0.25); }
.stat-card.stat-total .stat-number { color: #facc15; text-shadow: 0 0 30px rgba(250, 204, 21, 0.25); }
.stat-card.stat-cities .stat-number { color: #a78bfa; text-shadow: 0 0 30px rgba(167, 139, 250, 0.25); }
.stat-card.stat-industries .stat-number { color: #34d399; text-shadow: 0 0 30px rgba(52, 211, 153, 0.25); }
.stat-card.stat-classes .stat-number { color: #fb923c; text-shadow: 0 0 30px rgba(251, 146, 60, 0.25); }

.stat-label {
    font-size: 0.75em;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.section-title {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 1.3em;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.filter-header h3 {
    margin: 0;
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.filter-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.filter-mode-toggle {
    display: inline-flex;
    align-items: center;
    padding: 4px;
    border-radius: 999px;
    border: 1px solid rgba(123, 175, 212, 0.2);
    background: rgba(255, 255, 255, 0.04);
}

.filter-mode-btn {
    min-height: 30px;
    padding: 0 12px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.filter-mode-btn:hover {
    color: var(--text-primary);
}

.filter-mode-btn.active {
    color: var(--text-primary);
    background: rgba(123, 175, 212, 0.16);
    box-shadow: inset 0 0 0 1px rgba(123, 175, 212, 0.24);
}

.filter-reset-btn {
    min-height: 38px;
    padding: 0 14px;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(123, 175, 212, 0.25);
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.filter-reset-btn:hover {
    background: rgba(123, 175, 212, 0.12);
    border-color: rgba(123, 175, 212, 0.45);
    transform: translateY(-1px);
}

.filter-reset-btn:active {
    transform: translateY(0);
}

#university-tag-options-container {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

@media (max-width: 720px) {
    .filter-header {
        align-items: flex-start;
    }

    .filter-header-actions {
        width: 100%;
        justify-content: space-between;
    }
}

/* =============================================
   FEATURED ALUMNI
   ============================================= */
#featured-section { margin-bottom: 48px; }

#featured-carousel {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.featured-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.featured-card:hover {
    transform: translateY(-6px);
    border-color: var(--border-glow);
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.4), 0 0 40px var(--accent-glow);
}

.featured-img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 5;
    overflow: hidden;
}

.featured-img-wrap img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: opacity 0.5s ease-in-out, transform 0.5s ease;
}

.featured-card:hover .featured-img-wrap .front-face { transform: scale(1.03); }
.featured-img-wrap .back-face { opacity: 0; }
.featured-card:not(.no-swap):hover .featured-img-wrap .back-face { opacity: 1; }
.featured-card:not(.no-swap):hover .featured-img-wrap .front-face { opacity: 0; }

.featured-info { padding: 18px; }

.featured-info h3 {
    font-family: 'Outfit', 'Inter', sans-serif;
    margin: 0 0 4px;
    font-size: 1.1em;
    font-weight: 600;
}

.featured-info p {
    margin: 2px 0;
    font-size: 0.82em;
    color: var(--text-secondary);
}

.featured-occ { font-style: italic; }
.featured-city { color: var(--carolina-blue) !important; }

/* =============================================
   DIRECTORY GRID (Browse All Alumni)
   ============================================= */
#dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.grid-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.grid-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-glow);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3), 0 0 30px var(--accent-glow);
}

.grid-card-img {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
    overflow: hidden;
    background: rgba(255,255,255,0.03);
}

.grid-card-img img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: opacity 0.5s ease-in-out, transform 0.4s ease;
}

.grid-card:hover .grid-card-img .front-face { transform: scale(1.03); }
.grid-card-img .back-face { opacity: 0; }
.grid-card:not(.no-swap):hover .grid-card-img .back-face { opacity: 1; }
.grid-card:not(.no-swap):hover .grid-card-img .front-face { opacity: 0; }

.grid-card-body { padding: 16px; }

.grid-card-body h3 {
    font-family: 'Outfit', 'Inter', sans-serif;
    margin: 0 0 4px;
    font-size: 1em;
    font-weight: 600;
}

.grid-occ {
    margin: 3px 0 0; font-size: 0.78em; color: var(--text-muted); font-style: italic;
    display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* Small list-style dash-card (legacy browse) */
.dash-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: var(--bg-card);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.dash-card:hover {
    border-color: var(--border-glow);
    box-shadow: 0 4px 15px rgba(123, 175, 212, 0.1);
}

.dash-card img {
    width: 42px; height: 42px; flex-shrink: 0;
    border-radius: 50%; object-fit: cover; object-position: top center;
}

.dash-card-info { display: flex; flex-direction: column; overflow: hidden; }
.dash-card-info strong { font-size: 0.85em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-card-info span { font-size: 0.75em; color: var(--text-muted); }

/* =============================================
   PROFILE CARDS (Timeline legacy)
   ============================================= */
#profiles-container { width: 100%; }
.year-group { margin-bottom: 50px; }

.year-header {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 1.8em;
    font-weight: 700;
    color: var(--text-primary);
    border-bottom: 3px solid;
    padding-bottom: 10px;
    margin-bottom: 30px;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

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

.profile-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border-radius: 14px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    border-top: 3px solid transparent;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    animation: fadeInSlideUp 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.profile-card.desktop-card { text-align: center; cursor: pointer; }

.profile-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-glow);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.3), 0 0 25px var(--accent-glow);
}

.desktop-img-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: rgba(255,255,255,0.03);
}

.profile-card .desktop-img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover; object-position: top center;
    transition: opacity 0.5s ease-in-out;
}

.desktop-img-container .back-face { opacity: 0; }
.profile-card.desktop-card:not(.no-hover):hover .desktop-img-container .back-face { opacity: 1; }
.profile-card.desktop-card:not(.no-hover):hover .desktop-img-container .front-face { opacity: 0; }

.profile-card .info { padding: 16px; }
.profile-card .name { font-size: 1.05em; font-weight: 600; margin: 0; color: var(--text-primary); }

#loading-message, #no-results-message {
    text-align: center; font-size: 1.1em; color: var(--text-muted); padding: 60px 20px;
}

/* Year colors */
.year-color-0 { --year-color: var(--year-yellow); }
.year-color-1 { --year-color: var(--year-purple); }
.year-color-2 { --year-color: var(--year-green); }
.year-color-3 { --year-color: var(--year-orange); }

.year-color-0.text-colored { color: var(--year-yellow) !important; text-shadow: 0 0 10px rgba(251, 191, 36, 0.2); }
.year-color-1.text-colored { color: var(--year-purple) !important; text-shadow: 0 0 10px rgba(167, 139, 250, 0.2); }
.year-color-2.text-colored { color: var(--year-green) !important; text-shadow: 0 0 10px rgba(52, 211, 153, 0.2); }
.year-color-3.text-colored { color: var(--year-orange) !important; text-shadow: 0 0 10px rgba(251, 146, 60, 0.2); }

.year-header.year-color-0, .year-header.year-color-1, .year-header.year-color-2, .year-header.year-color-3 { border-bottom-color: var(--year-color); }
.profile-card.year-color-0, .profile-card.year-color-1, .profile-card.year-color-2, .profile-card.year-color-3 { border-top-color: var(--year-color); }

/* =============================================
   PROFILE VIEW (Full)
   ============================================= */
#profile-view { width: 100%; max-width: 900px; margin: 0 auto; }

.back-button {
    display: inline-flex; align-items: center; gap: 6px;
    margin-bottom: 30px; padding: 10px 20px;
    background: var(--bg-card); color: var(--text-secondary);
    text-decoration: none; border-radius: 10px; font-weight: 600;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.back-button:hover {
    background: rgba(123, 175, 212, 0.1);
    border-color: var(--border-glow);
    color: var(--carolina-blue);
}

#profile-card-full {
    display: flex; gap: 40px;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    padding: 40px; border-radius: 20px;
    border: 1px solid var(--border-color);
}

#profile-main { flex-shrink: 0; width: 250px; text-align: center; }
#profile-main .name { font-family: 'Outfit', 'Inter', sans-serif; font-size: 1.8em; font-weight: 700; margin: 0 0 5px; color: var(--text-primary); }
#profile-main .year { font-size: 1em; color: var(--text-secondary); margin: 5px 0; }
#profile-main .city { font-size: 1em; color: var(--text-muted); margin: 5px 0; font-style: italic; }

#profile-contact-info { margin: 20px 0; padding: 20px 0; border-top: 1px solid var(--border-color); text-align: left; }
#profile-contact-info ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
#profile-contact-info li { display: flex; align-items: center; gap: 10px; font-size: 0.85em; word-break: break-all; }
#profile-contact-info svg { width: 16px; height: 16px; fill: var(--text-muted); flex-shrink: 0; }
#profile-contact-info a { color: var(--carolina-blue); text-decoration: none; }
#profile-contact-info a:hover { text-decoration: underline; color: var(--carolina-blue-bright); }

#profile-drb-stats { text-align: left; }
#profile-drb-stats .stats-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--border-color); padding-top: 15px; }
#profile-drb-stats .stats-list li { margin-bottom: 12px; color: var(--text-secondary); line-height: 1.5; font-size: 0.9em; }
#profile-drb-stats .stats-list li strong { color: var(--text-primary); }

#profile-details { flex-grow: 1; }

.detail-section { margin-bottom: 30px; }
.detail-section h3 {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 1.1em; margin-top: 0; margin-bottom: 15px;
    color: var(--carolina-blue); border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}
.detail-section ul { list-style: none; padding: 0; margin: 0; }
.detail-section li { margin-bottom: 12px; color: var(--text-secondary); line-height: 1.5; }
.detail-section li strong { color: var(--text-primary); }
.detail-section li small { color: var(--text-muted); }
.detail-section p { color: var(--text-secondary); line-height: 1.6; white-space: pre-wrap; }

.profile-image-container { position: relative; width: 100%; height: 250px; margin-bottom: 20px; border-radius: 14px; overflow: hidden; }
.profile-image-container img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover; object-position: top center;
    border-radius: 14px;
    transition: opacity 0.5s ease-in-out;
}
.profile-image-container .back-face { opacity: 0; }
.profile-image-container:not(.no-hover):hover .back-face { opacity: 1; }
.profile-image-container:not(.no-hover):hover .front-face { opacity: 0; }
.profile-image-container.no-hover { cursor: default; }

/* --- Instagram Card --- */
.instagram-card {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 18px; border-radius: 12px;
    background: linear-gradient(135deg, #833ab4 0%, #fd1d1d 50%, #fcb045 100%);
    color: white; text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 15px;
}

.instagram-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(131, 58, 180, 0.4);
}

.instagram-card svg { width: 24px; height: 24px; fill: white; flex-shrink: 0; }
.instagram-card .ig-info { flex-grow: 1; }
.instagram-card .ig-handle { font-weight: 600; font-size: 1em; }
.instagram-card .ig-cta { font-size: 0.8em; opacity: 0.85; }
.instagram-card .ig-arrow { font-size: 1.2em; opacity: 0.7; }

/* --- Edit Profile Button --- */
.edit-profile-btn {
    display: inline-flex; align-items: center; gap: 6px;
    margin-top: 15px; padding: 10px 20px;
    background: var(--accent-gradient);
    color: white; border: none; border-radius: 10px;
    font-size: 0.85em; font-weight: 600; font-family: 'Inter', sans-serif;
    cursor: pointer; transition: all 0.25s ease;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.edit-profile-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 25px rgba(123, 175, 212, 0.4);
}

.edit-profile-btn svg { fill: white; }

/* =============================================
   MODAL (Edit Profile)
   ============================================= */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 100%; max-width: 520px; max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), 0 0 60px var(--accent-glow);
    animation: modalSlideIn 0.3s ease;
}

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

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

.modal-header h2 {
    font-family: 'Outfit', 'Inter', sans-serif;
    margin: 0; font-size: 1.3em; color: var(--text-primary);
}

.request-modal-subtitle {
    margin: 8px 0 0;
    color: var(--text-muted);
    font-size: 0.88em;
    line-height: 1.5;
}

.modal-close {
    background: none; border: none;
    font-size: 1.8em; color: var(--text-muted);
    cursor: pointer; padding: 0; line-height: 1;
    transition: color 0.2s;
}

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

#edit-profile-form { padding: 24px 28px; }
#request-access-form { padding: 24px 28px; }

.form-group { margin-bottom: 18px; }

.form-group label {
    display: block;
    font-size: 0.8em; font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group:has([required]) > label::after {
    content: ' *';
    color: var(--carolina-blue);
    opacity: 0.8;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    font-size: 0.9em;
    font-family: 'Inter', sans-serif;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--carolina-blue);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group input::placeholder,
.form-group select::placeholder,
.form-group textarea::placeholder { color: var(--text-muted); }

.form-actions {
    display: flex; gap: 12px; justify-content: flex-end;
    margin-top: 24px; padding-top: 18px;
    border-top: 1px solid var(--border-color);
}

.btn-secondary {
    padding: 10px 22px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.85em; font-weight: 500; font-family: 'Inter', sans-serif;
    cursor: pointer; transition: all 0.2s;
}

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

.btn-primary {
    padding: 10px 22px;
    background: var(--accent-gradient);
    color: white; border: none; border-radius: 10px;
    font-size: 0.85em; font-weight: 600; font-family: 'Inter', sans-serif;
    cursor: pointer; transition: all 0.2s;
    box-shadow: 0 4px 12px var(--accent-glow);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(123, 175, 212, 0.4);
    transform: translateY(-1px);
}

.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.edit-message { text-align: center; margin-top: 12px; font-size: 0.85em; min-height: 20px; }
.edit-message.success { color: #34d399; }
.edit-message.error { color: #ef4444; }

/* Widen edit profile modal for new sections */
#edit-modal-overlay .modal-content { max-width: 680px; }

/* Location auto-suggest dropdown */
.location-suggestions {
    list-style: none;
    margin: 4px 0 0;
    padding: 0;
    position: absolute;
    left: 0; right: 0;
    z-index: 100;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}

.location-suggestions:empty { display: none; }

.location-suggestions li {
    padding: 10px 14px;
    font-size: 0.88em;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.location-suggestions li:last-child { border-bottom: none; }

.location-suggestions li:hover,
.location-suggestions li.active {
    background: rgba(123, 175, 212, 0.14);
    color: var(--text-primary);
}

/* Dynamic link entry rows in edit modal */
.edit-link-entry {
    display: grid;
    grid-template-columns: 140px 1fr auto;
    gap: 10px;
    align-items: start;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
}

.edit-link-entry + .edit-link-entry { margin-top: 10px; }

.edit-link-entry select,
.edit-link-entry input {
    width: 100%;
    padding: 10px 12px;
    font-size: 0.88em;
    font-family: 'Inter', sans-serif;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s;
}

.edit-link-entry select:focus,
.edit-link-entry input:focus {
    border-color: var(--carolina-blue);
}

.edit-link-remove {
    padding: 10px 14px;
    font-size: 0.78em;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
}

.edit-link-remove:hover {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.4);
}

@media (max-width: 768px) {
    .edit-link-entry {
        grid-template-columns: 1fr;
    }
}

.request-access-modal {
    max-width: 760px;
}

.request-form-section + .request-form-section {
    margin-top: 30px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.request-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.request-form-section h3 {
    margin: 0 0 12px;
    font-family: 'Outfit', 'Inter', sans-serif;
    color: var(--text-primary);
    font-size: 1em;
}

.request-section-note {
    margin: -4px 0 0;
    color: var(--text-muted);
    font-size: 0.82em;
}

.request-inline-btn {
    white-space: nowrap;
}

.request-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 16px;
}

.request-field-hint {
    margin: 8px 0 0;
    color: var(--text-muted);
    font-size: 0.79em;
    line-height: 1.45;
}

.request-span-2 {
    grid-column: 1 / -1;
}

.request-choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.request-choice-grid-compact {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.request-choice {
    position: relative;
}

.request-choice input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.request-choice span {
    display: block;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    font-size: 0.86em;
    font-weight: 500;
    line-height: 1.35;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, color 0.2s, transform 0.2s;
}

.request-choice input:checked + span {
    border-color: rgba(123, 175, 212, 0.7);
    background: rgba(123, 175, 212, 0.14);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.request-choice span:hover {
    border-color: rgba(123, 175, 212, 0.45);
}

.request-choice-other {
    width: min(260px, 100%);
    margin-top: 12px;
    min-height: 48px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    font-size: 0.86em;
}

.request-choice-other:focus {
    border-color: rgba(123, 175, 212, 0.7);
    background: rgba(123, 175, 212, 0.08);
    color: var(--text-primary);
}

.request-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 4px;
}

.request-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 0.88em;
    line-height: 1.45;
}

.request-education-entry {
    padding: 18px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
}

.request-education-entry + .request-education-entry {
    margin-top: 14px;
}

.request-entry-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.request-entry-title {
    font-size: 0.82em;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.request-entry-remove {
    padding: 8px 14px;
    font-size: 0.78em;
}

.request-link-entry {
    display: grid;
    grid-template-columns: minmax(150px, 180px) minmax(0, 1fr) auto;
    gap: 12px;
    margin-bottom: 12px;
    align-items: end;
}

.request-link-entry .form-group {
    margin: 0;
}

.request-link-remove {
    align-self: end;
    margin-bottom: 0;
    white-space: nowrap;
    min-height: 46px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.request-upload-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 15px;
}

.request-upload-card {
    padding: 18px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
}

.request-upload-card label {
    display: block;
    font-size: 0.82em;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.request-upload-card input[type="file"] {
    width: 100%;
    padding: 12px;
    border: 1px dashed rgba(123, 175, 212, 0.35);
    border-radius: 12px;
    background: rgba(123, 175, 212, 0.06);
    color: var(--text-secondary);
    cursor: pointer;
}

.request-upload-card input[type="file"]::file-selector-button {
    margin-right: 12px;
    padding: 8px 14px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    cursor: pointer;
}

.request-upload-note {
    margin: 10px 0 0;
    color: var(--text-muted);
    font-size: 0.82em;
    line-height: 1.5;
}

.request-upload-preview {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-top: 14px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.18);
}

.request-upload-preview[hidden] {
    display: none !important;
}

.request-upload-preview img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.request-upload-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.request-upload-name,
.request-upload-size {
    color: var(--text-secondary);
    font-size: 0.84em;
    line-height: 1.4;
}

.request-upload-name {
    color: var(--text-primary);
    font-weight: 600;
    word-break: break-word;
}

.autocomplete-results {
    margin-top: 8px;
    display: grid;
    gap: 6px;
}

.autocomplete-results:empty {
    display: none;
}

.autocomplete-result-btn {
    width: 100%;
    padding: 10px 12px;
    text-align: left;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    font-size: 0.86em;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.autocomplete-result-btn:hover {
    border-color: rgba(123, 175, 212, 0.45);
    background: rgba(123, 175, 212, 0.12);
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .request-access-modal {
        max-height: 92vh;
    }

    .login-box {
        padding: 28px 20px;
        margin: 0;
        border-radius: 22px;
    }

    .login-panel {
        padding: 20px;
    }

    .login-panel-grid {
        gap: 16px;
    }

    .login-secondary-pane {
        padding: 18px 0 0;
    }

    .login-panel-header h2 {
        font-size: 1.28em;
    }

    .request-access-trigger {
        width: 100%;
        min-width: 0;
    }

    .request-features {
        grid-template-columns: 1fr;
    }

    .request-feature-item:last-child {
        grid-column: auto;
    }

    .request-link-entry {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .request-link-remove {
        width: 100%;
    }

    .request-form-grid {
        grid-template-columns: 1fr;
    }

    .request-span-2 {
        grid-column: auto;
    }

    .request-section-header,
    .request-entry-header {
        flex-direction: column;
        align-items: stretch;
    }

    .request-upload-grid {
        grid-template-columns: 1fr;
    }

    .request-choice-grid {
        grid-template-columns: 1fr;
    }

    #request-access-form,
    #edit-profile-form {
        padding: 20px;
    }

    .modal-header {
        padding: 20px 20px 14px;
        align-items: flex-start;
    }
}

/* =============================================
   MAP VIEW
   ============================================= */
#map-container {
    height: calc(100vh - 120px);
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

#map-view { padding: 10px 0; position: relative; }

.map-count-label { background: none; border: none; box-shadow: none; }

.map-count-label span {
    display: flex; align-items: center; justify-content: center;
    font-family: 'Inter', sans-serif;
    font-size: 11px; font-weight: 700;
    color: white;
    text-shadow: 0 1px 3px rgba(0,0,0,0.6);
    pointer-events: none;
}

.map-summary {
    position: absolute;
    bottom: 24px; left: 50%; transform: translateX(-50%);
    background: rgba(10, 14, 23, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text-secondary);
    padding: 10px 24px;
    border-radius: 50px;
    font-size: 0.82em; font-weight: 500;
    letter-spacing: 0.3px;
    z-index: 1000;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.map-summary span { color: var(--carolina-blue); font-weight: 600; }

.leaflet-popup-content-wrapper {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 14px !important;
    box-shadow: 0 8px 30px rgba(0,0,0,0.4) !important;
    color: var(--text-primary) !important;
}

.leaflet-popup-content {
    margin: 14px 16px !important;
    font-size: 0.9em !important;
    line-height: 1.5 !important;
    color: var(--text-primary) !important;
}

.leaflet-popup-tip { background: var(--bg-secondary) !important; }

/* =============================================
   MEMORIES VIEW
   ============================================= */
.memories-container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
}

.memories-header { text-align: center; margin-bottom: 60px; }

.memories-header h2 {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 2.2em; color: var(--text-primary); margin-bottom: 10px;
}

.memories-header p { color: var(--text-secondary); font-size: 1.05em; margin-bottom: 30px; }

.upload-btn {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 14px 28px;
    background: var(--accent-gradient); color: white;
    text-decoration: none; border-radius: 50px;
    font-weight: 600; font-family: 'Inter', sans-serif;
    box-shadow: 0 4px 20px var(--accent-glow);
    transition: all 0.3s;
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(123, 175, 212, 0.5);
}

.memories-gallery { columns: 3; column-gap: 16px; }

.memory-card {
    display: block; break-inside: avoid;
    margin-bottom: 16px; border-radius: 14px;
    overflow: hidden; position: relative;
    text-decoration: none;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
    transition: transform 0.3s, box-shadow 0.3s;
}

.memory-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 35px rgba(0,0,0,0.4);
}

.memory-card img {
    width: 100%; display: block;
    object-fit: cover; object-position: top center;
}

.memory-overlay {
    position: absolute; bottom: 0; left: 0; right: 0;
    padding: 16px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white; opacity: 0; transition: opacity 0.3s;
    display: flex; flex-direction: column; gap: 2px;
}

.memory-card:hover .memory-overlay { opacity: 1; }
.memory-name { font-weight: 600; font-size: 0.95em; }
.memory-year { font-size: 0.8em; opacity: 0.8; }
.memories-count { font-weight: 600; color: var(--carolina-blue); }
.memories-empty { text-align: center; color: var(--text-muted); padding: 60px 20px; font-size: 1.1em; }

/* =============================================
   ALGORITHMIC AVATAR (for members without photos)
   ============================================= */
.algo-avatar {
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 100%;
    font-family: 'Outfit', 'Inter', sans-serif;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    user-select: none;
}

/* =============================================
   MOBILE RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
    .filter-close-mobile { display: block; }

    body { padding-top: 60px; }
    #page-top-bar { height: 60px; padding: 0 12px; }
    #page-header h1 { font-size: 1.1em; }
    #page-header p { display: none; }
    #app-container { padding: 16px 12px; }

    #stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .stat-number { font-size: 2em; }
    .stat-card { padding: 20px 14px; }

    #featured-carousel { grid-template-columns: 1fr; }
    #dashboard-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
    .grid-card-img { aspect-ratio: 1 / 1; }

    .header-search { display: none; }

    body.logged-in .header-search {
        display: block;
        position: fixed;
        top: 60px; left: 0; right: 0;
        padding: 10px 12px;
        background: rgba(10, 14, 23, 0.95);
        backdrop-filter: blur(12px);
        border-bottom: 1px solid var(--border-color);
        z-index: 999;
        max-width: none;
        margin: 0;
    }

    body.logged-in { padding-top: 110px; }

    .logout-btn { width: 32px; height: 32px; }
    .logout-btn svg { width: 14px; height: 14px; }

    .view-toggle { display: none; }
    body.logged-in .view-toggle {
        display: flex;
        position: fixed;
        bottom: 16px; left: 50%; transform: translateX(-50%);
        z-index: 999;
        background: rgba(10, 14, 23, 0.9);
        backdrop-filter: blur(12px);
        box-shadow: 0 4px 25px rgba(0,0,0,0.4);
        border-radius: 14px;
        padding: 4px;
        border: 1px solid var(--border-color);
    }

    .year-header, .year-group { display: none; }
    .cards-list { display: flex; flex-direction: column; gap: 15px; }
    .profile-card.mobile-card { padding: 15px; }
    .card-main { display: flex; flex-direction: column; gap: 15px; }
    .card-header { display: flex; align-items: center; gap: 15px; }

    .mobile-img {
        width: 60px; height: 60px; border-radius: 50%;
        object-fit: cover; flex-shrink: 0;
        transition: opacity 0.4s ease-in-out;
    }

    .name-info { flex-grow: 1; }
    .name-info .name { font-size: 1.05em; margin-bottom: 2px; }
    .name-info .year { font-size: 0.85em; color: var(--text-secondary); }

    .card-summary {
        font-size: 0.85em; color: var(--text-secondary);
        border-top: 1px solid var(--border-color); padding-top: 15px;
    }
    .card-summary p { margin: 0 0 8px 0; display: flex; align-items: center; gap: 8px; }
    .card-summary svg { width: 14px; height: 14px; fill: var(--text-muted); flex-shrink: 0; }

    .details-toggle {
        margin-top: 15px; padding-top: 10px;
        border-top: 1px solid var(--border-color);
        cursor: pointer; font-weight: 600; color: var(--carolina-blue);
        display: flex; justify-content: center; align-items: center; gap: 8px;
    }
    .details-toggle .arrow {
        display: inline-block; border: solid var(--carolina-blue);
        border-width: 0 2px 2px 0; padding: 3px;
        transform: rotate(45deg); transition: transform 0.3s;
    }
    .profile-card.expanded .details-toggle .arrow { transform: rotate(-135deg); }
    .expandable-details {
        max-height: 0; opacity: 0; overflow: hidden;
        transition: max-height 0.5s ease-out, opacity 0.3s ease-out, margin-top 0.5s ease-out;
    }
    .profile-card.expanded .expandable-details { max-height: 2000px; opacity: 1; margin-top: 20px; }
    .expandable-details .detail-section { margin-bottom: 20px; }
    .expandable-details h3 {
        font-size: 1em; color: var(--carolina-blue); margin: 0 0 15px 0;
        padding-bottom: 8px; border-bottom: 1px solid var(--border-color);
    }
    .expandable-details ul { list-style: none; padding: 0; margin: 0; font-size: 0.85em; }
    .expandable-details li {
        margin-bottom: 10px; display: flex; gap: 8px; align-items: flex-start;
        line-height: 1.5; color: var(--text-secondary);
    }
    .expandable-details li strong { color: var(--text-primary); }
    .expandable-details li small { display: block; margin-top: 2px; color: var(--text-muted); }
    .expandable-details svg { width: 14px; height: 14px; fill: var(--text-muted); flex-shrink: 0; margin-top: 2px; }
    .expandable-details .detail-section p { font-size: 0.85em; line-height: 1.5; margin: 0; white-space: pre-wrap; color: var(--text-secondary); }

    #profile-card-full { flex-direction: column; padding: 20px; }
    .profile-image-container { max-width: 250px; height: 250px; margin-left: auto; margin-right: auto; }

    #map-container { height: calc(100vh - 150px); border-radius: 0; }
    .map-summary { bottom: 16px; font-size: 0.78em; padding: 8px 18px; }

    .memories-gallery { columns: 2; }
}

@media (max-width: 480px) {
    .memories-gallery { columns: 1; }
    #dashboard-grid { grid-template-columns: 1fr; }
}

/* =============================================
   SCROLLBAR STYLING
   ============================================= */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }
