:root {
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --secondary: rgba(255, 255, 255, 0.4);
    --secondary-hover: rgba(255, 255, 255, 0.6);
    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --text-main: #1E293B;
    --text-muted: #475569;
    
    /* Liquid Glass Variables */
    --glass-bg: rgba(255, 255, 255, 0.45);
    --glass-border: rgba(255, 255, 255, 0.6);
    --glass-highlight: rgba(255, 255, 255, 0.8);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
}

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

body {
    background-color: #f0f8ff;
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background Mesh Shapes for Glass effect */
.bg-shape {
    position: absolute;
    filter: blur(80px);
    z-index: -1;
    border-radius: 50%;
    animation: float 20s infinite alternate ease-in-out;
}

.shape-1 {
    width: 600px; height: 600px;
    background: rgba(147, 197, 253, 0.6); /* Soft Blue */
    top: -100px; left: -100px;
}

.shape-2 {
    width: 500px; height: 500px;
    background: rgba(196, 181, 253, 0.5); /* Soft Purple */
    bottom: -50px; right: -50px;
    animation-delay: -5s;
}

.shape-3 {
    width: 400px; height: 400px;
    background: rgba(167, 243, 208, 0.5); /* Soft Teal */
    top: 40%; left: 30%;
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(50px, 30px) scale(1.05); }
    100% { transform: translate(-30px, 50px) scale(0.95); }
}

/* Liquid Glass Panel */
.liquid-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border: 1px solid var(--glass-border);
    border-top-color: var(--glass-highlight);
    border-left-color: var(--glass-highlight);
    border-radius: 20px;
    box-shadow: var(--glass-shadow);
}

/* Utility Classes */
.hidden { display: none !important; }
.active { display: flex !important; } /* Specifically for flex containers */
section.active { display: block !important; } /* For sections */

.flex-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 24px;
}
.text-muted { color: var(--text-muted); }

/* Buttons */
button {
    cursor: pointer; border: none; border-radius: 12px;
    padding: 10px 18px; font-weight: 500; font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex; align-items: center; gap: 8px;
    backdrop-filter: blur(10px);
}
.btn-primary { 
    background: var(--primary); color: white; 
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}
.btn-primary:hover { 
    background: var(--primary-hover); transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}
.btn-secondary { 
    background: var(--secondary); color: var(--text-main);
    border: 1px solid var(--glass-border);
}
.btn-secondary:hover { background: var(--secondary-hover); }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-large { padding: 14px 24px; font-size: 1.05rem; }
.btn-sm { padding: 8px 14px; font-size: 0.85rem; border-radius: 8px;}
.btn-logout { background: transparent; border: 1px solid var(--danger); color: var(--danger); padding: 6px 12px; font-size: 0.85rem; border-radius: 8px; }
.btn-logout:hover { background: var(--danger); color: white; }

/* Login Section */
#login-section {
    height: 100dvh; width: 100vw;
    display: flex; justify-content: center; align-items: center;
    position: absolute; top: 0; left: 0; z-index: 100;
}
.login-card {
    padding: 50px 40px; text-align: center; width: 100%; max-width: 450px;
    display: flex; flex-direction: column; gap: 20px; align-items: center;
}
.logo-circle {
    width: 80px; height: 80px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #8B5CF6);
    margin-bottom: 10px;
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.3);
}

/* Main App Layout */
#app-section {
    display: flex; height: 100dvh; position: relative; z-index: 10;
}

/* Mobile Header */
.mobile-header {
    display: none; justify-content: space-between; align-items: center;
    padding: 15px 20px; background: var(--glass-bg);
    backdrop-filter: blur(10px); border-bottom: 1px solid var(--glass-border);
}
.hamburger-btn { background: transparent; padding: 5px; box-shadow: none; }
.close-sidebar-btn { display: none; background: transparent; padding: 5px; box-shadow: none; font-size: 1.5rem; }

/* Sidebar */
.sidebar {
    width: 300px; height: calc(100vh - 40px);
    margin: 20px; padding: 30px 0;
    display: flex; flex-direction: column;
    transition: transform 0.3s ease;
    position: relative;
}
.sidebar-header { display: flex; justify-content: center; align-items: center; position: relative; margin-bottom: 30px;}
.sidebar .brand {
    font-size: 1.4rem; font-weight: 700; color: var(--primary);
    text-align: center; letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.05); margin-bottom: 0;
}
#nav-menu { list-style: none; flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 0 15px;}
#nav-menu li {
    padding: 14px 20px; cursor: pointer;
    border-radius: 12px; color: var(--text-muted); font-weight: 500;
    transition: all 0.3s ease; border: 1px solid transparent;
}
#nav-menu li:hover { 
    background: rgba(255, 255, 255, 0.5); color: var(--primary); 
}
#nav-menu li.active { 
    background: rgba(255, 255, 255, 0.7); color: var(--primary); 
    border: 1px solid rgba(255,255,255,0.8);
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    font-weight: 600;
}
.user-info {
    padding: 20px 24px 0; border-top: 1px solid var(--glass-border);
    display: flex; justify-content: space-between; align-items: center;
    font-size: 0.95rem; font-weight: 600; margin: 0 15px;
}

