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

:root {
    --bg-dark: #0b0f19;
    --bg-panel: rgba(17, 24, 39, 0.7);
    --bg-card: rgba(30, 41, 59, 0.4);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(99, 102, 241, 0.4);
    
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    
    --safe-dark: #064e3b;
    --safe: #10b981;
    --safe-glow: rgba(16, 185, 129, 0.15);
    
    --semi-safe-dark: #065f46;
    --semi-safe: #34d399;
    --semi-safe-glow: rgba(52, 211, 153, 0.15);
    
    --borderline-dark: #78350f;
    --borderline: #fbbf24;
    --borderline-glow: rgba(251, 191, 36, 0.15);
    
    --risky-dark: #7c2d12;
    --risky: #f97316;
    --risky-glow: rgba(249, 115, 22, 0.15);
    
    --very-risky-dark: #7f1d1d;
    --very-risky: #ef4444;
    --very-risky-glow: rgba(239, 68, 68, 0.15);
    
    --font-inter: 'Inter', sans-serif;
    --transition-speed: 0.3s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.12) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(20, 184, 166, 0.1) 0px, transparent 50%);
    color: var(--text-main);
    font-family: var(--font-inter);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

body.light-theme {
    --bg-dark: #f1f5f9;
    --bg-panel: rgba(255, 255, 255, 0.85);
    --bg-card: rgba(255, 255, 255, 0.9);
    --border-color: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(99, 102, 241, 0.5);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --primary: #4f46e5;
}

body.light-theme {
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.06) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(20, 184, 166, 0.05) 0px, transparent 50%);
}

/* Header */
header {
    display: flex;
    align-items: center;
    padding: 1.25rem 2rem;
    background: rgba(11, 15, 25, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
}

.logo:hover {
    opacity: 0.88;
    transform: translateX(-50%) scale(1.02);
}

.logo img {
    height: 54px;
    width: auto;
    object-fit: contain;
    display: block;
}

.user-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
    position: relative;
    z-index: 10;
}

/* Common UI Elements */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

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

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-text {
    background: transparent;
    color: var(--text-muted);
}

.btn-text:hover {
    color: var(--text-main);
}

/* Layout */
.app-container {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 2rem;
    padding: 2rem;
    max-width: 1600px;
    margin: 0 auto;
    height: auto; /* let page scroll naturally */
}

/* Glass Panels */
.panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Sticky behavior for right column — desktop only */
@media (min-width: 769px) {
    .app-container > section:last-of-type {
        position: sticky;
        top: 180px;
        height: calc(100vh - 210px);
        align-self: start;
    }
}


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

.panel-title {
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.panel-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 1.5rem;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Filter controls */
.search-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.search-bar-container {
    position: relative;
}

.search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    color: var(--text-main);
    font-size: 0.95rem;
    outline: none;
    transition: all var(--transition-speed);
}

.search-input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.search-bar-container i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
}

.select-control {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.6rem;
    color: var(--text-main);
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
    transition: border-color var(--transition-speed);
}

.select-control:focus {
    border-color: var(--primary);
}

.score-pills {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.score-pill {
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-speed);
}

.score-pill:hover {
    border-color: var(--primary);
    color: var(--text-main);
}

.score-pill.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* Department Grid & Cards */
.departments-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    flex: 1;
    overflow-y: auto;
    padding-right: 0.5rem;
    margin-top: 1rem;
}

.dept-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all var(--transition-speed) ease;
    position: relative;
    overflow: hidden;
}

.dept-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.dept-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    padding-right: 1.5rem;
}

.dept-code {
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.dept-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-main);
}

.dept-uni {
    font-size: 0.9rem;
    color: #a78bfa;
    font-weight: 500;
}

.dept-details {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.detail-badge {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.score-badge {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    font-weight: 700;
}

.dept-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.75rem;
    min-width: 140px;
}

.dept-stats {
    text-align: right;
}

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

.stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
}

/* User Profile Inputs in Preference Panel */
.assistant-setup {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 0.75rem 1rem;
    margin: 0.25rem 0;
}

.assistant-horizontal-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    width: 100%;
}

.assistant-header-group {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex-shrink: 0;
}

.assistant-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #14b8a6;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.assistant-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.assistant-inputs-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    justify-content: center;
}

.assistant-input-item {
    display: flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    height: 32px;
}

.input-tag {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0 0.5rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    min-width: 40px;
}

