:root {
    --primary-blue: #4A5CFF;
    --accent-orange: #FCA311;
    --dark-navy: #020335;
    --light-gray-bg: #F9F9F9;
    --white: #FFFFFF;
    --font-family: 'Nunito', sans-serif;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 88px;
    --header-height: 65px;
}

body {
    font-family: var(--font-family);
    background-color: var(--light-gray-bg);
    overflow-x: hidden;
    color: #333;
}

/*  Login Page Styles  */
body.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 40px;
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.login-container .login-logo {
    max-height: 75px;
    margin-bottom: 1.5rem;
}

.login-container .login-title {
    font-weight: 700;
    color: var(--dark-navy);
    margin-bottom: 25px;
    font-size: 1.5rem;
}

.form-control {
    border-radius: 8px;
    padding: 12px 20px;
    border: 1px solid #ddd;
    background-color: #f9f9f9;
}

.form-control:focus {
    border-color: var(--primary-blue);
    background-color: var(--white);
    box-shadow: 0 0 0 0.25rem rgba(74, 92, 255, 0.2);
}

.btn-login {
    background-color: var(--accent-orange);
    border-color: var(--accent-orange);
    color: var(--white);
    font-weight: 700;
    padding: 12px;
    border-radius: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-login:hover {
    background-color: #fca311;
    border-color: #fca311;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(252, 163, 17, 0.3);
}

.forgot-password a {
    color: var(--primary-blue);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}

.forgot-password a:hover {
    text-decoration: underline;
}

.success-icon {
    font-size: 6rem;
    color: var(--primary-blue);
}

/*  Main Portal Layout */
.wrapper {
    position: relative;
}

/* --- Sidebar --- */
#sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background-color: var(--white);
    border-right: 1px solid #eef2f5;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.05);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 101;
    transition: all 0.3s ease-in-out;
}

.sidebar-header {
    padding: 1.25rem;
    text-align: center;
    border-bottom: 1px solid #eee;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    /* Needed for positioning the close button */
}

/* --- NEW: Sidebar Close Button --- */
.close-sidebar-btn {
    display: none;
    /* Hidden on desktop */
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    font-size: 2.5rem;
    font-weight: 300;
    color: #6c757d;
    cursor: pointer;
    line-height: 1;
    padding: 0 5px;
    transition: color 0.2s ease;
}

.close-sidebar-btn:hover {
    color: var(--primary-blue);
}

/* --- NEW: Sidebar Overlay --- */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

body.sidebar-collapsed .sidebar-overlay {
    opacity: 1;
    visibility: visible;
}

.logo-small {
    display: none;
}

.logo-full img {
    max-height: 40px;
}

.logo-small img {
    max-height: 40px;
}

/* --- Content Container --- */
#content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    transition: all 0.3s ease-in-out;
}

body.sidebar-collapsed #content {
    margin-left: var(--sidebar-collapsed-width);
    width: calc(100% - var(--sidebar-collapsed-width));
}

/* --- Header (inside #content) --- */
.header {
    background-color: var(--white);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 99;
}

.header .sidebar-toggle {
    font-size: 1.5rem;
    cursor: pointer;
    color: #333;
}

.header-actions {
    display: flex;
    align-items: center;
}

.notification-icon {
    font-size: 1.5rem;
    margin-right: 25px;
    position: relative;
    cursor: pointer;
    color: #555;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -10px;
    height: 20px;
    min-width: 20px;
    padding: 0 6px;
    background-color: var(--primary-blue);
    color: white;
    border-radius: 10px;
    font-size: 0.75rem;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
}

.profile-dropdown .dropdown-toggle::after {
    display: none;
}

.profile-dropdown .profile-icon {
    font-size: 1.5rem;
    color: #555;
    vertical-align: middle;
}

.profile-dropdown .dropdown-toggle {
    display: flex;
    align-items: center;
    text-decoration: none;
    background-color: var(--light-gray-bg);
    border: 1px solid #eef2f5;
    border-radius: 50px;
    padding: 5px;
    transition: background-color 0.2s ease;
}

.profile-dropdown .dropdown-toggle:hover {
    background-color: #e9ecef;
}

.profile-dropdown .dropdown-toggle::after {
    display: none;
}

.user-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-blue);
    color: var(--white);
    font-size: 1.5rem;
    object-fit: cover;
}