/* Content Area */
.content {
    flex: 1; padding: 40px; overflow-y: auto; height: 100vh;
}
.content::-webkit-scrollbar { width: 8px; }
.content::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 4px; }
.tab-content h2 { margin-bottom: 30px; font-weight: 700; font-size: 1.5rem; letter-spacing: -0.5px; }

/* Dashboard Grids */
.dashboard-container {
    display: flex; flex-direction: column; gap: 24px;
}
.dashboard-box {
    padding: 30px;
}
.dashboard-box h3 { margin-bottom: 20px; font-weight: 600; color: var(--text-main); font-size: 1.25rem;}

.recent-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px;
}

/* Cards */
.booking-card, .room-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border: 1.5px solid rgba(79, 70, 229, 0.25);
    padding: 24px; border-radius: 16px;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.05);
    position: relative; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.booking-card:hover, .room-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 12px 30px rgba(79, 70, 229, 0.15);
    background: #ffffff;
}
#welcome-upcoming::-webkit-scrollbar, #welcome-completed::-webkit-scrollbar { width: 6px; }
#welcome-upcoming::-webkit-scrollbar-thumb, #welcome-completed::-webkit-scrollbar-thumb { background: rgba(79, 70, 229, 0.3); border-radius: 4px; }
.booking-card h4 { margin-bottom: 12px; font-size: 1.15rem; font-weight: 600;}
.booking-card p { margin-bottom: 8px; font-size: 0.95rem; color: var(--text-muted); line-height: 1.5;}

/* Divider */
.divider { border: 0; height: 1px; background: var(--glass-border); margin: 20px 0; }

/* Status Badges */
.status-badge {
    position: absolute; top: 24px; right: 24px;
    padding: 6px 12px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
    backdrop-filter: blur(4px);
}
.status-badge.approved { background: rgba(209, 250, 229, 0.8); color: #065F46; border: 1px solid rgba(16, 185, 129, 0.2);}
.status-badge.pending { background: rgba(254, 243, 199, 0.8); color: #92400E; border: 1px solid rgba(245, 158, 11, 0.2);}
.status-badge.rejected { background: rgba(254, 226, 226, 0.8); color: #991B1B; border: 1px solid rgba(239, 68, 68, 0.2);}

/* Calendar Container */
#calendar-container, #past-calendar-container {
    font-family: 'Inter', sans-serif;
}
.fc-theme-standard .fc-scrollgrid { border-radius: 12px; overflow: hidden; border-color: var(--glass-border); }
.fc .fc-toolbar-title { font-size: 1.5rem !important; font-weight: 600; }
.fc .fc-button-primary { 
    background-color: var(--primary) !important; 
    border-color: var(--primary) !important; 
    border-radius: 8px !important;
    margin: 0 4px !important;
    padding: 8px 16px !important;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.2) !important;
    transition: all 0.2s ease !important;
}
.fc .fc-button-primary:hover {
    background-color: var(--primary-hover) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(79, 70, 229, 0.3) !important;
}
.fc-day { background: rgba(255,255,255,0.2); }
.fc-day-today { 
    background: rgba(59, 130, 246, 0.08) !important; 
    box-shadow: inset 0 0 0 2px #3B82F6 !important;
}
.fc-event { 
    border-radius: 4px; border: none; box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: box-shadow 0.2s ease, filter 0.2s ease;
    cursor: pointer; overflow: hidden;
    font-size: 0.8rem !important;
}
.fc-event:hover {
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    z-index: 10 !important;
    filter: brightness(1.1);
}

/* Calendar Popover (+more) */
.fc-popover {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border) !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15) !important;
    padding: 8px !important;
}
.fc-popover-header {
    background: transparent !important;
    font-weight: 600;
}
.fc-popover-body .fc-daygrid-event-harness:nth-child(-n+4) {
    display: none; /* Hide the first 4 events since they are already on the grid */
}

/* Clickable Items */
.clickable-card { cursor: pointer; }
.clickable-row { cursor: pointer; transition: background 0.2s; }

