/* 
   🎨 Design System: CESE App Modern (Testbed)
   Layout: Sidebar + Fluid Content
*/

:root {
    --sidebar-width: 280px;
    --header-height: 70px;

    --primary: #2563eb;
    --primary-dark: #1e3a8a;
    --bg-main: #f3f4f6;
    --text-dark: #1f2937;
    --text-white: #ffffff;
}

body {
    background-color: var(--bg-main);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
}

/* --- Layout Grid --- */
.app-layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    grid-template-rows: var(--header-height) 1fr;
    min-height: 100vh;
}

/* --- Mobile Navigation (Bottom Bar) --- */
.mobile-bottom-nav {
    display: none;
    /* Hidden on Desktop */
}

@media (max-width: 768px) {
    .app-layout {
        display: block;
        /* Stack layout */
        padding-bottom: 70px;
        /* Space for bottom bar */
    }

    .app-sidebar {
        display: none !important;
        /* Hide Sidebar on Mobile */
    }

    .app-header {
        padding: 0 1rem;
        height: 60px;
    }

    .page-title {
        font-size: 1.2rem;
    }

    /* Bottom Bar Container */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        height: 65px;
        /* iOS standard ~49-80 */
        width: 100%;
        background: white;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
        /* Premium Shadow */
        z-index: 1030;
        justify-content: space-around;
        align-items: center;
        padding-bottom: env(safe-area-inset-bottom);
        /* iOS Safe Area */
        border-top-left-radius: 16px;
        border-top-right-radius: 16px;
    }

    /* Nav Items */
    .mobile-nav-item {
        color: #94a3b8;
        text-decoration: none;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        font-size: 0.75rem;
        /* Text size */
        font-weight: 500;
        padding: 8px;
        flex-grow: 1;
        transition: all 0.2s;
    }

    .mobile-nav-item i {
        font-size: 1.25rem;
        margin-bottom: 4px;
        transition: transform 0.2s;
    }

    /* Active State */
    .mobile-nav-item.active {
        color: var(--primary);
    }

    .mobile-nav-item.active i {
        transform: translateY(-2px);
    }

    /* Center FAB effect (Calendar) */
    .mobile-nav-item.highlight {
        background: var(--primary);
        color: white;
        width: 48px;
        height: 48px;
        border-radius: 50%;
        margin-bottom: 25px;
        /* Push up */
        box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
        flex-grow: 0;
        /* Fixed size */
        padding: 0;
        display: flex;
        /* Ensure centering */
        justify-content: center;
    }

    .mobile-nav-item.highlight i {
        margin-bottom: 0;
        font-size: 1.2rem;
    }

    /* Remove text for FAB */
    .mobile-nav-item.highlight span {
        display: none;
    }
}

/* --- Sidebar --- */
.app-sidebar {
    grid-row: 1 / -1;
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.brand {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

.nav-item {
    padding: 0.8rem 1rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.2s;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    transform: translateX(4px);
}

.nav-item i {
    width: 24px;
    text-align: center;
}

/* --- Top Header --- */
.app-header {
    background: white;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
}

/* User Profile in Header */
.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px;
    border-radius: 50px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

/* --- Main Content --- */
.app-main {
    padding: 2rem;
    overflow-y: auto;
}

/* --- Calendar Radical Redesign --- */
.fc-theme-standard td,
.fc-theme-standard th {
    border: 1px solid #f1f5f9 !important;
    /* Subtle grid border for readability */
}

.fc-scrollgrid {
    border: none !important;
}

.fc-col-header-cell {
    padding: 10px 0;
    background: #f8fafc;
    /* Date header bg */
}

.fc-daygrid-day {
    transition: background 0.2s;
}

/* Weekend Highlight */
.fc-day-sat,
.fc-day-sun {
    background-color: #f8fafc75;
    /* Very subtle weekend dim */
}

.fc-daygrid-day:hover {
    background: #eef2ff;
}

.fc-daygrid-day-number {
    font-weight: 600;
    color: #64748b;
    padding: 8px 12px !important;
}

.fc-day-today {
    background: transparent !important;
}

.fc-day-today .fc-daygrid-day-number {
    background: var(--primary);
    color: white;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 4px;
}

/* Events as Pills */
.fc-event {
    border-radius: 50px !important;
    padding: 4px 12px !important;
    font-size: 0.85rem !important;
    border: none !important;
    margin: 2px 4px !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.fc-toolbar-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 800 !important;
    font-size: 1.75rem !important;
    color: var(--primary-dark);
}

.fc-button {
    border-radius: 50px !important;
    text-transform: capitalize;
    font-weight: 600;
    padding: 8px 20px !important;
    background: white !important;
    color: var(--text-dark) !important;
    border: 1px solid #e5e7eb !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.fc-button-active {
    background: var(--primary) !important;
    color: white !important;
    border-color: var(--primary) !important;
}

/* Modal Fix */
.modal-backdrop {
    z-index: 1040;
}

.modal {
    z-index: 1050;
}