/* ==========================================================================
   1. ROOT VARIABLES & RESET
   ========================================================================== */
:root {
    /* Glass Theme Colors (Auth) */
    --auth-gradient: linear-gradient(135deg, #7c4cff 0%, #d4a5ff 30%, #a8edea 70%, #e0c3fc 100%);
    --glass-bg: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.3);
    --text-glass: #ffffff;
    --text-glass-muted: rgba(255, 255, 255, 0.9);
    
    /* Clean Theme Colors (Dashboard & Evaluation) */
    --clean-bg: #F8FAFC;
    --clean-primary: #4f46e5;
    --clean-text: #1e293b;
    --clean-border: #e2e8f0;
    --success-green: #10b981;
    --error-red: #ef4444;

    /* Shared Constants */
    --radius-lg: 20px;
    --radius-md: 12px;
    --transition: 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

/* ==========================================================================
   2. THEME: AUTHENTICATION (GLASSMORPHISM)
   ========================================================================== */
body.auth-page {
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--auth-gradient);
    background-size: cover;
    background-attachment: fixed;
}

.login-container {
    display: flex;
    width: 100%;
    max-width: 850px;
    min-height: 500px;
    background: transparent;
    border-radius: var(--radius-lg);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.login-left {
    flex: 1.2;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    padding: clamp(20px, 5vw, 40px);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-left.full-width {
    flex: 1;
    border-radius: var(--radius-lg);
}

.login-right {
    flex: 1;
    background: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

.login-left h2 {
    color: var(--text-glass);
    font-weight: 500;
    letter-spacing: 3px;
    text-align: center;
    margin-bottom: 30px;
    text-transform: uppercase;
}

.input-group { margin-bottom: 20px; }
.input-group label {
    display: block;
    color: var(--text-glass-muted);
    font-size: 13px;
    letter-spacing: 1px;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.input-group input {
    width: 100%;
    height: 45px;
    background: transparent;
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    border-radius: 25px;
    padding: 0 20px;
    color: #fff;
    transition: border var(--transition);
}

.input-group input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.9);
}

.sign-in-btn {
    width: 100%;
    height: 45px;
    background: #ffffff;
    color: var(--clean-primary);
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    margin-top: 10px;
    transition: all var(--transition);
}

.brand-logo {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.sign-in-btn:hover { background: #f1f1f1; transform: translateY(-1px); }

/* ==========================================================================
   3. THEME: CLEAN WHITE (DASHBOARD & EVALUATION)
   ========================================================================== */

.eval-body {
    background: var(--clean-bg);
    color: var(--clean-text);
    padding: 40px 20px;
}

.btn-add {
    background: var(--clean-primary);
    color: white;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background var(--transition);
    font-size: 14px;
}

.btn-add:hover {
    filter: brightness(1.1);
}

.eval-container {
    max-width: 1000px;
    margin: 0 auto;
    background: #ffffff;
    padding: 40px;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.eval-header {
    border-bottom: 3px solid var(--clean-primary);
    margin-bottom: 30px;
    padding-bottom: 15px;
    font-weight: 700;
    color: var(--clean-primary);
    text-transform: uppercase;
}

/* Sections */
.eval-section {
    margin-bottom: 30px;
    padding: 20px;
    border: 1px solid var(--clean-border);
    border-radius: var(--radius-md);
}

/* Presenter table */
.presenter-grid-container {
    border: none;
    padding: 0;
}

/* Inputs & Selects */
.eval-section select, 
.eval-section input[type="text"],
.clean-input {
    background: #ffffff;
    color: var(--clean-text);
    border: 1px solid var(--clean-border);
    border-radius: 8px;
    padding: 10px 15px;
    font-size: 14px;
    transition: all var(--transition);
}

.eval-section input[readonly] {
    background-color: #f1f5f9;
    cursor: default;
}

/* Tables */
.eval-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: #fff;
    table-layout: fixed;
}

.eval-table th, .eval-table td {
    border: 1px solid var(--clean-border);
    padding: 12px;
    text-align: left;
    word-wrap: break-word;
}

/* Cells that house full-box inputs */
.full-box-cell {
    padding: 0;
    height: 1px; /* Allows children to fill 100% height */
}

/* Inputs within cells to fill whole box */
.score-input, .part-ontime, .part-score, .pres_p, .pres_d, .pres_q{
    width: 100%;
    height: 100%;
    min-height: 50px;
    border: none;
    outline: none;
    padding: 0px;
    text-align: center;
    font-size: 16px;
    background: transparent;
    display: block;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.score-input:focus, .part-ontime:focus, .part-score:focus {
    background-color: #f0f7ff;
}

.eval-table th {
    background: #f8fafc;
    font-size: 13px;
    text-transform: uppercase;
}

.group-row td {
    background-color: #f1f5f9;
    font-weight: 700;
    text-align: center;
    color: #64748b;
}

/* Absent Dropdown */
#absentDropdown {
    width: 100%;
    max-width: 100%;
}

/* Buttons */
.btn-submit {
    background: var(--success-green);
    color: white;
    width: 100%;
    margin-top: 20px;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: none;
}

/* Highlights */
.eval-section .warning-highlight,
.eval-section select.warning-highlight,
.eval-table .warning-highlight {
    border: 2px solid var(--error-red);
    background-color: #fff5f5;
}

.hidden { display: none; }

/* ==========================================================================
   4. RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 768px) {
    .login-container {
        flex-direction: column-reverse;
        position: relative;
        top: 20px;
        left: 0;
        transform: none;
        margin: 0 auto 40px;
        width: 95%;
    }
    
    .eval-container { padding: 15px; }
    
    .eval-table { 
        display: table; 
        table-layout: auto; 
    }
    
    .eval-table th, .eval-table td {
        padding: 8px 4px;
        font-size: 12px;
    }

    .eval-table th.presenter-header {
        height: 120px;
        vertical-align: bottom;
        text-align: center;
        padding: 10px 2px;
    }

    .eval-table th.presenter-header span {
        writing-mode: vertical-rl;
        transform: rotate(180deg);
        white-space: nowrap;
        display: inline-block;
    }

    .eval-table td:first-child, .eval-table th:first-child {
        width: 100px;
        min-width: 100px;
        font-size: 11px;
    }
}

/* ==========================================================================
   5. STRUCTURAL LAYOUT & RESPONSIVE SIDEBAR
   ========================================================================== */

/* Main Layout Setup */
.layout-body {
    background-color: #F8FAFC;
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar Desktop Defaults */
.sidebar {
    width: 288px; /* Equivalent to Tailwind's w-72 */
    background-color: #ffffff;
    border-right: 1px solid var(--clean-border);
    display: flex;
    flex-direction: column;
    z-index: 50;
    transition: all 0.3s ease;
}

.sidebar-header {
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-menu-icon {
    display: none; /* Hidden on desktop */
    width: 24px;
    height: 24px;
    color: #64748b;
}

.sidebar-nav {
    flex: 1;
    padding: 8px 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px; /* Spacing between groups */
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid #f1f5f9;
}

.main-content {
    flex: 1;
    overflow-y: auto;
    background-color: rgba(248, 250, 252, 0.5);
    padding: 32px;
}

/* Mobile Responsive Adjustments (Drop-down Menu) */
@media (max-width: 768px) {
    .layout-body {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        position: absolute;
        top: 0;
        left: 0;
        border-right: none;
        border-bottom: 1px solid var(--clean-border);
    }

    .sidebar-header {
        cursor: pointer;
    }

    .mobile-menu-icon {
        display: block; /* Show hamburger icon */
    }

    /* JavaScript Toggle States (Only apply on Mobile) */
    .sidebar-collapsed {
        max-height: 88px; /* Height of the header only */
        overflow: hidden;
    }

    .sidebar-expanded {
        max-height: 80vh; /* Drops down to show navigation */
        overflow: hidden;
        box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    }

    .main-content {
        padding-top: 112px; /* Push content down so the mobile header doesn't cover it */
    }
}