/* Tables */
.table-container { overflow-x: auto; padding: 20px; }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.data-table th, .data-table td { padding: 16px 20px; text-align: left; border-bottom: 1px solid var(--glass-border); }
.data-table th { font-weight: 600; color: var(--text-muted); text-transform: uppercase; font-size: 0.8rem; letter-spacing: 0.5px; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background 0.2s; }
.data-table tbody tr:hover { background: rgba(255, 255, 255, 0.4); }

/* Modals */
.modal {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.4); backdrop-filter: blur(8px);
    z-index: 1000; justify-content: center; align-items: center;
}
.modal.active { display: flex; animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
.modal-content {
    background: rgba(255, 255, 255, 0.85); /* Less transparent for readability */
    padding: 40px; width: 100%; max-width: 650px;
    max-height: 90vh; overflow-y: auto;
    border-radius: 20px;
}
.modal-content::-webkit-scrollbar { width: 6px; }
.modal-content::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.2); border-radius: 3px; }
.modal-content h3 { margin-bottom: 20px; font-size: 1.5rem; font-weight: 700;}

.close-modal-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: transparent;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
    padding: 0;
    box-shadow: none;
}
.close-modal-btn:hover {
    color: var(--danger);
    background: transparent;
    transform: none;
}

/* Time Slot Grid */
.time-slot-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}
.time-slot-btn:hover {
    background: rgba(79, 70, 229, 0.1);
    border-color: var(--primary);
    color: var(--primary);
}
.time-slot-btn.selected {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}
#time-grid::-webkit-scrollbar { width: 4px; }
#time-grid::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.2); border-radius: 2px; }

/* Forms */
.form-input, .form-select {
    width: 100%; padding: 10px 14px; margin-bottom: 12px;
    border: 1px solid rgba(0,0,0,0.1); border-radius: 10px;
    font-size: 0.9rem; outline: none; transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}
.form-input:focus, .form-select:focus { 
    border-color: var(--primary); background: white; 
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1); 
}
label { display: block; margin-bottom: 4px; font-size: 0.85rem; font-weight: 600; color: var(--text-main); }
.modal-actions { display: flex; justify-content: flex-end; gap: 16px; margin-top: 20px; }

/* Grid Container */
.grid-container { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }

/* Color Picker */
.color-picker-container { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.color-swatch { width: 40px; height: 40px; border-radius: 10px; cursor: pointer; border: 2px solid transparent; transition: all 0.2s; }
.color-swatch:hover { transform: translateY(-3px) scale(1.05); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.color-swatch.active { border-color: var(--text-main); transform: scale(1.1); box-shadow: 0 6px 15px rgba(0,0,0,0.2); }

/* Responsive Mobile & Tablet */
@media (max-width: 768px) {
    #app-section { flex-direction: column; }
    .mobile-header { display: flex; }
    .sidebar {
        position: fixed; top: 0; left: 0; margin: 0; height: 100dvh; z-index: 1000;
        transform: translateX(-100%);
        border-radius: 0 20px 20px 0;
        box-shadow: 4px 0 20px rgba(0,0,0,0.1);
    }
    .sidebar.open { transform: translateX(0); }
    .close-sidebar-btn { display: block; position: absolute; right: 20px; top: 0; }
    .content { padding: 20px; }
    .dashboard-box { padding: 20px; }
    .recent-grid { grid-template-columns: 1fr; }
    .grid-container { grid-template-columns: 1fr; }
    
    #detail-content > div { grid-template-columns: 1fr !important; gap: 15px !important; }
    .booking-card > div { flex-wrap: wrap; }
    .modal-actions { flex-direction: column; }
    .modal-actions button { width: 100%; justify-content: center; }

    /* Make Modals Full Screen on Mobile like Native Apps */
    .modal { align-items: flex-start; }
    .modal-content {
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
        padding: 25px 20px;
    }

    /* FullCalendar Mobile Fixes */
    .fc-header-toolbar {
        flex-direction: column !important;
        gap: 10px;
    }
    .fc-toolbar-chunk {
        display: flex;
        justify-content: center;
        width: 100%;
        flex-wrap: wrap;
    }
    .fc .fc-toolbar-title {
        font-size: 1.25em !important;
    }
    .fc .fc-button {
        padding: 0.2em 0.5em !important;
        font-size: 0.85em !important;
    }
}

/* Animations */
@keyframes fadeIn { 
    from { opacity: 0; transform: translateY(20px) scale(0.98); } 
    to { opacity: 1; transform: translateY(0) scale(1); } 
}
@keyframes spinner-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}