.user-info-text {
    text-align: left;
    margin: 0 15px 0 10px;
}

.user-info-text .user-name {
    font-weight: 700;
    color: var(--dark-navy);
    line-height: 1.2;
    margin: 0;
}

.user-info-text .user-role {
    font-size: 0.8rem;
    color: #6c757d;
    line-height: 1.2;
    margin: 0;
}

/* --- Collapsed Sidebar Styles --- */
/* We only apply these styles on screens larger than 768px */
@media (min-width: 769px) {

    /* CORRECTED SELECTORS BELOW */
    body.sidebar-collapsed #sidebar {
        width: var(--sidebar-collapsed-width);
    }

    body.sidebar-collapsed #sidebar .logo-full {
        display: none;
    }

    body.sidebar-collapsed #sidebar .logo-small {
        display: block;
    }

    body.sidebar-collapsed #sidebar .sidebar-nav-item span {
        display: none;
    }

    body.sidebar-collapsed #sidebar .sidebar-nav-item {
        justify-content: center;
        padding: 15px 10px;
    }

    body.sidebar-collapsed #sidebar .sidebar-nav-item i {
        margin-right: 0;
    }

    /* Hide the mobile overlay on desktop */
    .sidebar-overlay {
        display: none;
    }

    .close-sidebar-btn {
        display: none;
    }

    body.sidebar-collapsed #sidebar .sidebar-footer {
        padding: 10px;
    }

    body.sidebar-collapsed #sidebar .version-text {
        display: none;
    }
}

/* --- Sidebar Nav Items (common styles) --- */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--header-height));
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    color: #555;
    text-decoration: none;
    transition: all 0.2s;
    font-weight: 600;
    white-space: nowrap;
}

.sidebar-nav-item i {
    font-size: 1.2rem;
    margin-right: 15px;
    width: 20px;
    transition: all 0.2s;
}

.sidebar-nav-item:hover {
    background-color: rgba(74, 92, 255, 0.05);
    color: var(--primary-blue);
}

.sidebar-nav-item:hover i {
    transform: scale(1.1);
}

.sidebar-nav-item.active {
    background-color: var(--primary-blue);
    color: var(--white);
    border-right: 5px solid var(--accent-orange);
}

.sidebar-nav-item.active i {
    color: var(--white);
}

.sidebar-footer {
    margin-top: auto;
    padding: 20px 24px;
    text-align: center;
}

.version-text {
    display: block;
    font-size: 0.8rem;
    color: #8c8c8c;
    margin-bottom: 15px;
}

.logout-link {
    background-color: #ffe8e8 !important;
    color: #d9534f !important;
    border-radius: 8px;
    justify-content: center;
}

/* --- Main Content Area --- */
.main-content {
    padding: 1.5rem;
}

.content-container {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* --- Profile Page Styles --- */
.profile-grid-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 992px) {
    .profile-grid-layout {
        grid-template-columns: 3fr 7fr;
    }
}

.profile-identity-card {
    background: var(--primary-blue);
    color: var(--white);
    padding: 2.5rem 1.5rem;
    border-radius: 16px;
    text-align: center;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(74, 92, 255, 0.3);
}

.identity-picture {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 6px solid rgba(255, 255, 255, 0.8);
    margin: 0 auto 1rem auto;
    object-fit: cover;
}

.identity-name {
    font-weight: 900;
    font-size: 1.8rem;
    margin-bottom: 0.25rem;
}

.identity-class {
    font-weight: 600;
    opacity: 0.8;
    font-size: 1.1rem;
}

.identity-rollno {
    display: inline-block;
    background-color: rgba(255, 255, 255, 0.15);
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 700;
    margin-top: 1rem;
}

.profile-details-card {
    background-color: var(--white);
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
    border: 1px solid #eef2f5;
    overflow: hidden;
    height: 100%;
}

.nav-tabs-profile {
    border-bottom: 2px solid #eef2f5;
    padding: 0 1rem;
}

.nav-tabs-profile .nav-link {
    border: none;
    color: #6c757d;
    font-weight: 700;
    padding: 1rem 1.25rem;
    position: relative;
}

.nav-tabs-profile .nav-link.active {
    color: var(--primary-blue);
    background-color: transparent;
}

.nav-tabs-profile .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--primary-blue);
}

.profile-details-card .tab-content {
    padding: 2rem;
}

