@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css'); /* Font Awesome Icons */

:root {
    --primary-green: #2c253f; /* A green close to the sidebar color */
    --dark-green: #28a745;
    --secondary-purple: #9b59b6; /* From previous designs */
    --light-blue: #71b7e6;
    --text-dark: #333;
    --text-light: #f4f4f4;
    --card-bg: #fff;
    --border-color: #eee;
    --shadow-light: 0 4px 8px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 6px 12px rgba(0, 0, 0, 0.15);
}

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

body {
    font-family: 'Poppins', sans-serif; /* Using Poppins as defined first */
    background-color: #f4f7f6; /* Light grey background for the main area */
    color: var(--text-dark);
    min-height: 100vh;
}

/* --- Main Layout Container --- */
.dashboard-container {
    display: flex;
    width: 100%;
    /* Added for mobile sidebar transition */
    overflow-x: hidden; /* Prevent horizontal scroll when sidebar slides out */
}

/* --- Sidebar (Desktop Defaults) --- */
.sidebar {
    width: 250px; /* Fixed width for desktop sidebar */
    background-color: var(--primary-green); /* Main sidebar background color */
    color: var(--text-light);
    padding: 20px 0;
    box-shadow: var(--shadow-medium);
    display: flex;
    flex-direction: column;
    position: fixed; /* Keep sidebar fixed on desktop */
    height: 100vh; /* Full height */
    left: 0;
    top: 0;
    z-index: 1000;
    transition: transform 0.3s ease-in-out; /* For mobile slide animation */
}

.sidebar .logo {
    text-align: center;
    padding: 10px 0 10px;
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 1px;
}

.sidebar .logo img {
    height: 40px;
    vertical-align: middle;
    margin-right: 10px;
}

.sidebar nav ul {
    list-style: none;
    padding: 0;
}

.sidebar nav ul li {
    margin-bottom: 5px;
}

.sidebar nav ul li a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--text-light); /* Default text color for navigation links */
    text-decoration: none;
    font-size: 16px;
    transition: background-color 0.3s ease, color 0.3s ease, border-left 0.3s ease, padding-left 0.3s ease;
}

.sidebar nav ul li a i {
    margin-right: 15px;
    font-size: 18px;
}

.sidebar nav ul li a:hover,
.sidebar nav ul li.active a {
    background-color: rgba(255, 255, 255, 0.2); /* Green highlight background (as per your current design) */
    color: #fff; /* White text on hover/active */
    border-left: 5px solid #fff; /* Highlight active item */
    padding-left: 15px; /* Adjust for border */
}

/* --- Main Content Area (Desktop Defaults) --- */
.main-content {
    flex-grow: 1; /* Take remaining space */
    margin-left: 250px; /* Offset for fixed sidebar on desktop */
    padding: 20px;
    background-color: #f4f7f6;
    transition: margin-left 0.3s ease, transform 0.3s ease-in-out; /* For sidebar push animation */
}

/* --- Header (Desktop Defaults) --- */
.header {
    background-color: var(--card-bg);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-light);
    border-radius: 8px;
    margin-bottom: 20px;
    position: sticky; /* Make header sticky */
    top: 0;
    z-index: 999; /* Below sidebar, above content */
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    gap: 15px; /* Space between elements */
}

/* Menu Toggle Button (Hidden on Desktop) */
.menu-toggle {
    display: none; /* Hidden by default on desktop */
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-dark);
    cursor: pointer;
    padding: 0; /* Adjust padding as needed */
    order: -1; /* Place it before school info on mobile */
}


.header .school-info {
    display: flex;
    align-items: center;
    flex-grow: 1; /* Allow school info to take available space on mobile */
}

.header .school-info img {
    height: 35px;
    margin-right: 10px;
}

.header .school-info h1 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-dark);
}

.header .header-right {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: nowrap; /* Prevent wrapping by default on desktop */
    justify-content: flex-end; /* Align to the right */
}