.assistant-input-item.say .input-tag { background: #3b82f6; }
.assistant-input-item.ea .input-tag { background: #f59e0b; }
.assistant-input-item.soz .input-tag { background: #10b981; }
.assistant-input-item.dil .input-tag { background: #06b6d4; }
.assistant-input-item.tyt .input-tag { background: #ef4444; }

.assistant-input-item input {
    background: transparent !important;
    border: none !important;
    color: var(--text-main);
    font-size: 0.8rem;
    font-weight: 600;
    width: 75px;
    height: 100%;
    padding: 0 0.5rem;
    outline: none;
    text-align: center;
}

#save-profile-btn {
    padding: 0.45rem 1rem;
    font-size: 0.78rem;
    height: 32px;
    border-radius: 8px;
    flex-shrink: 0;
}

.setup-inputs {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 0.75rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.input-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.input-control {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    color: var(--text-main);
    font-size: 0.85rem;
    outline: none;
    transition: all var(--transition-speed);
}

.input-control:focus {
    border-color: #14b8a6;
}

/* Drag and Drop Preference List */
.preference-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 150px;
    flex: 1;
    overflow-y: auto;
    padding-right: 0.5rem;
    margin-top: 1rem;
}

.preference-item {
    background: rgba(30, 41, 59, 0.5);
    border-left: 4px solid var(--primary);
    border-top: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    border-radius: 0 10px 10px 0;
    padding: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: grab;
    transition: all 0.2s ease;
    user-select: none;
}

.preference-item.dragging {
    opacity: 0.5;
    background: rgba(99, 102, 241, 0.15);
    cursor: grabbing;
}

.pref-order {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--text-muted);
    min-width: 25px;
    text-align: center;
}

.pref-drag-handle {
    color: var(--text-muted);
    cursor: grab;
    padding: 0.25rem;
}

.pref-details {
    flex: 1;
    min-width: 0;
}

.pref-name {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pref-uni {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.pref-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.2rem;
    margin-right: 0.5rem;
}

.pref-rank {
    font-size: 0.85rem;
    font-weight: 700;
}

/* Assistant status pill */
.status-pill {
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

/* Assistant colors dynamically applied */
.status-very-safe {
    background: var(--safe-dark);
    color: var(--safe);
    border-color: var(--safe);
    box-shadow: 0 0 10px var(--safe-glow);
}
.status-safe {
    background: var(--semi-safe-dark);
    color: var(--semi-safe);
    border-color: var(--semi-safe);
    box-shadow: 0 0 10px var(--semi-safe-glow);
}
.status-borderline {
    background: var(--borderline-dark);
    color: var(--borderline);
    border-color: var(--borderline);
    box-shadow: 0 0 10px var(--borderline-glow);
}
.status-risky {
    background: var(--risky-dark);
    color: var(--risky);
    border-color: var(--risky);
    box-shadow: 0 0 10px var(--risky-glow);
}
.status-very-risky {
    background: var(--very-risky-dark);
    color: var(--very-risky);
    border-color: var(--very-risky);
    box-shadow: 0 0 10px var(--very-risky-glow);
}

/* Left-border styling for preference items */
.preference-item.status-border-very-safe { border-left-color: var(--safe); }
.preference-item.status-border-safe { border-left-color: var(--semi-safe); }
.preference-item.status-border-borderline { border-left-color: var(--borderline); }
.preference-item.status-border-risky { border-left-color: var(--risky); }
.preference-item.status-border-very-risky { border-left-color: var(--very-risky); }

.pref-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-direction: row; /* display horizontal on mobile/desktop for neat fit */
}

.pref-action-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    border-radius: 6px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s ease;
}

.pref-action-btn:hover:not(:disabled) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pref-action-btn:disabled {
    opacity: 0.2;
    cursor: not-allowed;
}

.pref-remove {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.1);
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed);
}

.pref-remove:hover {
    background: var(--very-risky);
    border-color: var(--very-risky);
    color: white;
}

/* Empty states */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--text-muted);
    gap: 1rem;
}

.empty-state i {
    font-size: 2.5rem;
    color: var(--border-hover);
}

/* Auth Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-speed) ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: rgba(17, 24, 39, 0.95);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform var(--transition-speed) ease;
}

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

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

.modal-title {
    font-weight: 700;
    font-size: 1.2rem;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.25rem;
}

.modal-body {
    padding: 1.5rem;
    flex: 1;
    overflow-y: auto;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.65rem 0.85rem;
    color: var(--text-main);
    font-size: 0.9rem;
    outline: none;
    transition: border-color var(--transition-speed);
}

.form-control:focus {
    border-color: var(--primary);
}

.modal-footer {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.alert-message {
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    display: none;
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid var(--very-risky);
    color: var(--very-risky);
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid var(--safe);
    color: var(--safe);
}

/* Responsiveness */
@media (max-width: 1024px) {
    .app-container {
        grid-template-columns: 1fr;
        height: auto;
        overflow-y: visible;
        padding: 1.5rem;
        gap: 1.5rem;
    }
    
    .panel {
        height: 550px;
    }
}

