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

/* ---------- Fonts & Body ---------- */
body {
    font-family: 'Poppins', Arial, sans-serif;
    background: linear-gradient(135deg, #74ebd5, #ACB6E5);
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 15px;
}

/* ---------------------------------------------------- */
/* ---------- School Header (FIXED FOR COMPACTNESS) ---------- */
/* ---------------------------------------------------- */
.header {
    /* FIX 1: Stack the logo and title vertically and center them */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.header img {
    /* USER PREFERENCE APPLIED: 3x larger logo (max-height: 180px) and smaller padding (5px) */
    width: 180px;
    height: 180px;
    margin-right: 0;
    margin-bottom: 5px;
    border-radius: 8px;
    border: 1px solid #ccc;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    object-fit: cover;
    /* Ensures logo isn't stretched */
    padding: 5px;
    /* Applied user preference for padding */
}

/* --- START OF METALLIC EFFECT CHANGES --- */
.header h1 {
    /* *** 1. FONT STYLE & SIZE */
    font-family: 'Arial Black', Gadget, sans-serif;
    font-size: 2.5rem;
    /* Increased size for impact */
    font-weight: 900;
    line-height: 1.2;
    margin: 0;
    /* Keep margin reset */
    text-align: center;
    /* Ensures text is centered */

    /* *** 2. COLOR GRADIENT (THE METALLIC EFFECT) */
    background: linear-gradient(180deg,
            #E0FFFF 0%,
            /* Bright Highlight (Light Cyan) */
            #6DA0C4 25%,
            /* Medium Blue Tone */
            #29688F 45%,
            /* Deeper Blue Tone */
            #0B354C 55%,
            /* Dark Blue Core (The depth of the metal) */
            #29688F 75%,
            #6DA0C4 95%,
            #E0FFFF 100%);
    /* Bottom Highlight */

    /* These properties apply the gradient to the text itself and MUST be kept */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    /* Standard property */
    color: transparent;
    /* Required for the clipping to work */

    /* *** 3. TEXT SHADOW / GLOW */
    text-shadow:
        0 0 8px rgba(173, 216, 230, 0.6),
        /* Pale Blue Inner Glow */
        0 5px 15px rgba(0, 0, 0, 0.6);
    /* Deeper drop shadow for depth */
    letter-spacing: 2px;
}

/* --- END OF METALLIC EFFECT CHANGES --- */


/* ---------- View Panels ---------- */
.view {
    width: 100%;
    max-width: 380px;
    /* compact panel */
    background-color: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

/* Headings */
.view h1,
.view h2,
.view h3,
.view h4 {
    margin-bottom: 12px;
    color: #444;
}

/* ---------- Inputs & Dropdowns ---------- */
input,
select,
textarea {
    width: 100%;
    padding: 8px;
    font-size: 13px;
    border-radius: 6px;
    border: 1px solid #ccc;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    background-color: #f9f9f9;
    font-family: 'Poppins', Arial, sans-serif;
    /* Ensure inputs use the font */
}
/* ---------- General Reset ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ---------- Fonts & Body ---------- */
body {
    font-family: 'Poppins', Arial, sans-serif;
    background: linear-gradient(135deg, #74ebd5, #ACB6E5);
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 15px;
}

/* ---------------------------------------------------- */
/* ---------- School Header (FIXED FOR COMPACTNESS) ---------- */
/* ---------------------------------------------------- */
.header {
    /* FIX 1: Stack the logo and title vertically and center them */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.header img {
    /* USER PREFERENCE APPLIED: 3x larger logo (max-height: 180px) and smaller padding (5px) */
    width: 180px;
    height: 180px;
    margin-right: 0;
    margin-bottom: 5px;
    border-radius: 8px;
    border: 1px solid #ccc;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    object-fit: cover;
    /* Ensures logo isn't stretched */
    padding: 5px;
    /* Applied user preference for padding */
}

/* --- START OF METALLIC EFFECT CHANGES --- */
.header h1 {
    /* *** 1. FONT STYLE & SIZE */
    font-family: 'Arial Black', Gadget, sans-serif;
    font-size: 2.5rem;
    /* Increased size for impact */
    font-weight: 900;
    line-height: 1.2;
    margin: 0;
    /* Keep margin reset */
    text-align: center;
    /* Ensures text is centered */

    /* *** 2. COLOR GRADIENT (THE METALLIC EFFECT) */
    background: linear-gradient(180deg,
            #E0FFFF 0%,
            /* Bright Highlight (Light Cyan) */
            #6DA0C4 25%,
            /* Medium Blue Tone */
            #29688F 45%,
            /* Deeper Blue Tone */
            #0B354C 55%,
            /* Dark Blue Core (The depth of the metal) */
            #29688F 75%,
            #6DA0C4 95%,
            #E0FFFF 100%);
    /* Bottom Highlight */

    /* These properties apply the gradient to the text itself and MUST be kept */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    /* Standard property */
    color: transparent;
    /* Required for the clipping to work */

    /* *** 3. TEXT SHADOW / GLOW */
    text-shadow:
        0 0 8px rgba(173, 216, 230, 0.6),
        /* Pale Blue Inner Glow */
        0 5px 15px rgba(0, 0, 0, 0.6);
    /* Deeper drop shadow for depth */
    letter-spacing: 2px;
}

/* --- END OF METALLIC EFFECT CHANGES --- */


/* ---------- View Panels ---------- */
.view {
    width: 100%;
    max-width: 380px;
    /* compact panel */
    background-color: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

/* Headings */
.view h1,
.view h2,
.view h3,
.view h4 {
    margin-bottom: 12px;
    color: #444;
}

/* ---------- Inputs & Dropdowns ---------- */
input,
select,
textarea {
    width: 100%;
    padding: 8px;
    font-size: 13px;
    border-radius: 6px;
    border: 1px solid #ccc;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    background-color: #f9f9f9;
    font-family: 'Poppins', Arial, sans-serif;
    /* Ensure inputs use the font */
}

input:focus,
select:focus,
textarea:focus {
    border-color: #4CAF50;
    box-shadow: 0 0 4px rgba(76, 175, 80, 0.3);
    outline: none;
}

/* Placeholder color */
::placeholder {
    color: #999;
    font-style: italic;
}

/* ---------- Buttons ---------- */
button {
    width: 100%;
    padding: 10px;
    margin-top: 6px;
    background: linear-gradient(135deg, #4CAF50, #43A047);
    color: #fff;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-family: 'Poppins', Arial, sans-serif;
    /* Ensure buttons use the font */
}

button:hover {
    background: linear-gradient(135deg, #43A047, #388E3C);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

/* Logout Button */
#logoutBtn {
    width: auto;
    /* Allow sizing to content when next to h2 */
    margin-left: 10px;
    background: linear-gradient(135deg, #E74C3C, #C0392B);
}

#logoutBtn:hover {
    background: linear-gradient(135deg, #C0392B, #A93226);
}

/* ---------- Task & Announcement Cards (Updated to include teacher cards) ---------- */
.task-card,
.announcement-card,
.teacher-task-card,
.teacher-announcement-card,
.teacher-upload-card,
.upload-card {
    background-color: #fff;
    padding: 10px 12px;
    margin: 6px 0;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
    word-wrap: break-word;
    /* Ensure long text wraps */
}

.task-card:hover,
.announcement-card:hover,
.teacher-task-card:hover,
.teacher-announcement-card:hover,
.teacher-upload-card:hover,
.upload-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

/* Delete buttons (Specific override for small delete buttons) */
.delete-btn {
    width: auto !important;
    background-color: #FF6B6B !important;
    color: #fff !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 5px 10px !important;
    font-size: 11px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-shadow: none !important;
    transform: none !important;
    display: inline-block;
    float: right;
    margin-top: 0;
}

.delete-btn:hover {
    background-color: #FF4757 !important;
    transform: none !important;
}


/* ---------- Labels ---------- */
label {
    display: block;
    margin-top: 6px;
    font-weight: 600;
    font-size: 12px;
}

/* Specific styling for the "Login Type" label to make it bigger and bolder */
label[for="loginType"] {
    font-size: 16px;
    font-weight: 800;
}

/* ---------- Done Task ---------- */
.done {
    text-decoration: line-through;
    color: #888;
}

/* ---------------------------------------------------- */
/* NEW STYLES for COMPACT TEACHER LAYOUT (Tabs & Grids) */
/* ---------------------------------------------------- */


/* Modal background */
.modal {
    display: none;
    /* Hidden by default */
    position: fixed;
    z-index: 999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
}

/* Modal content box */
.modal-content {
    background-color: #fefefe;
    margin: 50px auto;
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    max-width: 900px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Close (X) button */
.close-btn {
    float: right;
    font-size: 24px;
    cursor: pointer;
}

/* Grid layout for students */
.debit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    /* 10 per row on wide screens */
    gap: 10px;
    margin-top: 20px;
}

/* Each student box */
.student-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f5f5f5;
    border-radius: 8px;
    padding: 5px 10px;
}

/* Student name */
.student-name {
    font-weight: 500;
    font-size: 14px;
    margin-right: 6px;
}

/* Input box for debit */
.debit-input {
    width: 50px;
    padding: 2px 4px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 5px;
}

/* Buttons */
.open-btn,
.save-btn,
.cancel-btn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}

.cancel-btn {
    background-color: #aaa;
}

.open-btn:hover,
.save-btn:hover {
    background-color: #0056b3;
}

.cancel-btn:hover {
    background-color: #888;
}

.modal-actions {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}


.teacher-tabs {
    display: flex;
    flex-direction: column;
    margin-top: 15px;
}

.tab-buttons {
    display: flex;
    /* Allow tabs to wrap if necessary */
    flex-wrap: wrap;
    margin-bottom: 0;
    border-bottom: 2px solid #ddd;
}

.tab-button {
    padding: 10px 15px;
    cursor: pointer;
    border: 1px solid #ddd;
    border-bottom: none;
    background-color: #f4f4f4;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
    transition: background-color 0.2s;
    margin-right: 5px;
    font-weight: bold;
    /* Ensure the button stays compact */
    flex-grow: 1;
    text-align: center;
    min-width: 100px;
    margin-bottom: -2px;
    /* Pulls the button slightly over the border */
}

.tab-button:hover {
    background-color: #eee;
}

.tab-button.active {
    background-color: #fff;
    border-bottom: 2px solid #fff;
    color: #4CAF50;
    /* Ensure active tab is slightly higher visually */
    z-index: 1;
}

.tab-content-section {
    border: 1px solid #ddd;
    padding: 20px;
    border-top: none;
    min-height: 400px;
    background-color: #fff;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    margin-bottom: 10px;
}

/* Two-Column Layout for Input Forms */
.input-grid {
    display: grid;
    /* Default to 1 column on very small screens, overridden below */
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

/* When screen is wider than the compact view, use 2 columns */
@media (min-width: 380px) {
    .input-grid {
        grid-template-columns: 1fr 1fr;
    }

    /* Ensure inputs in a grid are tight */
    .input-grid input,
    .input-grid select,
    .input-grid button,
    .input-grid textarea {
        margin-bottom: 0;
    }
}


.input-full-width {
    /* Spans across all columns of the grid */
    grid-column: 1 / -1;
}

.list-container {
    display: grid;
    /* Default to 1 column */
    grid-template-columns: 1fr;
    gap: 15px;
    margin-top: 20px;
}

/* On wider screens, show lists side-by-side */
@media (min-width: 380px) {
    .list-container {
        grid-template-columns: 1fr 1fr;
    }
}

/* Attendance Specific Styles for Clean Flow */
#rosterManager,
#dailyAttendanceTaker,
#attendanceExportManager {
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 15px;
}

.attendance-selectors {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.attendance-selectors label {
    white-space: nowrap;
    margin: 0;
    /* Remove label margin */
    /* Only display the label itself, the select/input will handle spacing */
    display: inline;
}

.attendance-selectors select,
.attendance-selectors input[type="date"],
.attendance-selectors button {
    flex-grow: 1;
    min-width: 100px;
    margin-bottom: 0;
    /* Remove input margin for inline flow */
}

/* Roster Management specific styles */
.roster-add-container {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #ddd;
}

.roster-add-container input {
    flex-grow: 1;
    margin-bottom: 0;
}

/* --- ADJUSTED: Roster Compaction --- */
.roster-student-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* Reduced vertical padding from 5px to 3px for compaction */
    padding: 3px 0;
    border-bottom: 1px solid #e0e0e0;
    /* Slightly lighter border for tighter look */
    font-size: 0.95rem;
    /* Slightly smaller text for better fit */
}

/* Attendance Taker form styles */
.attendance-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px dashed #eee;
}

/* Attendance status radio buttons */
.status-group {
    display: flex;
    gap: 5px;
}

.status-group label {
    display: inline-block;
    padding: 5px 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
    cursor: pointer;
    background-color: #fff;
    font-size: 0.8rem;
    font-weight: normal;
}

/* 1. Hide the default radio button dot */
.status-group input[type="radio"] {
    display: none;
}

/* 2. Style the label when its associated radio button IS CHECKED */
/* The plus sign (+) is the Adjacent Sibling Selector */
.status-group input[type="radio"]:checked+label {
    background-color: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

.status-group label.selected {
    font-weight: bold;
    color: white;
}

.status-group label.selected[for*="P"] {
    background-color: #4CAF50;
    /* Green for Present */
    border-color: #4CAF50;
}

.status-group label.selected[for*="A"] {
    background-color: #F44336;
    /* Red for Absent */
    border-color: #F44336;
}

.status-group input[type="radio"] {
    display: none;
}

/* ---------------------------------------------------- */
/* END: NEW STYLES */
/* ---------------------------------------------------- */


/* ---------- Responsive (Adjusted for new layout) ---------- */
@media (max-width: 600px) {
    .header img {
        height: 120px;
        width: 120px;
        margin-right: 0;
        margin-bottom: 5px;
    }

    .header h1 {
        font-size: 1.8rem;
    }

    .view {
        width: 95%;
        padding: 15px;
    }

    input,
    select,
    textarea,
    button {
        font-size: 14px;
        padding: 10px;
    }

    /* Force grids to single column on small screens (e.g., input grid) */
    .input-grid,
    .list-container {
        grid-template-columns: 1fr;
    }

    /* Make tab buttons slightly smaller and stack better */
    .tab-buttons {
        flex-wrap: wrap;
    }

    .tab-button {
        flex-basis: 48%;
        /* Allows two buttons per row */
        margin-bottom: 5px;
    }
}


/* ==========================================================================
    CALENDAR AND MODAL STYLES (Adjusted for sizing)
==========================================================================
*/

/* --- CALENDAR GRID PLANNER --- */
#teacherCalendar,
#studentCalendar {
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 10px;
    background: #ffffff;

    /* --- ADJUSTED: Calendar Scaling (Approx. 20% increase for touch targets) --- */
    transform: scale(1.2);
    transform-origin: top left;
    /* Ensures scaling starts from the top-left corner */
    /* Compensation for the 20% vertical scale to prevent overlap with content below */
    margin-bottom: 25%;
    /* If the calendar height is 400px, this adds 100px (25%) of margin below it */
    /* ------------------------------------------------------------------------- */
}

/* Ensure day numbers and text scale gracefully */
.day-number {
    font-weight: 700;
    font-size: 1.1rem;
    /* Increased font size */
    display: block;
    color: #333;
}

.day-cell {
    /* Taller cells to show info, as requested */
    aspect-ratio: 1 / 1.2;
    display: flex;
    flex-direction: column;
    /* Stack day number and event text */
    align-items: flex-start;
    /* Align text to top-left */
    justify-content: flex-start;
    font-size: 0.85rem;
    /* Slightly larger font for grid text to complement scaling */
    background-color: #f5f5f5;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    border: 1px solid #e0e0e0;
    padding: 6px;
    /* Increased padding inside the cell for better touch */
    word-wrap: break-word;
    /* Wrap text within the cell */
    overflow: hidden;
    /* Hide text that overflows */
}

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

.calendar-header span {
    font-weight: 700;
    font-size: 1.1rem;
    color: #333;
}

/* Style for backward/forward buttons */
.calendar-header button {
    width: auto;
    padding: 4px 10px;
    margin: 0;
    font-size: 14px;
}

.day-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: 700;
    font-size: 0.9rem;
    /* Increased font size */
    color: #555;
    margin-bottom: 5px;
    padding-bottom: 5px;
    border-bottom: 2px solid #f0f0f0;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    /* Small gap between cells */
}

.day-cell:hover {
    background-color: #e0e0e0;
    transform: scale(1.02);
    /* Reduced hover scale to prevent flicker with parent scale */
}

.not-current-month {
    color: #bbb;
    background-color: #fafafa;
    border-color: #fafafa;
    cursor: default;
}

.not-current-month:hover {
    transform: none;
    background-color: #fafafa;
}

.current-day {
    border: 2px solid #4CAF50;
    color: #4CAF50;
    background-color: #f0fff0;
}

/* --- STYLES FOR INFO ON THE GRID --- */
/* (day-number styles moved up for calendar-cell changes) */

.event-text {
    font-weight: 600;
    color: #c0392b;
    /* Reddish color for event text */
    /* Truncate text after 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- END STYLES FOR INFO ON THE GRID --- */


/* --- MODAL STYLES (The interactive popup window) --- */
.modal {
    display: none;
    /* Hidden by default */
    position: fixed;
    /* Stay in place */
    z-index: 1000;
    /* Sit on top */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    /* Enable scroll if needed */
    background-color: rgba(0, 0, 0, 0.5);
    /* Black w/ opacity */
    /* Animate the fade in */
    animation: fadeIn 0.3s;
}

.modal-content {
    /* Designed to fit well in the 380px view */
    width: 90%;
    max-width: 340px;
    margin: 30% auto;
    /* Center on mobile */
    background-color: #fefefe;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    /* Animate the slide down */
    animation: slideIn 0.4s;
}

.modal-header {
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #4CAF50;
}

.close-btn {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close-btn:hover,
.close-btn:focus {
    color: #000;
}

.modal-body {
    padding: 16px;
}

.modal-body textarea {
    min-height: 100px;
    /* Taller text area */
}

.modal-footer {
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    /* Puts delete on left, save on right */
    gap: 10px;
    /* Space between buttons */
    border-top: 1px solid #eee;
}

/* Ensure modal buttons use their specific styles */
.modal-footer button {
    width: auto;
    /* Allow buttons to size to content */
    padding: 8px 16px;
    margin-top: 0;
    /* Override default button margin */
}

/* Keyframe animations for modal */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}
input:focus,
select:focus,
textarea:focus {
    border-color: #4CAF50;
    box-shadow: 0 0 4px rgba(76, 175, 80, 0.3);
    outline: none;
}

/* Placeholder color */
::placeholder {
    color: #999;
    font-style: italic;
}

/* ---------- Buttons ---------- */
button {
    width: 100%;
    padding: 10px;
    margin-top: 6px;
    background: linear-gradient(135deg, #4CAF50, #43A047);
    color: #fff;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-family: 'Poppins', Arial, sans-serif;
    /* Ensure buttons use the font */
}

button:hover {
    background: linear-gradient(135deg, #43A047, #388E3C);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

/* Logout Button */
#logoutBtn {
    width: auto;
    /* Allow sizing to content when next to h2 */
    margin-left: 10px;
    background: linear-gradient(135deg, #E74C3C, #C0392B);
}

#logoutBtn:hover {
    background: linear-gradient(135deg, #C0392B, #A93226);
}

/* ---------- Task & Announcement Cards (Updated to include teacher cards) ---------- */
.task-card,
.announcement-card,
.teacher-task-card,
.teacher-announcement-card,
.teacher-upload-card,
.upload-card {
    background-color: #fff;
    padding: 10px 12px;
    margin: 6px 0;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
    word-wrap: break-word;
    /* Ensure long text wraps */
}

.task-card:hover,
.announcement-card:hover,
.teacher-task-card:hover,
.teacher-announcement-card:hover,
.teacher-upload-card:hover,
.upload-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

/* Delete buttons (Specific override for small delete buttons) */
.delete-btn {
    width: auto !important;
    background-color: #FF6B6B !important;
    color: #fff !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 5px 10px !important;
    font-size: 11px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-shadow: none !important;
    transform: none !important;
    display: inline-block;
    float: right;
    margin-top: 0;
}

.delete-btn:hover {
    background-color: #FF4757 !important;
    transform: none !important;
}


/* ---------- Labels ---------- */
label {
    display: block;
    margin-top: 6px;
    font-weight: 600;
    font-size: 12px;
}

/* Specific styling for the "Login Type" label to make it bigger and bolder */
label[for="loginType"] {
    font-size: 16px;
    font-weight: 800;
}

/* ---------- Done Task ---------- */
.done {
    text-decoration: line-through;
    color: #888;
}

/* ---------------------------------------------------- */
/* NEW STYLES for COMPACT TEACHER LAYOUT (Tabs & Grids) */
/* ---------------------------------------------------- */

.teacher-tabs {
    display: flex;
    flex-direction: column;
    margin-top: 15px;
}

.tab-buttons {
    display: flex;
    /* Allow tabs to wrap if necessary */
    flex-wrap: wrap;
    margin-bottom: 0;
    border-bottom: 2px solid #ddd;
}

.tab-button {
    padding: 10px 15px;
    cursor: pointer;
    border: 1px solid #ddd;
    border-bottom: none;
    background-color: #f4f4f4;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
    transition: background-color 0.2s;
    margin-right: 5px;
    font-weight: bold;
    /* Ensure the button stays compact */
    flex-grow: 1;
    text-align: center;
    min-width: 100px;
    margin-bottom: -2px;
    /* Pulls the button slightly over the border */
}

.tab-button:hover {
    background-color: #eee;
}

.tab-button.active {
    background-color: #fff;
    border-bottom: 2px solid #fff;
    color: #4CAF50;
    /* Ensure active tab is slightly higher visually */
    z-index: 1;
}

.tab-content-section {
    border: 1px solid #ddd;
    padding: 20px;
    border-top: none;
    min-height: 400px;
    background-color: #fff;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    margin-bottom: 10px;
}

/* Two-Column Layout for Input Forms */
.input-grid {
    display: grid;
    /* Default to 1 column on very small screens, overridden below */
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

/* When screen is wider than the compact view, use 2 columns */
@media (min-width: 380px) {
    .input-grid {
        grid-template-columns: 1fr 1fr;
    }

    /* Ensure inputs in a grid are tight */
    .input-grid input,
    .input-grid select,
    .input-grid button,
    .input-grid textarea {
        margin-bottom: 0;
    }
}


.input-full-width {
    /* Spans across all columns of the grid */
    grid-column: 1 / -1;
}

.list-container {
    display: grid;
    /* Default to 1 column */
    grid-template-columns: 1fr;
    gap: 15px;
    margin-top: 20px;
}

/* On wider screens, show lists side-by-side */
@media (min-width: 380px) {
    .list-container {
        grid-template-columns: 1fr 1fr;
    }
}

/* Attendance Specific Styles for Clean Flow */
#rosterManager,
#dailyAttendanceTaker,
#attendanceExportManager {
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 15px;
}

.attendance-selectors {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.attendance-selectors label {
    white-space: nowrap;
    margin: 0;
    /* Remove label margin */
    /* Only display the label itself, the select/input will handle spacing */
    display: inline;
}

.attendance-selectors select,
.attendance-selectors input[type="date"],
.attendance-selectors button {
    flex-grow: 1;
    min-width: 100px;
    margin-bottom: 0;
    /* Remove input margin for inline flow */
}

/* Roster Management specific styles */
.roster-add-container {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #ddd;
}

.roster-add-container input {
    flex-grow: 1;
    margin-bottom: 0;
}

/* --- ADJUSTED: Roster Compaction --- */
.roster-student-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* Reduced vertical padding from 5px to 3px for compaction */
    padding: 3px 0;
    border-bottom: 1px solid #e0e0e0;
    /* Slightly lighter border for tighter look */
    font-size: 0.95rem;
    /* Slightly smaller text for better fit */
}

/* Attendance Taker form styles */
.attendance-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px dashed #eee;
}

/* Attendance status radio buttons */
.status-group {
    display: flex;
    gap: 5px;
}

.status-group label {
    display: inline-block;
    padding: 5px 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
    cursor: pointer;
    background-color: #fff;
    font-size: 0.8rem;
    font-weight: normal;
}
/* 1. Hide the default radio button dot */
.status-group input[type="radio"] {
    display: none;
}

/* 2. Style the label when its associated radio button IS CHECKED */
/* The plus sign (+) is the Adjacent Sibling Selector */
.status-group input[type="radio"]:checked+label {
    background-color: #4CAF50;
    color: white;
    border-color: #4CAF50;
}
.status-group label.selected {
    font-weight: bold;
    color: white;
}

.status-group label.selected[for*="P"] {
    background-color: #4CAF50;
    /* Green for Present */
    border-color: #4CAF50;
}

.status-group label.selected[for*="A"] {
    background-color: #F44336;
    /* Red for Absent */
    border-color: #F44336;
}

.status-group input[type="radio"] {
    display: none;
}

/* ---------------------------------------------------- */
/* END: NEW STYLES */
/* ---------------------------------------------------- */


/* ---------- Responsive (Adjusted for new layout) ---------- */
@media (max-width: 600px) {
    .header img {
        height: 120px;
        width: 120px;
        margin-right: 0;
        margin-bottom: 5px;
    }

    .header h1 {
        font-size: 1.8rem;
    }

    .view {
        width: 95%;
        padding: 15px;
    }

    input,
    select,
    textarea,
    button {
        font-size: 14px;
        padding: 10px;
    }

    /* Force grids to single column on small screens (e.g., input grid) */
    .input-grid,
    .list-container {
        grid-template-columns: 1fr;
    }

    /* Make tab buttons slightly smaller and stack better */
    .tab-buttons {
        flex-wrap: wrap;
    }

    .tab-button {
        flex-basis: 48%;
        /* Allows two buttons per row */
        margin-bottom: 5px;
    }
}


/* ==========================================================================
    CALENDAR AND MODAL STYLES (Adjusted for sizing)
==========================================================================
*/

/* --- CALENDAR GRID PLANNER --- */
#teacherCalendar,
#studentCalendar {
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 10px;
    background: #ffffff;

    /* --- ADJUSTED: Calendar Scaling (Approx. 20% increase for touch targets) --- */
    transform: scale(1.2);
    transform-origin: top left;
    /* Ensures scaling starts from the top-left corner */
    /* Compensation for the 20% vertical scale to prevent overlap with content below */
    margin-bottom: 25%;
    /* If the calendar height is 400px, this adds 100px (25%) of margin below it */
    /* ------------------------------------------------------------------------- */
}

/* Ensure day numbers and text scale gracefully */
.day-number {
    font-weight: 700;
    font-size: 1.1rem;
    /* Increased font size */
    display: block;
    color: #333;
}

.day-cell {
    /* Taller cells to show info, as requested */
    aspect-ratio: 1 / 1.2;
    display: flex;
    flex-direction: column;
    /* Stack day number and event text */
    align-items: flex-start;
    /* Align text to top-left */
    justify-content: flex-start;
    font-size: 0.85rem;
    /* Slightly larger font for grid text to complement scaling */
    background-color: #f5f5f5;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    border: 1px solid #e0e0e0;
    padding: 6px;
    /* Increased padding inside the cell for better touch */
    word-wrap: break-word;
    /* Wrap text within the cell */
    overflow: hidden;
    /* Hide text that overflows */
}

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

.calendar-header span {
    font-weight: 700;
    font-size: 1.1rem;
    color: #333;
}

/* Style for backward/forward buttons */
.calendar-header button {
    width: auto;
    padding: 4px 10px;
    margin: 0;
    font-size: 14px;
}

.day-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: 700;
    font-size: 0.9rem;
    /* Increased font size */
    color: #555;
    margin-bottom: 5px;
    padding-bottom: 5px;
    border-bottom: 2px solid #f0f0f0;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    /* Small gap between cells */
}

.day-cell:hover {
    background-color: #e0e0e0;
    transform: scale(1.02);
    /* Reduced hover scale to prevent flicker with parent scale */
}

.not-current-month {
    color: #bbb;
    background-color: #fafafa;
    border-color: #fafafa;
    cursor: default;
}

.not-current-month:hover {
    transform: none;
    background-color: #fafafa;
}

.current-day {
    border: 2px solid #4CAF50;
    color: #4CAF50;
    background-color: #f0fff0;
}

/* --- STYLES FOR INFO ON THE GRID --- */
/* (day-number styles moved up for calendar-cell changes) */

.event-text {
    font-weight: 600;
    color: #c0392b;
    /* Reddish color for event text */
    /* Truncate text after 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- END STYLES FOR INFO ON THE GRID --- */


/* --- MODAL STYLES (The interactive popup window) --- */
.modal {
    display: none;
    /* Hidden by default */
    position: fixed;
    /* Stay in place */
    z-index: 1000;
    /* Sit on top */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    /* Enable scroll if needed */
    background-color: rgba(0, 0, 0, 0.5);
    /* Black w/ opacity */
    /* Animate the fade in */
    animation: fadeIn 0.3s;
}

.modal-content {
    /* Designed to fit well in the 380px view */
    width: 90%;
    max-width: 340px;
    margin: 30% auto;
    /* Center on mobile */
    background-color: #fefefe;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    /* Animate the slide down */
    animation: slideIn 0.4s;
}

.modal-header {
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #4CAF50;
}

.close-btn {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close-btn:hover,
.close-btn:focus {
    color: #000;
}

.modal-body {
    padding: 16px;
}

.modal-body textarea {
    min-height: 100px;
    /* Taller text area */
}

.modal-footer {
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    /* Puts delete on left, save on right */
    gap: 10px;
    /* Space between buttons */
    border-top: 1px solid #eee;
}

/* Ensure modal buttons use their specific styles */
.modal-footer button {
    width: auto;
    /* Allow buttons to size to content */
    padding: 8px 16px;
    margin-top: 0;
    /* Override default button margin */
}

/* Keyframe animations for modal */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}