.header .language-select select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 14px;
    background-color: #f9f9f9;
    /* Custom select arrow styles */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23666%22%20d%3D%22M287%2C114.7L146.2%2C255.5L5.4%2C114.7H287z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 10px;
    padding-right: 30px;
}
select::-ms-expand {
    display: none;
}


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

.header .search-bar input {
    padding: 8px 12px 8px 35px; /* Left padding for icon */
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 14px;
    width: 200px;
    transition: width 0.3s ease;
}

.header .search-bar input:focus {
    width: 250px;
    border-color: var(--primary-green);
    outline: none;
}

.header .search-bar i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.header .notifications {
    position: relative;
    cursor: pointer;
    color: #666;
    font-size: 18px;
}

.header .notifications .badge {
    position: absolute;
    top: -5px;
    right: -8px;
    background-color: #e74c3c;
    color: white;
    font-size: 10px;
    padding: 3px 6px;
    border-radius: 50%;
}

.header .user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.header .user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--light-blue);
}

.header .user-profile .user-name {
    font-size: 15px;
    font-weight: 500;
}

.header .user-profile .user-email {
    font-size: 12px;
    color: #777;
}

/* --- Dashboard Content --- */
.dashboard-content {
    padding: 0 10px;
}

.dashboard-content h2 {
    color: var(--text-dark);
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.8em;
    display: flex;
    align-items: center;
}

.dashboard-content h2 .fas,
.dashboard-content h2 .far {
    margin-right: 10px;
    color: var(--light-blue); /* Using your defined light-blue for icon accent */
}


.welcome-banner {
    background-image: url('https://via.placeholder.com/1200x200/F5F5F5/888888?text=Your+Banner+Image+Here');
    background-size: cover;
    background-position: center;
    border-radius: 10px;
    padding: 40px;
    color: var(--text-dark);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    box-shadow: var(--shadow-light);
    position: relative;
}

.welcome-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
}

.welcome-banner * {
    position: relative;
    z-index: 1;
}

.welcome-banner .user-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 20px;
    border: 3px solid var(--primary-green);
}

.welcome-banner .welcome-text h3 {
    font-size: 24px;
    margin-bottom: 5px;
    color: #0f5509;
}

.welcome-banner .welcome-text p {
    font-size: 16px;
    color: #1c7a14;
}