@media (max-width: 768px) {

    /* ---- Header: compact, logo centered, minimal ---- */
    header {
        padding: 0.6rem 1rem;
        position: sticky;
        top: 0;
        z-index: 150;
        justify-content: space-between;
    }

    .logo img {
        height: 38px !important;
    }

    /* Hide auth buttons — handled by Profile tab in bottom nav */
    #nav-guest,
    #nav-user {
        display: none !important;
    }

    #theme-toggle {
        min-width: 34px !important;
        height: 34px;
        padding: 0.35rem;
        font-size: 1rem;
        margin-right: 0;
    }

    /* ---- Sticky filter bar: slim & touch-friendly ---- */
    #sticky-filter-bar {
        position: sticky;
        top: 55px;
        padding: 0.6rem 1rem;
        z-index: 120;
    }

    .search-bar-container {
        flex: 1;
    }

    .search-input {
        font-size: 0.875rem;
        padding: 0.55rem 0.75rem 0.55rem 2rem;
    }

    #mobile-filter-toggle {
        display: inline-flex !important;
        align-items: center;
        gap: 0.4rem;
        padding: 0.45rem 0.85rem;
        height: 36px;
        font-size: 0.78rem;
        border-radius: 8px;
        white-space: nowrap;
    }

    .collapsible-content {
        display: none;
    }

    .collapsible-content.show {
        display: flex !important;
        flex-direction: column;
        gap: 0.65rem;
        margin-top: 0.65rem;
        border-top: 1px solid var(--border-color);
        padding-top: 0.65rem;
    }

    .filter-main-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .filter-selects-group,
    .score-range-group,
    .filter-main-row button {
        width: 100% !important;
        flex: none !important;
    }

    .score-range-group {
        justify-content: center;
    }

    .filter-secondary-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    /* ---- Main content: single column, full width ---- */
    .app-container {
        grid-template-columns: 1fr;
        padding: 0.75rem 0.75rem 1rem;
        gap: 0;
    }

    /* ---- Panels: no fixed heights, scroll naturally ---- */
    .panel {
        height: auto;
        border-radius: 16px;
        overflow: visible;
    }

    /* Mobile panel — show cards normally */
    .app-container > section:first-of-type {
        height: auto !important;
        background: transparent !important;
        border: none !important;
        backdrop-filter: none !important;
        box-shadow: none !important;
        overflow: visible;
    }

    .app-container > section:first-of-type .panel-header {
        display: none; /* Section title redundant on mobile, tab shows it */
    }

    .app-container > section:first-of-type .panel-body {
        overflow: visible !important;
        padding: 0 !important;
    }

    .app-container > section:first-of-type .departments-list {
        overflow: visible !important;
        padding-right: 0;
        flex: none;
    }

    .app-container > section:last-of-type {
        border-radius: 16px;
    }

    .panel-body {
        overflow: visible;
        padding: 0.75rem;
    }

    /* ---- Department cards: spacious & readable ---- */
    .departments-list, #preference-list-container {
        gap: 0.65rem;
    }

    .dept-card {
        padding: 0.85rem 1rem;
        border-radius: 14px;
    }

    .preference-item {
        padding: 0.75rem;
        border-radius: 0 12px 12px 0;
    }

    .pref-drag-handle {
        display: none;
    }

    /* ---- Footer: compact on mobile ---- */
    footer {
        padding: 1rem 1rem 1.5rem !important;
        font-size: 0.72rem !important;
    }

    footer > div {
        flex-direction: column !important;
        gap: 0.75rem !important;
        align-items: flex-start !important;
    }

    footer nav {
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
    }
}

/* Light Theme Overrides */
body.light-theme .select-control,
body.light-theme .input-control,
body.light-theme .form-control {
    background: #ffffff;
    color: #0f172a;
    border-color: rgba(0, 0, 0, 0.12);
}

body.light-theme .select-control:focus,
body.light-theme .input-control:focus,
body.light-theme .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

