/* ==========================================================================
   Global Variables & Base Styles
   ========================================================================== */
:root {
    --dark-brown: #221b16;
    --gold: #ffc119;
    --white: #ffffff;
    --light-gray: #f8f9fa;
    --blue: #3788d8;
    --green: #2c7d59;
    --purple: #7952b3;
    --red: #dc3545;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--dark-brown);
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
}

.wrapper {
    display: flex;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

/* ==========================================================================
   Sidebar, Mobile Header & Offcanvas
   ========================================================================== */
.sidebar {
    background-color: var(--dark-brown);
    height: 100vh;
    width: 260px;
    min-width: 260px;
    padding: 20px 0;
    flex-shrink: 0;
    display: none;
    /* Hide on mobile by default */
    overflow-y: auto;
}

@media (min-width: 992px) {
    .sidebar {
        display: block;
        /* Show on desktop */
    }

    .mobile-header {
        display: none;
        /* Hide mobile header on desktop */
    }
}

.mobile-header {
    background-color: var(--dark-brown);
    padding: 15px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
}

.mobile-logo {
    display: flex;
    align-items: center;
}

.burger-menu {
    color: var(--white);
    font-size: 24px;
    cursor: pointer;
}

/* Offcanvas sidebar styles */
.offcanvas {
    background-color: var(--dark-brown);
    width: 260px !important;
}

.offcanvas-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.offcanvas-title {
    color: var(--white);
}

.btn-close-white {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Adjust main content on mobile to account for fixed header */
@media (max-width: 991.98px) {
    
    /* Allow the body to grow with content and enable scrolling */
    body {
        height: auto;
        overflow-y: auto;
    }

    /* Ensure the wrapper allows vertical scrolling if content exceeds the viewport */
    .wrapper {
        padding-top: 70px;
        /* reserve space for your mobile header */
        overflow-y: auto;
    }

    /* Use min-height for main-content so that it can expand beyond 100vh if needed */
    .main-content {
        min-height: calc(100vh - 70px);
        overflow-y: auto;
    }
}

/* ==========================================================================
   Main Content & Common UI Components
   ========================================================================== */
.main-content {
    background-color: var(--white);
    height: 100vh;
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    /* Only the main content scrolls */
}

@media (min-width: 992px) {
    .main-content {
        border-top-left-radius: 24px;
        border-bottom-left-radius: 24px;
        padding: 30px;
    }
}

.logo-text {
    color: var(--white);
    font-size: 12px;
    font-weight: bold;
    line-height: 1.2;
}

/* Navigation Items */
.nav-item {
    padding: 12px 20px;
    margin: 4px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-item:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.nav-item.active {
    background-color: rgba(0, 0, 0, 0.2);
}

.nav-item i {
    color: var(--gold);
    width: 20px;
}

.nav-item span {
    color: var(--white);
    font-weight: 500;
    margin-left: 12px;
}

.nav-item a {
    text-decoration: none;
    display: flex;
    align-items: center;
    width: 100%;
}

/* Notification & User Avatar */
.notification-bell {
    background-color: var(--gold);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
}

.notification-bell i {
    color: var(--white);
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #dc3545;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid #e9ecef;
    object-fit: cover;
}

.welcome-text {
    font-weight: normal;
    font-size: 1.75rem;
}

.welcome-text strong {
    font-weight: bold;
}

.membership-text {
    color: var(--gold);
}

/* ==========================================================================
   Dropdowns & Notifications
   ========================================================================== */
.user-dropdown {
    cursor: pointer;
}

.dropdown-menu {
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border-radius: 0.5rem;
}

.dropdown-item {
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dropdown-item i {
    color: var(--dark-brown);
    width: 16px;
}

.dropdown-item:hover {
    background-color: var(--light-gray);
}

.dropdown-item.logout:hover {
    background-color: #fee2e2;
}

.dropdown-item.logout:hover i {
    color: #dc2626;
}

.dropdown-divider {
    margin: 0.25rem 0;
}

/* Notification Dropdown */
.notification-container {
    position: relative;
}

.notification-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 320px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
    margin-top: 10px;
}

.notification-container.show .notification-dropdown {
    display: block;
}

@media (min-width: 992px) {
    .notification-container:not(.show):hover .notification-dropdown {
        display: block;
    }
}

.notification-header {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-title {
    font-weight: 600;
    margin: 0;
}

.notification-list {
    max-height: 300px;
    overflow-y: auto;
}

.notification-item {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item.unread {
    background-color: #f0f9ff;
}

.notification-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-icon.event {
    background-color: #e0f2fe;
    color: #0284c7;
}

.notification-icon.certificate {
    background-color: #fef3c7;
    color: #d97706;
}

.notification-icon.course {
    background-color: #dcfce7;
    color: #16a34a;
}

.notification-content {
    flex-grow: 1;
}

.notification-message {
    margin: 0 0 5px 0;
    font-size: 14px;
}

.notification-time {
    color: #6c757d;
    font-size: 12px;
}

.notification-footer {
    padding: 10px 15px;
    text-align: center;
    border-top: 1px solid #e9ecef;
}

.notification-footer a {
    color: var(--gold);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
}

.notification-footer a:hover {
    text-decoration: underline;
}

/* For mobile dropdown styling */
.notification-dropdown-mobile {
    width: 320px;
}

/* ==========================================================================
   Page Titles (Common to many pages)
   ========================================================================== */
.page-title {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.page-title i {
    color: var(--gold);
    margin-right: 0.75rem;
    font-size: 1.5rem;
}

.page-title h1 {
    font-size: 1.75rem;
    margin-bottom: 0;
}

/* ==========================================================================
   Calendar Page Specific Styles
   ========================================================================== */
.calendar-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.calendar-views {
    display: flex;
    gap: 0.5rem;
}

.calendar-view-btn {
    padding: 0.5rem 1rem;
    border-radius: 4px;
    background-color: var(--light-gray);
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.calendar-view-btn.active {
    background-color: var(--gold);
    color: var(--white);
}

.calendar-navigation {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.calendar-nav-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--light-gray);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.calendar-nav-btn:hover {
    background-color: #e9ecef;
}

.calendar-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.calendar-actions {
    display: flex;
    gap: 0.5rem;
}

.calendar-action-btn {
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.calendar-action-btn.primary {
    background-color: var(--gold);
    color: var(--white);
    border: none;
}

.calendar-action-btn.secondary {
    background-color: var(--white);
    color: #6c757d;
    border: 1px solid #e9ecef;
}

.calendar-filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.calendar-filter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    background-color: var(--white);
    border: 1px solid #e9ecef;
    cursor: pointer;
}

.calendar-filter-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.calendar-filter-color.course {
    background-color: var(--green);
}

.calendar-filter-color.public {
    background-color: var(--blue);
}

.calendar-filter-color.academic {
    background-color: var(--purple);
}

.calendar-filter-color.conference {
    background-color: var(--red);
}

.calendar-container {
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
    padding: 1rem;
    height: calc(100vh - 300px);
    min-height: 500px;
}

/* FullCalendar Customizations */
.fc-theme-standard td,
.fc-theme-standard th {
    border-color: #e9ecef;
}

.fc-theme-standard .fc-scrollgrid {
    border-color: #e9ecef;
}

.fc-header-toolbar {
    display: none !important;
}

.fc-daygrid-day-number {
    font-weight: 500;
    color: #6c757d;
}

.fc-day-today {
    background-color: rgba(255, 193, 25, 0.1) !important;
}

.fc-event {
    border: none;
    border-radius: 4px;
    padding: 2px 4px;
    font-size: 0.875rem;
}

.fc-event-title {
    font-weight: 500;
}

.fc-event.course {
    background-color: var(--green);
    color: white;
}

.fc-event.public {
    background-color: var(--blue);
    color: white;
}

.fc-event.academic {
    background-color: var(--purple);
    color: white;
}

.fc-event.conference {
    background-color: var(--red);
    color: white;
}

/* ==========================================================================
   Event Modal & Details
   ========================================================================== */
.event-modal .modal-header {
    border-bottom: none;
    padding-bottom: 0;
}

.event-modal .modal-title {
    font-weight: 600;
}

.event-modal .modal-body {
    padding-top: 0;
}

.event-type {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.event-type.course {
    background-color: rgba(44, 125, 89, 0.1);
    color: var(--green);
}

.event-type.public {
    background-color: rgba(55, 136, 216, 0.1);
    color: var(--blue);
}

.event-type.academic {
    background-color: rgba(121, 82, 179, 0.1);
    color: var(--purple);
}

.event-type.conference {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--red);
}

.event-details {
    margin-bottom: 1rem;
}

.event-detail {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.event-detail i {
    width: 16px;
    color: #6c757d;
}

.event-detail-text {
    flex-grow: 1;
}

.event-description {
    margin-bottom: 1rem;
    color: #6c757d;
}

.event-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* ==========================================================================
   Attendance Page Specific Styles
   ========================================================================== */
.attendance-table {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
}

.attendance-table th {
    background-color: var(--light-gray);
    font-weight: 600;
    padding: 1rem;
}

.attendance-table td {
    padding: 1rem;
    vertical-align: middle;
}

.attendance-status {
    font-weight: 600;
}

.status-marked {
    color: #16a34a;
}

.status-not-marked {
    color: #dc2626;
}

/* ==========================================================================
   Certificates Page Specific Styles
   ========================================================================== */
.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 2rem 0 1rem;
}

.certificate-list {
    background-color: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
}

.certificate-item {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.certificate-item:last-child {
    border-bottom: none;
}

.download-btn {
    color: #16a34a;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.download-btn:hover {
    text-decoration: underline;
}

.pending-status {
    color: #dc2626;
    font-weight: 500;
}

/* ==========================================================================
   Courses Page Specific Styles
   ========================================================================== */
.course-card {
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.course-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.course-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.course-label {
    color: #6c757d;
}

.course-value {
    font-weight: 500;
}

.course-value.active,
.course-value.completed,
.course-value.available {
    color: #16a34a;
}

.course-value.expired,
.course-value.pending,
.course-value.not-eligible {
    color: #dc2626;
}

.course-value.available {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.progress-bar {
    height: 8px;
    border-radius: 4px;
    background-color: #e9ecef;
    margin: 0.5rem 0;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background-color: #16a34a;
}

.progress-value {
    font-size: 0.875rem;
    color: #6c757d;
    text-align: right;
    margin-top: 0.25rem;
}

/* ==========================================================================
   Stat & Event Cards
   ========================================================================== */
.stat-card,
.event-card {
    background-color: var(--light-gray);
    border-radius: 8px;
    padding: 24px;
    height: 100%;
    margin-bottom: 15px;
}

.stat-value {
    color: var(--gold);
    font-size: 2.5rem;
    font-weight: bold;
}

.stat-title {
    color: #6c757d;
}

.event-title {
    color: #6c757d;
}

.event-name {
    color: var(--gold);
    font-size: 1.25rem;
    font-weight: 500;
}

.section-icon {
    color: var(--gold);
    margin-right: 8px;
}

/* ==========================================================================
   Settings Page Specific Styles
   ========================================================================== */
.settings-section {
    margin-bottom: 2rem;
}

.settings-section-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.form-label {
    font-weight: 500;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.form-control {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 0.75rem 1rem;
}

.form-control:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 0.25rem rgba(255, 193, 25, 0.25);
}

.password-input-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
}

.password-hint {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

.notification-toggle {
    display: flex;
    gap: 1rem;
}

.notification-toggle-btn {
    padding: 0.5rem 1.5rem;
    border: 1px solid var(--gold);
    border-radius: 8px;
    background-color: transparent;
    color: #6c757d;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.notification-toggle-btn.active {
    background-color: var(--gold);
    color: var(--white);
}

.save-btn {
    background-color: var(--gold);
    color: var(--white);
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    justify-self: center;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.save-btn:hover {
    background-color: #e6ac00;
}

/* ==========================================================================
   Notifications Page Specific Styles
   ========================================================================== */
.notification-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background-color: var(--light-gray);
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn.active {
    background-color: var(--gold);
    color: var(--white);
}

.notification-section {
    margin-bottom: 2rem;
}

.notification-card {
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 1rem;
    overflow: hidden;
}

.notification-card.unread {
    border-left: 4px solid var(--gold);
}

.notification-card-header {
    padding: 1rem;
    background-color: var(--light-gray);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-card-title {
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.notification-card-time {
    color: #6c757d;
    font-size: 0.875rem;
}

.notification-card-body {
    padding: 1rem;
}

.notification-card-message {
    margin-bottom: 0.5rem;
}

.notification-card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
}

.notification-card-btn {
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.notification-card-btn.primary {
    background-color: var(--gold);
    color: var(--white);
}

.notification-card-btn.secondary {
    background-color: var(--light-gray);
    color: #6c757d;
}

.notification-card-btn:hover {
    opacity: 0.9;
}

.mark-all-read {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gold);
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 1rem;
}

.mark-all-read:hover {
    text-decoration: underline;
}