.welcome-banner .action-button {
    background-color: var(--dark-green);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.welcome-banner .action-button:hover {
    background-color: #218838;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background-color: #f1f1f1;
    padding: 25px;
    border-radius: 10px;
    box-shadow: var(--shadow-light);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card .icon {
    font-size: 45px;
    color: var(--light-blue);
    margin-bottom: 15px;
}

.stat-card.teachers .icon { color: #5cb85c; }
.stat-card.students .icon { color: #5bc0de; }
.stat-card.staff .icon { color: #f0ad4e; }
.stat-card.streams .icon { color: #0275d8; }

.stat-card .count {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.stat-card .label {
    font-size: 16px;
    color: #1a1919;
    margin-bottom: 15px;
}

.stat-card .arrow {
    position: absolute;
    bottom: 15px;
    right: 20px;
    font-size: 20px;
    color: #aaa;
    transition: color 0.3s ease;
}
.stat-card:hover .arrow {
    color: var(--primary-green);
}

.dashboard-sections {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.upcoming-events-card, .calendar-card {
    background-color: var(--card-bg);
    padding: 25px;
    border-radius: 10px;
    box-shadow: var(--shadow-light);
}

.upcoming-events-card h3, .calendar-card h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.upcoming-events-card .add-event-btn {
    background-color: var(--light-blue);
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.upcoming-events-card .add-event-btn:hover {
    background-color: #4a90e2;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.calendar-nav-buttons button {
    background: none;
    border: 1px solid var(--border-color);
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    color: #777;
    transition: background-color 0.3s ease;
}

.calendar-nav-buttons button:hover {
    background-color: #f0f0f0;
}

.calendar-month-year {
    font-size: 18px;
    font-weight: 600;
}

.calendar-view-buttons button {
    background-color: #eee;
    border: none;
    padding: 5px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    margin-left: 5px;
    color: #555;
    transition: background-color 0.3s ease;
}

.calendar-view-buttons button.active,
.calendar-view-buttons button:hover {
    background-color: var(--primary-green);
    color: white;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    font-size: 14px;
    text-align: center;
}

.calendar-grid .day-name {
    font-weight: 600;
    padding: 8px 0;
    color: #555;
}

.calendar-grid .day-number {
    padding: 10px 0;
    border-radius: 5px;
    background-color: #fdfdfd;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.calendar-grid .day-number:hover {
    background-color: #e0e0e0;
}

.calendar-grid .day-number.today {
    background-color: var(--light-blue);
    color: white;
    font-weight: 600;
}

.calendar-grid .day-number.selected {
    background-color: var(--primary-green);
    color: white;
    font-weight: 600;
}

/* --- General elements from previous designs (Forms, Buttons etc.) --- */
.container {
    background-color: var(--card-bg);
    padding: 40px;
    border-radius: 10px;
    box-shadow: var(--shadow-light);
    width: 400px;
    max-width: 90%;
    text-align: center;
    margin: 50px auto;
}

.form-group { margin-bottom: 20px; text-align: left; }
label { display: block; margin-bottom: 8px; color: #555; font-weight: 500; }
input[type="text"], input[type="email"], input[type="password"], select, input[type="datetime-local"], textarea { /* Added datetime-local, textarea */
    width: calc(100% - 22px); padding: 12px; border: 1px solid #ccc;
    border-radius: 5px; font-size: 16px; transition: border-color 0.3s ease;
    background-color: #fff;
}
input[type="text"]:focus, input[type="email"]:focus, input[type="password"]:focus, select:focus, input[type="datetime-local"]:focus, textarea:focus { /* Added datetime-local, textarea */
    border-color: var(--secondary-purple); outline: none;
}
input[type="color"] { /* Specific style for color picker */
    width: 60px;
    height: 40px;
    padding: 0;
    vertical-align: middle;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
}

.error { color: #e74c3c; font-size: 0.85em; margin-top: 5px; display: block; text-align: left;}
.success { color: #28a745; font-size: 0.9em; margin-bottom: 20px; background-color: #e6ffe6; border: 1px solid #c3e6cb; padding: 10px; border-radius: 5px;}
input[type="submit"] {
    background-color: var(--secondary-purple); color: white; padding: 12px 20px;
    border: none; border-radius: 5px; cursor: pointer; font-size: 18px;
    font-weight: 500; width: 100%; transition: background-color 0.3s ease, transform 0.2s ease;
    margin-top: 10px;
}
input[type="submit"]:hover { background-color: #8e44ad; transform: translateY(-2px); }

/* General Button Styles */
.btn {
    display: inline-block;
    background-color: var(--light-blue); /* Default button color */
    color: white;
    padding: 10px 20px;
    border: none; /* No border for general buttons */
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none; /* For link-like buttons */
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
    background-color: #4a90e2;
    transform: translateY(-2px);
    box-shadow: var(--shadow-light); /* Add subtle shadow on hover */
}

/* Specific Button Styles */
.btn-primary {
    background-color: var(--primary-green); /* Use your primary green for primary actions */
}
.btn-primary:hover {
    background-color: #2c253f; /* Slightly darker primary green on hover */
}

.btn-success {
    background-color: var(--dark-green); /* Your defined dark-green */
}
.btn-success:hover {
    background-color: #218838;
}

.btn-danger {
    background-color: #e74c3c; /* Red for destructive actions */
}
.btn-danger:hover {
    background-color: #c0392b;
}

.link-text { margin-top: 25px; font-size: 0.95em; color: #666; }
.link-text a { color: var(--light-blue); text-decoration: none; font-weight: 500; transition: color 0.3s ease; }
.link-text a:hover { color: #4a90e2; text-decoration: underline; }

/* --- Overlay for Mobile Sidebar --- */
.overlay {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); /* Semi-transparent black */
    z-index: 1001; /* Above main content, below sliding sidebar */
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}
.overlay.active {
    display: block;
    opacity: 1;
}


/* ======================================================================
   FullCalendar Specific Styles and Event Modal (Integrated)
   ====================================================================== */

.calendar-container {
    margin-top: 20px;
    padding: 25px;
    background-color: var(--card-bg); /* Use your card background */
    border-radius: 10px;
    box-shadow: var(--shadow-light); /* Use your shadow style */
    border: 1px solid var(--border-color); /* Use your border color */
}
#calendar {
    max-width: 900px; /* Adjust as needed */
    margin: 0 auto;
    font-family: 'Poppins', sans-serif; /* Consistent font */
}

/* FullCalendar Header Toolbar */
.fc-header-toolbar {
    margin-bottom: 25px !important;
    align-items: center;
    flex-wrap: wrap; /* Allow wrapping on small screens */
}

/* FullCalendar Title */
.fc-toolbar-title {
    font-size: 1.8em !important;
    color: var(--text-dark) !important;
    font-weight: 600 !important;
}

/* FullCalendar Buttons (Prev, Next, Today, Views) */
.fc-button {
    background-color: var(--dark-green); /* Using your defined dark-green */
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 0.9em;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.fc-button:hover {
    background-color: #218838; /* Darker dark-green on hover */
    transform: translateY(-1px);
}
.fc-button:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.fc-button-group .fc-button {
    border-radius: 0;
}
.fc-button-group .fc-button:first-child {
    border-top-left-radius: 5px;
    border-bottom-left-radius: 5px;
}
.fc-button-group .fc-button:last-child {
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
}

.fc-button-primary:not(:disabled).fc-button-active {
    background-color: #1a712f; /* Even darker green for active state */
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}

/* Day Headers (Mon, Tue, Wed...) */
.fc-col-header-cell-cushion {
    color: #555555;
    font-weight: 600;
    padding: 10px 0;
    background-color: #f8f8f8; /* Light background for day headers */
    border-bottom: 1px solid var(--border-color);
}

/* Day Numbers in Month View */
.fc-daygrid-day-number {
    font-size: 1.1em;
    font-weight: 500;
    color: var(--text-dark);
    padding: 8px;
}

/* Today's Date */
.fc-day-today {
    background-color: #e6f7ff !important; /* Light blue background for today */
    border-radius: 5px;
}
.fc-day-today .fc-daygrid-day-number {
    color: var(--light-blue); /* Use your light-blue for today's number */
    font-weight: 700;
}

/* Events */
.fc-event {
    border: none !important;
    color: white !important;
    background-color: var(--light-blue) !important; /* Default event color: your light-blue */
    border-radius: 4px;
    padding: 3px 7px;
    font-size: 0.9em;
    margin-bottom: 2px;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.fc-event:hover {
    opacity: 0.9;
}

/* Event Title and Time */
.fc-event-time {
    font-weight: 600;
    margin-right: 5px;
}
.fc-event-title {
    font-weight: 400;
}

/* Modal for event details/creation */
.modal {
    display: none;
    position: fixed;
    z-index: 1002; /* Above sidebar and overlay */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: var(--card-bg);
    padding: 30px 40px;
    border: 1px solid var(--border-color);
    width: 90%;
    max-width: 550px;
    border-radius: 10px;
    position: relative;
    box-shadow: var(--shadow-medium); /* Use a slightly stronger shadow for modals */
    animation: fadeIn 0.3s ease-out;
}

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

.close-button {
    color: #888;
    font-size: 32px;
    font-weight: bold;
    position: absolute;
    top: 15px;
    right: 25px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close-button:hover,
.close-button:focus {
    color: var(--primary-green); /* Use your primary green on hover/focus */
}

.modal-content h3 {
    margin-top: 0;
    color: var(--text-dark);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    margin-bottom: 25px;
    font-size: 1.6em;
    font-weight: 600;
}

.modal-content label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #555;
    font-size: 0.95em;
}

/* Modal form elements will use the general form input styles defined earlier */
.modal-content input[type="text"],
.modal-content input[type="datetime-local"],
.modal-content textarea,
.modal-content select,
.modal-content input[type="color"] {
    /* These styles are largely covered by your general input[type="text"] etc. */
    /* Only specific overrides or additions are needed here if any */
    margin-bottom: 20px; /* Ensure consistent spacing */
}


/* Modal buttons will use your existing .btn, .btn-primary, .btn-danger classes */
.modal-content .btn {
    padding: 12px 25px; /* Slightly larger padding for modal buttons */
    font-size: 1.05em;
    margin-right: 15px; /* Space between buttons */
}
.modal-content .btn:last-child {
    margin-right: 0; /* No right margin for the last button */
}


/* ======================================================================
   Responsive Design (Mobile First Approach) - Continued with Calendar
   ====================================================================== */

/* For devices up to 992px (tablets and smaller laptops) */
@media (max-width: 992px) {
    .dashboard-sections {
        grid-template-columns: 1fr; /* Stack columns on smaller screens */
    }
    .header .search-bar input {
        width: 150px; /* Slightly reduce search bar width */
    }
    .welcome-banner {
        padding: 30px; /* Reduce banner padding */
    }
    .welcome-banner .welcome-text h3 {
        font-size: 50px; /* Slightly smaller font */
    }
}

/* For devices up to 768px (most tablets and phones) */
@media (max-width: 768px) {
    /* Main Layout */
    .dashboard-container {
        flex-direction: column; /* Stack sidebar and main content */
        position: relative; /* Context for sliding elements */
    }

    /* Sidebar - Sliding Behavior for Mobile */
    .sidebar {
        width: 250px; /* Fixed width for the sliding sidebar */
        position: fixed; /* Keep it fixed off-screen */
        left: -250px; /* Start off-screen */
        top: 0;
        height: 100vh;
        z-index: 1001; /* Ensure it's above everything else */
        box-shadow: var(--shadow-medium); /* Add shadow for depth */
        padding-top: 0; /* Adjust padding if needed for mobile logo */
    }

    .sidebar.active {
        left: 0; /* Slide in when active */
    }

    .sidebar .logo {
        padding: 20px 0; /* Adjust logo padding for mobile */
    }

    .sidebar nav ul {
        flex-direction: column; /* Stack nav items vertically again */
        align-items: flex-start; /* Align left */
    }

    .sidebar nav ul li a {
        padding: 10px 20px; /* Adjust padding */
        font-size: 15px;
        flex-direction: row; /* Keep icon and text in a row */
        text-align: left;
        border-left: none; /* Reset desktop border */
        border-bottom: none; /* Reset horizontal border */
    }

    .sidebar nav ul li a:hover,
    .sidebar nav ul li.active a {
        border-left: 5px solid #fff; /* Re-apply left border for active */
        padding-left: 15px; /* Adjust padding for border */
        border-bottom: none; /* Ensure no bottom border */
    }


    /* Main Content */
    .main-content {
        margin-left: 0; /* No fixed offset for sidebar */
        padding: 15px; /* Adjust padding */
        width: 100%;
        /* Push content to the right when sidebar is open */
        transform: translateX(0);
        transition: transform 0.3s ease-in-out;
    }

    .dashboard-container.sidebar-open .main-content {
        transform: translateX(250px); /* Push main content to the right */
    }

    /* Header */
    .header {
        flex-wrap: wrap; /* Allow items to wrap */
        padding: 10px 15px; /* Adjust padding */
        gap: 10px; /* Reduce gap */
        justify-content: space-between; /* Space out elements */
        position: sticky; /* Keep it sticky on top */
        top: 0;
        z-index: 999;
    }

    .menu-toggle {
        display: block; /* Show menu button */
    }

    .header .school-info {
        flex-grow: 1; /* Allow school info to expand */
        justify-content: flex-start; /* Align school info to the left */
    }

    .header .school-info h1 {
        font-size: 1.2em; /* Smaller font for school name */
        white-space: nowrap; /* Prevent wrapping for school name */
        text-overflow: ellipsis; /* Add ellipsis if too long */
        overflow: hidden;
    }

    .header .header-right {
        width: 100%; /* Take full width on small screens */
        justify-content: flex-end; /* Align elements to the right */
        flex-wrap: wrap; /* Allow wrapping within header-right */
        gap: 10px;
    }

    .header .search-bar {
        order: 1; /* Put search bar after notifications/user */
        flex-grow: 1; /* Allow search bar to take available space */
        min-width: 120px; /* Ensure a minimum width for search */
    }
    .header .search-bar input {
        width: 100%; /* Make input fill its container */
        padding: 8px 10px 8px 35px;
    }
    .header .search-bar input:focus {
        width: 100%; /* Still full width when focused */
    }

    .header .notifications {
        order: 0; /* Place notifications first */
        margin-left: auto; /* Push notifications to the far right */
    }

    .header .user-profile {
        display: none; /* Hide full user profile on smaller screens, can be part of sidebar if needed */
        /* If you want to show just the image, you'd adjust this */
    }
    .header .language-select {
        order: 2; /* Position language select last */
    }


    /* Welcome Banner */
    .welcome-banner {
        flex-direction: column; /* Stack avatar, text, and button */
        text-align: center;
        padding: 20px;
        align-items: center;
    }

    .welcome-banner .user-avatar {
        margin-right: 0;
        margin-bottom: 15px;
    }

    .welcome-banner .welcome-text {
        margin-right: 0;
        margin-bottom: 15px;
    }

    .welcome-banner .action-button {
        width: 80%; /* Make button wider */
        max-width: 250px; /* Limit max width */
    }

    /* Dashboard Stats Cards */
    .dashboard-stats {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); /* Allow 2-3 columns on tablets */
        gap: 15px;
    }
    .stat-card {
        padding: 20px;
    }
    .stat-card .count {
        font-size: 28px;
    }
    .stat-card .icon {
        font-size: 40px;
    }

    /* Dashboard Sections (Events & Calendar) */
    .dashboard-sections {
        grid-template-columns: 1fr; /* Stack events and calendar */
        gap: 20px;
    }

    .upcoming-events-card,
    .calendar-card {
        padding: 20px;
    }

    /* Calendar Grid */
    .calendar-grid {
        font-size: 0.9em;
        gap: 3px;
    }
    .calendar-grid .day-number, .calendar-grid .day-name {
        padding: 5px 0; /* Reduce padding for smaller cells */
        font-size: 0.9em;
    }

    /* FullCalendar Specific Adjustments for smaller screens */
    .fc-toolbar-title {
        font-size: 1.4em !important;
    }
    .fc-header-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }
    .fc-toolbar-chunk {
        margin-bottom: 10px;
    }
    .modal-content {
        width: 95%;
        padding: 20px 30px;
    }
    .modal-content button {
        width: 100%; /* Make modal buttons full width */
        margin-right: 0;
        margin-bottom: 10px;
    }
    .modal-content .btn:last-child {
        margin-bottom: 0; /* No bottom margin for the last button */
    }
}

/* For devices up to 576px (smaller phones) */
@media (max-width: 576px) {
    .header .school-info h1 {
        font-size: 1em; /* Even smaller font for school name */
    }

    .header .header-right {
        flex-direction: column; /* Stack header-right items */
        align-items: center; /* Center them */
        gap: 8px; /* Reduce gap */
    }

    .header .search-bar,
    .header .language-select,
    .header .notifications {
        width: 100%; /* Take full width */
        flex-basis: auto; /* Remove flex basis */
        justify-content: center; /* Center content */
    }
    .header .search-bar input {
        width: 90%; /* Adjust input width for centered elements */
    }
    .header .search-bar input:focus {
        width: 100%; /* Still full width when focused */
    }

    .header .search-bar i {
        left: 20px; /* Adjust icon position if input is centered */
    }

    /* Stat Cards - single column for very small phones */
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    .stat-card {
        max-width: 100%; /* Ensure single column */
    }

    /* Calendar Grid */
    .calendar-grid {
        font-size: 0.8em;
        gap: 2px;
    }
    .calendar-grid .day-number, .calendar-grid .day-name {
        padding: 3px 0;
        font-size: 0.8em;
    }
    .calendar-header {
        flex-wrap: wrap; /* Allow buttons to wrap */
        justify-content: center;
        gap: 10px;
    }
    .calendar-nav-buttons, .calendar-view-buttons {
        flex-basis: 100%; /* Buttons take full width */
        text-align: center;
    }
}
/* --- Mobile Footer Navigation (Betpawa-Style) --- */

/* 1. The main container: Fixed position, white background, shadow, and safe area inset for modern phones. */
#mobile-footer-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px; /* Generous height for touch targets */
    background: #ffffff;
    border-top: 1px solid #e0e0e0; /* Light border at the top */
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1); /* Subtle shadow above the bar */
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom, 0px); /* Handles notches/gestures on iOS */
    display: none; /* IMPORTANT: This is often hidden by default on desktop via a media query */
}

/* 2. List container: Uses Flexbox to space items evenly across the width. */
#mobile-footer-nav ul {
    display: flex;
    list-style: none; /* Remove bullet points */
    height: 100%;
    margin: 0;
    padding: 0;
}

/* 3. List Item: Ensures each item takes equal space. */
#mobile-footer-nav li {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 4. Anchor/Button Item: Sets the look for the icon and text. */
#mobile-footer-nav a {
    display: flex;
    flex-direction: column; /* Stacks icon on top of text */
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #666666; /* Default gray text/icon color (inactive) */
    font-size: 10px; /* Small text size typical of mobile footers */
    font-weight: 500;
    width: 100%;
    height: 100%;
    transition: all 0.3s ease;
    position: relative;
}

/* 5. Icon Style */
#mobile-footer-nav a i {
    font-size: 22px; /* Prominent icon size */
    margin-bottom: 4px;
    transition: all 0.3s ease;
}

/* 6. Active State (Crucial Betpawa/App-Style Detail) */
#mobile-footer-nav a.active {
    color: #4f46e5; /* **Indigo color for active state** (Primary/Accent color) */
}

/* 7. Active Indicator Bar (The little colored line above the active icon) */
#mobile-footer-nav a.active::after {
    content: '';
    position: absolute;
    top: 0; /* Positioned at the very top of the item */
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px; /* Thin line */
    background: #4f46e5; /* Matches the active color */
    border-radius: 2px;
}
/* --- More Menu Modal (Slides Up from Bottom) --- */

#more-menu-modal {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: auto;
    max-height: 80vh; /* Limits the modal to 80% of viewport height */
    background-color: #fff;
    border-top-left-radius: 20px; /* Rounded top corners */
    border-top-right-radius: 20px;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.15);
    z-index: 2000;
    transform: translateY(100%); /* Hides the modal completely below the screen initially */
    transition: transform 0.3s ease-in-out;
    padding-bottom: env(safe-area-inset-bottom, 20px);
    overflow-y: auto;
    display: none; /* Hide modal initially (will be shown on button click) */
}

/* Class added by JavaScript to show the modal */
#more-menu-modal.show {
    transform: translateY(0); /* Slides the modal into full view */
}