.detail-item {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.detail-item-icon {
    font-size: 1.5rem;
    color: var(--primary-blue);
    margin-right: 15px;
    min-width: 30px;
    text-align: center;
}

.detail-label {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 600;
    margin: 0;
}

.detail-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark-navy);
    margin: 0;
}

.parent-info-card {
    background-color: var(--light-gray-bg);
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem;
}

.parent-info-card h5 {
    font-weight: 700;
    color: var(--dark-navy);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
}

.parent-info-card h5 i {
    color: var(--primary-blue);
    margin-right: 10px;
}

.dashboard-stat-card {
    background-color: var(--white);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
}

.dashboard-stat-card h5 {
    font-weight: 700;
    color: #6c757d;
    margin-top: 1rem;
    font-size: 1rem;
}

@property --p {
    syntax: '<integer>';
    inherits: false;
    initial-value: 0;
}

.profile-identity-card .radial-progress {
    margin: 1.5rem auto;
    --c: var(--white);
    --bg: rgba(255, 255, 255, 0.25);
    color: var(--white);
}

.radial-progress {
    --p: 92;
    --b: 12px;
    --c: var(--primary-blue);
    --bg: #eef2f5;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: grid;
    place-content: center;
    font-size: 2rem;
    font-weight: 900;
    color: var(--dark-navy);
    animation: p 1s 0.5s both;
    position: relative;
}

.radial-progress::before,
.radial-progress::after {
    content: "";
    position: absolute;
    border-radius: 50%;
}