body.light-theme .modal {
    background: #ffffff;
    color: #0f172a;
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .modal-header {
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

body.light-theme .modal-title {
    color: #0f172a;
}

body.light-theme .preference-item {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.06);
}

body.light-theme header {
    background: rgba(255, 255, 255, 0.8);
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

body.light-theme .search-input {
    background: rgba(255, 255, 255, 0.8);
    color: #0f172a;
    border-color: rgba(0, 0, 0, 0.12);
}

body.light-theme .search-input:focus {
    background: #ffffff;
}

body.light-theme .detail-badge {
    background: rgba(0, 0, 0, 0.04);
    color: #4b5563;
    border-color: rgba(0, 0, 0, 0.04);
}

body.light-theme .detail-badge.score-badge {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

body.light-theme .score-pill {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.06);
    color: #4b5563;
}

body.light-theme .score-pill:hover {
    border-color: var(--primary);
    color: #0f172a;
}

body.light-theme .score-pill.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

body.light-theme .assistant-setup {
    background: rgba(255, 255, 255, 0.5);
    border-color: rgba(0, 0, 0, 0.06);
}

body.light-theme .dept-stats .stat-value {
    color: #0f172a;
}

body.light-theme .pref-rank {
    color: #0f172a;
}

body.light-theme .btn-secondary {
    background: #ffffff;
    color: #374151;
    border-color: rgba(0, 0, 0, 0.15);
}

body.light-theme .btn-secondary:hover {
    background: #f9fafb;
    border-color: rgba(0, 0, 0, 0.25);
}

/* Department Score-type Color Coding */
.dept-card.score-SAY { border-left: 4px solid #3b82f6; }
.dept-card.score-EA { border-left: 4px solid #f59e0b; }
.dept-card.score-SÖZ { border-left: 4px solid #10b981; }
.dept-card.score-DİL { border-left: 4px solid #06b6d4; }
.dept-card.score-TYT { border-left: 4px solid #ef4444; }

/* Department Name Colors (Dark Mode Default) */
.dept-card.score-SAY .dept-name { color: #60a5fa; }
.dept-card.score-EA .dept-name { color: #fbbf24; }
.dept-card.score-SÖZ .dept-name { color: #34d399; }
.dept-card.score-DİL .dept-name { color: #22d3ee; }
.dept-card.score-TYT .dept-name { color: #f87171; }

/* Department Name Colors (Light Mode) */
body.light-theme .dept-card.score-SAY .dept-name { color: #1d4ed8; }
body.light-theme .dept-card.score-EA .dept-name { color: #b45309; }
body.light-theme .dept-card.score-SÖZ .dept-name { color: #047857; }
body.light-theme .dept-card.score-DİL .dept-name { color: #0e7490; }
body.light-theme .dept-card.score-TYT .dept-name { color: #b91c1c; }

/* Score Badge Styles (Dark Mode) */
.score-badge-SAY, .score-badge.score-SAY {
    background: rgba(59, 130, 246, 0.1) !important;
    color: #60a5fa !important;
    border: 1px solid rgba(59, 130, 246, 0.2) !important;
}
.score-badge-EA, .score-badge.score-EA {
    background: rgba(245, 158, 11, 0.1) !important;
    color: #fbbf24 !important;
    border: 1px solid rgba(245, 158, 11, 0.2) !important;
}
.score-badge-SÖZ, .score-badge.score-SÖZ {
    background: rgba(16, 185, 129, 0.1) !important;
    color: #34d399 !important;
    border: 1px solid rgba(16, 185, 129, 0.2) !important;
}
.score-badge-DİL, .score-badge.score-DİL {
    background: rgba(6, 182, 212, 0.1) !important;
    color: #22d3ee !important;
    border: 1px solid rgba(6, 182, 212, 0.2) !important;
}
.score-badge-TYT, .score-badge.score-TYT {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #f87171 !important;
    border: 1px solid rgba(239, 68, 68, 0.2) !important;
}

/* Score Badge Styles (Light Mode) */
body.light-theme .score-badge-SAY, body.light-theme .score-badge.score-SAY {
    background: rgba(37, 99, 235, 0.08) !important;
    color: #1d4ed8 !important;
    border: 1px solid rgba(37, 99, 235, 0.15) !important;
}
body.light-theme .score-badge-EA, body.light-theme .score-badge.score-EA {
    background: rgba(217, 119, 6, 0.08) !important;
    color: #b45309 !important;
    border: 1px solid rgba(217, 119, 6, 0.15) !important;
}
body.light-theme .score-badge-SÖZ, body.light-theme .score-badge.score-SÖZ {
    background: rgba(5, 150, 105, 0.08) !important;
    color: #047857 !important;
    border: 1px solid rgba(5, 150, 105, 0.15) !important;
}
body.light-theme .score-badge-DİL, body.light-theme .score-badge.score-DİL {
    background: rgba(8, 145, 178, 0.08) !important;
    color: #0e7490 !important;
    border: 1px solid rgba(8, 145, 178, 0.15) !important;
}
body.light-theme .score-badge-TYT, body.light-theme .score-badge.score-TYT {
    background: rgba(220, 38, 38, 0.08) !important;
    color: #b91c1c !important;
    border: 1px solid rgba(220, 38, 38, 0.15) !important;
}

/* Stat Value and Ranking Glow */
.dept-stats {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 0.6rem 0.9rem;
    border-radius: 10px;
    text-align: right;
    min-width: 140px;
    transition: all var(--transition-speed);
}

.dept-stats:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.15);
}

body.light-theme .dept-stats {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.06);
}

body.light-theme .dept-stats:hover {
    background: rgba(0, 0, 0, 0.04);
}

.stat-value {
    color: #f3f4f6;
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
}

body.light-theme .stat-value {
    color: #1e293b;
}

/* Modal and Detail Popup Interactivity and Styles */
.dept-info {
    cursor: pointer;
    transition: transform var(--transition-speed);
}

.dept-info:hover .dept-name {
    text-decoration: underline;
}

.modal.modal-large {
    max-width: 650px;
}

/* Light theme support for detail tables */
body.light-theme .dept-modal-grid p, 
body.light-theme .dept-modal-grid th {
    color: #475569 !important;
}

body.light-theme .dept-modal-grid td {
    color: #0f172a !important;
}

body.light-theme .dept-modal-grid tr {
    border-bottom-color: rgba(0, 0, 0, 0.05) !important;
}

/* Switch slider styles */
.switch input:checked + .slider {
    background-color: var(--primary);
}

.switch .slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.switch input:checked + .slider:before {
    transform: translateX(22px);
}

/* ====================================================
   Nasıl Çalışır CTA Banner
   ==================================================== */
#how-it-works-banner {
    max-width: 1400px;
    margin: 1.5rem auto 0 auto;
    background: linear-gradient(135deg,
        rgba(15, 23, 42, 0.4) 0%,
        rgba(30, 41, 59, 0.2) 100%);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 24px;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: 
        0 20px 40px -15px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 0 50px -10px rgba(99, 102, 241, 0.08);
    animation: hiwSlideDown 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    overflow: hidden;
    padding: 1.5rem;
}

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

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

#how-it-works-banner.closing {
    animation: hiwSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hiw-inner {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    width: 100%;
}

.hiw-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #818cf8;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 20px;
    padding: 0.4rem 1rem;
    align-self: flex-start;
}

.hiw-steps {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.hiw-step {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 18px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    opacity: 0;
    animation: hiwFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hiw-step:nth-child(1) { animation-delay: 0.1s; }
.hiw-step:nth-child(3) { animation-delay: 0.25s; }
.hiw-step:nth-child(5) { animation-delay: 0.4s; }
.hiw-step:nth-child(7) { animation-delay: 0.55s; }

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

.hiw-step:hover {
    background: rgba(99, 102, 241, 0.04);
    border-color: rgba(99, 102, 241, 0.35);
    transform: translateY(-4px);
    box-shadow: 
        0 12px 24px -10px rgba(99, 102, 241, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.hiw-step-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.hiw-step:hover .hiw-step-icon {
    transform: scale(1.1) rotate(-3deg);
}

.hiw-icon-1 { background: linear-gradient(135deg, #6366f1, #4f46e5); box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3); color: #fff; }
.hiw-icon-2 { background: linear-gradient(135deg, #0ea5e9, #0284c7); box-shadow: 0 4px 20px rgba(14, 165, 233, 0.3); color: #fff; }
.hiw-icon-3 { background: linear-gradient(135deg, #10b981, #059669); box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3); color: #fff; }
.hiw-icon-4 { background: linear-gradient(135deg, #f59e0b, #d97706); box-shadow: 0 4px 20px rgba(245, 158, 11, 0.3); color: #fff; }

.hiw-step-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.hiw-step-text strong {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
}

.hiw-step-text span {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.hiw-arrow {
    color: rgba(99, 102, 241, 0.25);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: hiwPulse 2s ease infinite;
}

@keyframes hiwPulse {
    0%, 100% { opacity: 0.3; transform: translateX(0); }
    50%      { opacity: 0.8; transform: translateX(4px); }
}

.hiw-close {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(167, 139, 250, 0.12) 100%);
    border: 1px solid rgba(167, 139, 250, 0.25);
    color: #a78bfa;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.45rem 1.25rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    align-self: flex-end;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    box-shadow: 0 4px 12px rgba(167, 139, 250, 0.08);
}

.hiw-close:hover {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.12) 0%, rgba(239, 68, 68, 0.18) 100%);
    border-color: rgba(239, 68, 68, 0.35);
    color: #ef4444;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}

/* Light Theme Enhancements */
body.light-theme #how-it-works-banner {
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.7) 0%,
        rgba(243, 244, 246, 0.5) 100%);
    border-color: rgba(99, 102, 241, 0.12);
    box-shadow: 
        0 15px 35px -15px rgba(99, 102, 241, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

body.light-theme .hiw-step {
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(0, 0, 0, 0.03);
}

body.light-theme .hiw-step:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(99, 102, 241, 0.25);
    box-shadow: 0 8px 20px -10px rgba(99, 102, 241, 0.15);
}

body.light-theme .hiw-arrow {
    color: rgba(99, 102, 241, 0.4);
}

/* Responsive UI */
@media (max-width: 1200px) {
    .hiw-steps {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
    
    .hiw-arrow {
        display: none;
    }
}

@media (max-width: 768px) {
    #how-it-works-banner {
        margin: 1rem 1rem 0 1rem;
        padding: 1.25rem;
    }

    .hiw-steps {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .hiw-step {
        padding: 1rem;
    }
    
    .hiw-step-text span {
        font-size: 0.68rem;
    }
}

@media (max-width: 600px) {
    .dept-card {
        flex-direction: column; /* vertical structured layout */
        align-items: stretch;
        padding: 1rem;
        gap: 0.5rem;
        border-radius: 14px;
    }
    
    .dept-info {
        padding-right: 0;
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
        min-width: 0;
        flex: none;
    }
    
    .dept-code {
        display: block; /* show program code */
        font-size: 0.65rem;
        color: var(--text-muted);
        font-family: monospace;
    }
    
    .dept-name {
        font-size: 0.95rem;
        font-weight: 700;
        white-space: normal; /* allow wrap to see full name */
        overflow: visible;
        text-overflow: clip;
        line-height: 1.3;
    }
    
    .dept-uni {
        font-size: 0.78rem;
        font-weight: 600;
        white-space: normal; /* allow wrap to see full university name */
        overflow: visible;
        text-overflow: clip;
        color: var(--text-muted);
        text-transform: uppercase;
        margin-bottom: 0.15rem;
    }
    
    .dept-details {
        display: flex;
        gap: 0.35rem;
        margin-top: 0.25rem;
        flex-wrap: wrap; /* wrap badges to be readable */
        overflow-x: visible;
    }
    
    .detail-badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.5rem;
        white-space: nowrap;
        border-radius: 6px;
    }
    
    .dept-actions {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        padding-top: 0.6rem;
        margin-top: 0.4rem;
        width: 100%;
    }
    
    .dept-stats {
        text-align: left;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 0.75rem;
        margin-right: 0;
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
        min-width: 0 !important;
        box-shadow: none !important;
    }
    
    .stat-label {
        display: block !important; /* show label */
        font-size: 0.62rem;
        color: var(--text-muted);
        line-height: 1.1;
    }
    
    .stat-value {
        font-size: 0.85rem;
        font-weight: 800;
        line-height: 1.2;
        color: var(--text-main) !important;
    }
    
    .dept-stats div[style*="font-size:0.7rem"] {
        font-size: 0.65rem !important;
        margin-top: 0;
        color: var(--text-muted) !important;
    }
    
    /* Make button very clean, compact and descriptive with text */
    .dept-actions button.btn {
        font-size: 0.72rem !important; /* show text label */
        padding: 0.4rem 0.75rem !important;
        width: auto !important;
        height: auto !important;
        display: inline-flex;
        align-items: center;
        gap: 0.25rem;
        border-radius: 8px;
        flex-shrink: 0;
    }
    
    .dept-actions button.btn i {
        font-size: 0.75rem !important;
        margin: 0 !important;
    }
}

@media (max-width: 480px) {
    .modal {
        width: calc(100% - 1.5rem);
        margin: 0.75rem;
    }
    
    .modal-header {
        padding: 1.25rem 1rem;
    }
    
    .modal-body {
        padding: 1.25rem 1rem;
    }
}

/* ====================================================
   Back to Top Button (Yukarı Çık)
   ==================================================== */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: rgba(30, 41, 59, 0.75);
    border: 1px solid rgba(99, 102, 241, 0.25);
    color: var(--text-main);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 
        0 10px 25px -5px rgba(0, 0, 0, 0.5),
        0 0 30px -5px rgba(99, 102, 241, 0.2);
    opacity: 0;
    pointer-events: none;
    transform: translateY(15px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 
        0 10px 25px -5px rgba(99, 102, 241, 0.4),
        0 0 30px rgba(99, 102, 241, 0.4);
    transform: translateY(-3px) scale(1.05);
}

.back-to-top:active {
    transform: translateY(-1px) scale(0.98);
}

@media (max-width: 768px) {
    .back-to-top {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 42px;
        height: 42px;
        font-size: 0.95rem;
    }
}

/* ====================================================
   Sticky Search & Filter Bar
   ==================================================== */
#sticky-filter-bar {
    position: sticky;
    top: 94px; /* below the sticky header */
    z-index: 99;
    background: rgba(11, 15, 25, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    transition: all var(--transition-speed) ease;
}

.filter-bar-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Header Row: Search + Toggle button */
.filter-header-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.filter-header-row .search-bar-container {
    flex: 1;
    position: relative;
}

.filter-header-row .search-input {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    color: var(--text-main);
    font-size: 0.85rem;
    outline: none;
    transition: border-color var(--transition-speed);
}

.filter-header-row .search-input:focus {
    border-color: var(--primary);
}

.filter-header-row .search-bar-container i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

#mobile-filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Collapsible Content wrapper */
.collapsible-content {
    display: none; /* Collapsed by default */
}

.collapsible-content.show {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}


.filter-main-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.filter-selects-group {
    display: flex;
    gap: 0.75rem;
    flex: 1.5;
    min-width: 250px;
}

.filter-selects-group select {
    flex: 1;
}

.score-range-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.25rem 0.5rem;
    min-width: 210px;
}

.score-range-group input {
    background: transparent !important;
    border: none !important;
    padding: 0.35rem 0.25rem !important;
    color: var(--text-main);
    font-size: 0.85rem;
    width: 80px;
    text-align: center;
    outline: none;
}

.score-separator {
    color: var(--text-muted);
    font-weight: 500;
}

.filter-secondary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    border-top: 1px dashed rgba(255, 255, 255, 0.05);
    padding-top: 0.5rem;
}

.filter-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 700;
    margin-right: 0.5rem;
}

.smart-toggle-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(99, 102, 241, 0.05);
    border: 1px dashed var(--primary);
    border-radius: 20px;
    padding: 0.35rem 1rem;
    transition: all var(--transition-speed);
}

/* Light Theme Overrides */
body.light-theme #sticky-filter-bar {
    background: rgba(255, 255, 255, 0.8);
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

body.light-theme .filter-main-row .search-input {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.08);
}

body.light-theme .score-range-group {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.08);
}

body.light-theme .filter-secondary-row {
    border-top-color: rgba(0, 0, 0, 0.05);
}

/* Desktop flow overrides — only on desktop (page scrolls, not panel) */
@media (min-width: 769px) {
    .app-container > section:first-of-type {
        height: auto;
        background: transparent;
        border: none;
        backdrop-filter: none;
        box-shadow: none;
    }

    .app-container > section:first-of-type .panel-body {
        overflow: visible;
        padding: 0;
    }

    .app-container > section:first-of-type .departments-list {
        overflow: visible;
        padding-right: 0;
        margin-top: 0;
    }
}


/* Mobile responsive adjustments — tablet */
@media (max-width: 1024px) {
    #sticky-filter-bar {
        top: 80px;
    }
}


/* Assistant Setup Light Theme Overrides */
body.light-theme .assistant-setup {
    background: rgba(0, 0, 0, 0.01);
    border-color: rgba(0, 0, 0, 0.04);
}

body.light-theme .assistant-input-item {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.12);
}

body.light-theme .assistant-input-item input {
    color: #0f172a;
}

/* Assistant Setup Mobile/Tablet Responsiveness */
@media (max-width: 1024px) {
    .assistant-horizontal-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .assistant-inputs-row {
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 0.5rem;
        width: 100%;
    }
    
    .assistant-input-item {
        flex: 1;
        min-width: 90px;
    }
    
    #save-profile-btn {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .assistant-inputs-row {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.4rem;
    }
    
    .assistant-input-item {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 480px) {
    .assistant-inputs-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Department Details Modal Grid Mobile Response */
@media (max-width: 600px) {
    .dept-modal-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
}

/* ====================================================
   Mobile Filter Panel — triggered from bottom nav
   ==================================================== */
@media (max-width: 768px) {
    /* When filter is open, sticky-filter-bar expands its collapsible content */
    #sticky-filter-bar .collapsible-content.show {
        border-top: 1px solid rgba(99, 102, 241, 0.15);
        margin-top: 0.5rem;
        padding-top: 0.65rem;
        animation: slideDownFilter 0.22s ease;
    }

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


/* ====================================================
   Mobile Bottom Navigation Bar
   ==================================================== */
#mobile-bottom-nav {
    display: none; /* Hidden on desktop */
}

@media (max-width: 768px) {
    /* Sections: only one visible at a time on mobile */
    .mobile-section {
        display: none !important;
    }
    .mobile-section.active-mobile-section {
        display: flex !important;
    }

    /* Bottom space so content isn't behind the nav */
    body {
        padding-bottom: 72px;
    }

    #mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 64px;
        z-index: 200;
        background: rgba(11, 15, 25, 0.92);
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        border-top: 1px solid rgba(99, 102, 241, 0.15);
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.4);
        padding: 0 0.5rem;
        align-items: stretch;
        justify-content: space-around;
    }

    .mobile-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.2rem;
        background: transparent;
        border: none;
        color: rgba(148, 163, 184, 0.7);
        font-size: 0;
        cursor: pointer;
        position: relative;
        padding: 0.5rem 0.25rem;
        border-radius: 0;
        transition: color 0.2s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-nav-item i {
        font-size: 1.25rem;
        transition: transform 0.2s ease, color 0.2s ease;
    }

    .mobile-nav-item span:not(.mobile-nav-badge) {
        font-size: 0.6rem;
        font-weight: 600;
        letter-spacing: 0.02em;
        transition: color 0.2s ease;
        margin-top: 0.1rem;
    }

    .mobile-nav-item.active {
        color: #6366f1;
    }

    .mobile-nav-item.active i {
        transform: translateY(-2px) scale(1.1);
        color: #6366f1;
        filter: drop-shadow(0 0 6px rgba(99, 102, 241, 0.5));
    }

    .mobile-nav-item.active::after {
        content: '';
        position: absolute;
        top: 0;
        left: 20%;
        right: 20%;
        height: 2px;
        border-radius: 0 0 4px 4px;
        background: linear-gradient(90deg, #6366f1, #818cf8);
        box-shadow: 0 0 8px rgba(99, 102, 241, 0.6);
    }

    .mobile-nav-item:not(.active):hover {
        color: rgba(148, 163, 184, 1);
    }

    /* Badge for preference count */
    .mobile-nav-badge {
        position: absolute;
        top: 6px;
        right: calc(50% - 16px);
        background: #6366f1;
        color: #fff;
        font-size: 0.55rem !important;
        font-weight: 800;
        min-width: 16px;
        height: 16px;
        border-radius: 8px;
        padding: 0 3px;
        display: flex !important;
        align-items: center;
        justify-content: center;
        border: 2px solid rgba(11, 15, 25, 0.9);
        line-height: 1;
    }

    /* Light theme adjustments */
    body.light-theme #mobile-bottom-nav {
        background: rgba(255, 255, 255, 0.92);
        border-top-color: rgba(99, 102, 241, 0.12);
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.1);
    }

    body.light-theme .mobile-nav-item {
        color: rgba(100, 116, 139, 0.8);
    }

    body.light-theme .mobile-nav-item.active {
        color: #6366f1;
    }

    /* Hide header login buttons on mobile since we have profile tab */
    /* (optional) keep them visible for now */

    /* back-to-top adjusts for bottom nav */
    .back-to-top {
        bottom: 76px !important;
    }
}

/* Guide Modal Step Illustration Styles */
.guide-steps-container {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.guide-modal-step {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.5rem 0;
}
.guide-step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    color: #ffffff;
    flex-shrink: 0;
}
.bg-gradient-1 { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.bg-gradient-2 { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.bg-gradient-3 { background: linear-gradient(135deg, #10b981, #14b8a6); }
.bg-gradient-4 { background: linear-gradient(135deg, #f59e0b, #ef4444); }

.guide-step-content {
    flex: 1;
}

/* Footer Styles */
.site-footer {
    background: var(--bg-card, #0f172a);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 1.5rem 2rem;
    margin-top: auto;
    font-size: 0.78rem;
    color: var(--text-muted, #94a3b8);
}
.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: space-between;
    align-items: center;
}
.footer-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.footer-ad-info {
    color: var(--text-muted);
}
.footer-ad-info i {
    color: var(--primary-color);
    margin-right: 0.35rem;
}
.footer-ad-info a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}
.footer-ad-info a:hover {
    color: #818cf8;
    text-decoration: underline;
}
.footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

@media (max-width: 768px) {
    .site-footer {
        margin-bottom: 64px; /* Space for the bottom nav bar */
        padding: 1.25rem 1rem 1.5rem;
    }
    .footer-inner {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    .footer-left {
        flex-direction: column;
        gap: 0.5rem;
    }
}