.radial-progress::before {
    inset: 0;
    background: radial-gradient(farthest-side, var(--c) 98%, #0000) top/var(--b) var(--b) no-repeat, conic-gradient(var(--c) calc(var(--p) * 1%), var(--bg) 0);
    -webkit-mask: radial-gradient(farthest-side, #0000 calc(99% - var(--b)), #000 calc(100% - var(--b)));
    mask: radial-gradient(farthest-side, #0000 calc(99% - var(--b)), #000 calc(100% - var(--b)));
}

@keyframes p {
    from {
        --p: 0
    }
}

.simple-stat {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: grid;
    place-content: center;
    background-color: var(--light-gray-bg);
}

.simple-stat i {
    font-size: 2.5rem;
    color: var(--accent-orange);
    position: relative;
    top: -10px;
}

.simple-stat .stat-number {
    font-size: 2rem;
    font-weight: 900;
    color: var(--dark-navy);
    line-height: 1;
    position: relative;
    top: -15px;
}

/*  Document Link Styles*/
.document-link {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    background-color: var(--light-gray-bg);
    border: 1px solid #eef2f5;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.document-link:hover {
    background-color: #e9ecef;
    border-color: #dee2e6;
}

.document-link i {
    font-size: 2rem;
    color: var(--primary-blue);
    margin-right: 15px;
}

.document-link .link-text {
    font-weight: 700;
    color: var(--dark-navy);
}

.document-link .link-subtext {
    font-size: 0.85rem;
    color: #6c757d;
}

/* --- Attendance Styles --- */
.attendance-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
}

.calendar-day-header {
    text-align: center;
    font-weight: 600;
    color: #6c757d;
    padding: 0.5rem;
    font-size: 0.9rem;
}

.calendar-day {
    border: 1px solid #eef2f5;
    border-radius: 8px;
    min-height: 90px;
    padding: 0.5rem;
    transition: all 0.2s ease;
    background-color: #fff;
}

.calendar-day.empty {
    background-color: transparent;
    border: none;
}

.day-number {
    font-weight: 700;
    color: #343a40;
}

.day-status {
    display: block;
    text-align: center;
    margin-top: 0.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    text-transform: capitalize;
}

/* Status Colors */
.day-status.present {
    background-color: #28a745;
}

.day-status.absent {
    background-color: #dc3545;
}

.day-status.late {
    background-color: #ffc107;
    color: #212529;
}

.day-status.half-day {
    background-color: #17a2b8;
}

.day-status.not-marked {
    background-color: #f8f9fa;
    color: #6c757d;
    border: 1px dashed #ced4da;
}

/* Summary Card Styles */
.attendance-summary .card {
    text-align: center;
}

.attendance-summary .card h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.attendance-summary .card p {
    margin-bottom: 0;
    color: #6c757d;
}

.summary-present h3 {
    color: #28a745;
}

.summary-absent h3 {
    color: #dc3545;
}

.summary-late h3 {
    color: #ffc107;
}

.summary-half_day h3 {
    color: #17a2b8;
}

/* --- RESPONSIVE STYLES for mobile devices --- */
@media (max-width: 767.98px) {
    .attendance-calendar {
        gap: 5px;
    }

    .calendar-day {
        min-height: 60px;
        padding: 5px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .day-number {
        font-size: 0.9rem;
    }

    /* Transform the status text into a small dot on mobile */
    .day-status {
        font-size: 0;
        padding: 0;
        width: 8px;
        height: 8px;
        min-width: 8px;
        margin-top: 4px;
    }

    .day-status.not-marked {
        border: none;
        background-color: #e9ecef;
    }
}

/* --- Announcements Section --- */
.page-header {
    margin-bottom: 1.5rem;
}

.page-header h2 {
    font-weight: 700;
    color: var(--dark-navy);
}

.announcement-card {
    background-color: var(--white);
    border-radius: 12px;
    border: 1px solid #eef2f5;
    padding: 25px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.announcement-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(74, 92, 255, 0.08);
}

.announcement-icon {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.8rem;
    flex-shrink: 0;
    margin-right: 20px;
}

.announcement-icon.general {
    background-color: var(--primary-blue);
}

.announcement-icon.event {
    background-color: var(--accent-orange);
}

.announcement-icon.reminder {
    background-color: #dc3545;
}

.announcement-icon.holiday {
    background-color: #198754;
}

.announcement-content h5 {
    font-weight: 700;
    color: var(--dark-navy);
    margin-bottom: 0.25rem;
}

.announcement-content p {
    color: #555;
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.announcement-meta {
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 600;
}

.announcement-meta i {
    margin-right: 5px;
}

/* --- Homework Section --- */
.homework-header-controls .nav-link {
    color: var(--text-500);
    font-weight: 600;
    border-radius: 10px;
    margin: 0 4px;
    padding: 8px 14px;
    transition: all .15s ease-in-out;
}

.homework-header-controls .nav-link:hover {
    background: rgba(74, 92, 255, .08);
    color: var(--primary-blue);
}

.homework-header-controls .nav-link.active {
    background-color: var(--primary-blue);
    color: var(--white);
    box-shadow: 0 6px 18px rgba(74, 92, 255, 0.25);
}

.homework-date-nav .btn-nav {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.homework-datepicker-group .form-control {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.homework-table thead th {
    font-size: .9rem;
    color: var(--text-500);
    border-bottom: 1px solid var(--border-200) !important;
}

.homework-table tbody tr.row-hover {
    transition: background-color .15s ease-in-out;
}

.homework-table tbody tr.row-hover:hover {
    background-color: var(--bg-50);
}

.subject-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    color: #fff;
    font-size: 1.1rem;
    box-shadow: 0 2px 8px rgba(20, 20, 20, 0.08);
}

.details-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.back-button {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    color: #495057;
    text-decoration: none;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.back-button:hover {
    background-color: #f8f9fa;
    border-color: #ced4da;
    color: #000;
}

.details-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0;
    line-height: 1.2;
}

/* Use 'subtitle' class for any subtitle text */
.details-header .subtitle {
    font-size: 1rem;
    font-weight: 600;
    color: #6c757d;
}

/* Use this class for both homework and syllabus main content cards */
.details-card {
    border: 1px solid #eef2f5;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    background-color: #fff;
    border-radius: 12px;
}

.detail-section {
    padding: 1.5rem;
    border-bottom: 1px solid #eef2f5;
}

.detail-section:last-child {
    border-bottom: none;
}

.detail-section h5 {
    font-size: 1rem;
    font-weight: 700;
    color: #343a40;
    margin-bottom: 0.75rem;
}

.detail-section p {
    color: #495057;
    margin-bottom: 0;
    line-height: 1.7;
}

/* --- Attachment List Styles (these are already generic and can be reused) --- */
.attachment-list-clean {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}

.attachment-list-clean li {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

/* Attachment List Styles */
.attachment-list-clean {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}

.attachment-list-clean li {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.attachment-list-clean li:last-child {
    margin-bottom: 0;
}

.attachment-link-clean {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    text-decoration: none;
    color: inherit;
}

.attachment-link-clean:hover .attachment-filename {
    text-decoration: underline;
}

/* Preview image for image files */
.attachment-preview-sm {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    margin-right: 1rem;
    border: 1px solid #eef2f5;
    flex-shrink: 0;
}

.attachment-preview-sm.error {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #721c24;
    font-size: 0.75rem;
    text-align: center;
}

/* Icon for document files */
.attachment-icon-sm {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #0d6efd;
    background-color: #e7f1ff;
    border-radius: 6px;
    margin-right: 1rem;
    flex-shrink: 0;
}

.attachment-filename {
    font-weight: 600;
    color: #0d6efd;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    max-width: 100%;
}

.attachment-filetype {
    font-size: 0.85rem;
    color: #6c757d;
    display: block;
}

.attachment-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.file-actions {
    margin-left: auto;
    display: flex;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 4px;
    text-decoration: none;
}

.btn-outline-primary {
    color: #0d6efd;
    border: 1px solid #0d6efd;
    background: transparent;
    transition: all 0.2s ease;
}

.btn-outline-primary:hover {
    color: white;
    background-color: #0d6efd;
    text-decoration: none;
}

.btn-outline-secondary {
    color: #6c757d;
    border: 1px solid #6c757d;
    background: transparent;
    transition: all 0.2s ease;
}

.btn-outline-secondary:hover {
    color: white;
    background-color: #6c757d;
    text-decoration: none;
}

/* Subject backgrounds */
.math-bg {
    background-color: #4c7cff;
}

.science-bg {
    background-color: #2eb872;
}

.english-bg {
    background-color: #ef476f;
}

.art-bg {
    background-color: #f6b100;
}

.history-bg {
    background-color: #7b5de6;
}

.default-bg {
    background-color: #6c757d;
}

.assignment-title {
    color: var(--text-600);
}

.due-badge {
    background: #eef2ff;
    color: #3542ff;
    border: 1px solid #dde3ff;
    font-weight: 600;
    padding: .35rem .6rem;
}

.btn-primary-soft {
    background: rgba(74, 92, 255, 0.1);
    color: var(--primary-blue);
    border: 1px solid rgba(74, 92, 255, 0.25);
    transition: all .15s ease-in-out;
}

.btn-primary-soft:hover,
.btn-primary-soft:focus {
    background: rgba(74, 92, 255, 0.18);
    color: var(--primary-blue);
    border-color: rgba(74, 92, 255, 0.4);
    box-shadow: 0 6px 18px rgba(74, 92, 255, 0.25);
}

/* Better card rounding and overflow handling */
.card.rounded-4 {
    border-radius: 1rem !important;
}

/* Responsiveness tweaks */
@media (max-width: 576px) {
    .homework-header-controls {
        gap: .75rem;
    }

    .homework-date-nav .nav-title {
        font-size: 1rem;
    }

    .subject-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
}

/* Announcement Styles */
.announcement-card.high-priority {
    border-left: 5px solid var(--accent-orange);
    background-color: #fffaf0;
}

.announcement-icon {
    position: relative;
}

.flash-icon {
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 1rem !important;
    color: var(--accent-orange) !important;
    background: white;
    border-radius: 50%;
    padding: 2px;
}

/* --- Construction Page --- */
.construction-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 1rem;
    background-color: var(--white);
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
}

.construction-icon {
    font-size: 6rem;
    color: var(--primary-blue);
}

.construction-container h3 {
    font-weight: 700;
    color: var(--dark-navy);
    margin-top: 1.5rem;
}

.construction-container p {
    color: #6c757d;
    max-width: 450px;
    margin-top: 0.5rem;
}

/* --- Notifications Sidebar --- */
#notification-sidebar {
    position: fixed;
    top: 0;
    right: -350px;
    width: 350px;
    height: 100%;
    background: #fff;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
    transition: right 0.3s;
    z-index: 1050;
}

#notification-sidebar.open {
    right: 0;
}

.notification-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-header h5 {
    margin-bottom: 0;
}

.notification-list {
    max-height: calc(100vh - 70px);
    overflow-y: auto;
    padding: 0;
    list-style: none;
}

.notification-item {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.notification-item:hover {
    background-color: var(--light-gray-bg);
}

.notification-item .time {
    font-size: 0.8rem;
    color: #999;
}

.notification-item.is-read {
    opacity: 0.6;
    background-color: #f8f9fa;
}

.notification-item.is-read:hover {
    opacity: 1;
}

.mark-read-btn {
    font-size: 0.8rem;
    color: var(--primary-blue);
    text-decoration: none;
    cursor: pointer;
    font-weight: 500;
}

.mark-read-btn:hover {
    text-decoration: underline;
}

.notification-item-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.notification-item-link:hover .notification-item {
    background-color: var(--light-gray-bg);
}

.load-more-btn {
    display: block;
    width: 100%;
    padding: 15px;
    border: none;
    background-color: #f8f9fa;
    color: var(--primary-blue);
    cursor: pointer;
    text-align: center;
    font-weight: 600;
    transition: background-color 0.2s;
}

.load-more-btn:hover {
    background-color: #e9ecef;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1040;
    display: none;
}

.overlay.active {
    display: block;
}

/* --- Timetable Styles --- */
.timetable-wrapper {
    background-color: #fff;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    overflow-x: auto;
    margin: 1rem 0;
}

.timetable-container {
    min-width: 900px;
}

.timetable-header {
    display: grid;
    grid-template-columns: 120px repeat(6, 1fr);
    gap: 8px;
    margin-bottom: 1rem;
}

.time-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    border-radius: 12px;
    font-weight: 700;
    text-align: center;
    font-size: 0.9rem;
}

.day-header {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 1rem;
    border-radius: 12px;
    font-weight: 700;
    text-align: center;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.timetable-row {
    display: grid;
    grid-template-columns: 120px repeat(6, 1fr);
    gap: 8px;
    margin-bottom: 8px;
}

.time-slot {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
    line-height: 1.3;
    min-height: 100px;
}

.subject-slot {
    padding: 1rem;
    border-radius: 12px;
    color: white;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.subject-slot:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: inherit;
    opacity: 0.9;
    z-index: 1;
}

.subject-content {
    position: relative;
    z-index: 2;
}

.subject-name {
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.4;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.subject-separator {
    margin: 0.3rem 0;
    font-weight: 600;
    opacity: 0.8;
}

.empty-slot {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #6c757d;
    border: 2px dashed #dee2e6;
    font-style: italic;
    opacity: 0.7;
}

.timetable-legend {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 12px;
    font-size: 0.85rem;
    color: #6c757d;
}

.subject-slot {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.subject-slot:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

@media (max-width: 768px) {
    .timetable-wrapper {
        padding: 1rem;
        margin: 0.5rem;
    }

    .timetable-container {
        min-width: 700px;
    }

    .day-header,
    .subject-name {
        font-size: 0.85rem;
    }

    .time-slot,
    .subject-slot {
        min-height: 80px;
        padding: 0.75rem;
    }
}

/* --- No Data Container --- */
.no-data-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 70vh;
    color: #6c757d;
}

.no-data-container .bi {
    font-size: 5rem;
    color: #ced4da;
}

.no-data-container h3 {
    color: #343a40;
    margin-top: 1rem;
}

.no-data-container p {
    font-size: 1.25rem;
}

/* === RESPONSIVE STYLES === */
@media (max-width: 768px) {
    .user-info-text {
        display: none;
    }

    .profile-dropdown .dropdown-toggle {
        padding: 5px;
    }

    /* By default on mobile, hide the sidebar off-screen */
    #sidebar {
        left: calc(-1 * var(--sidebar-width));
    }

    /* When toggled, slide it into view. The JS adds '.sidebar-collapsed' to the body */
    body.sidebar-collapsed #sidebar {
        left: 0;
    }

    /* The main content takes up the full screen width */
    #content {
        width: 100%;
        margin-left: 0;
    }

    /* Don't change content margin when sidebar is open */
    body.sidebar-collapsed #content {
        margin-left: 0;
    }

    /* Show the close button on mobile */
    .close-sidebar-btn {
        display: block;
    }
}

@media (max-width: 576px) {
    .main-content {
        padding: 1rem;
    }

    .header {
        padding: 0 1rem;
    }

    .attachment-link-clean {
        flex-direction: column;
        align-items: flex-start;
    }

    .file-actions {
        margin-left: 0;
        width: 100%;
        justify-content: flex-start;
        margin-top: 8px;
    }

    .attachment-filename {
        white-space: normal;
        word-break: break-word;
    }
}