/* --- FullCalendar Container Styling --- */
#calendar {
    min-height: 600px; /* Give the calendar container a minimum height */
    /* You might adjust this value based on preference */
}


@media (prefers-color-scheme: dark) {
    /* Schedule Table Specific Dark Mode Styles */

    /* Base table styling */
    .table {
        color: #e0e0e0 !important; /* Light text color for readability */
        border-color: #444 !important; /* Darker border color */
        background-color: #2c2c2c !important; /* Dark background for the table */
    }

    /* Striped table rows */
    .table-striped > tbody > tr:nth-of-type(odd) > * {
        --bs-table-accent-bg: rgba(255, 255, 255, 0.03) !important; /* Subtle striping */
        color: #e0e0e0 !important;
    }

    /* Hover effect on table rows */
    .table-hover > tbody > tr:hover > * {
      --bs-table-accent-bg: rgba(255, 255, 255, 0.06) !important; /* Slightly lighter hover */
      color: #f5f5f5 !important;
    }

     /* Style for completed schedules */
     .table tbody tr.schedule-completed > * {
        background-color: #1a3a2a !important; /* Darker green background for completed items */
        color: #a7d7c5 !important; /* Lighter green text */
        border-color: #2a6a4a !important;
    }

    /* Ensure borders are visible */
    .table-bordered > :not(caption) > * > * {
        border-color: #444 !important;
    }

    /* General row styling */
     .table tbody tr {
        background-color: transparent !important; /* Rows transparent over table background */
        color: #e0e0e0 !important; /* Ensure text color */
        border-color: #444 !important; /* Ensure row borders */
     }

     /* Priority borders */
     .table tbody tr.schedule-priority-high {
        border-left: 5px solid #a02a37 !important; /* Darker red */
     }
      .table tbody tr.schedule-priority-medium {
        border-left: 5px solid #c39e00 !important; /* Darker yellow */
     }
      .table tbody tr.schedule-priority-low {
        border-left: 5px solid #146c43 !important; /* Darker green */
     }

    /* Table header styling */
    .table thead, .table th {
        color: #f0f0f0 !important; /* Lighter header text */
        border-color: #444 !important;
        background-color: #3a3a3a !important; /* Slightly different header background */
    }

    /* Table cell styling */
     .table tbody td {
        border-color: #444 !important;
        background-color: transparent !important; /* Cells transparent over row */
        color: #e0e0e0 !important; /* Ensure cell text color */
    }

    /* Link styling */
     .table tbody a {
        color: #6cafff !important; /* Brighter blue for links */
    }
     .table tbody a:hover {
        color: #9bcaff !important; /* Lighter blue on hover */
    }

    /* Badge styling */
     .table .badge.bg-secondary { background-color: #5a6268 !important; color: #fff !important; }
     .table .badge.bg-primary { background-color: #0b5ed7 !important; color: #fff !important; }
     .table .badge.bg-success { background-color: #146c43 !important; color: #fff !important; }
     .table .badge.bg-danger { background-color: #b02a37 !important; color: #fff !important; }
     .table .badge.bg-warning { background-color: #d39e00 !important; color: #000 !important; }
     .table .badge.bg-info { background-color: #0aa3c2 !important; color: #000 !important; }
     .table .badge.bg-light { background-color: #6c757d !important; color: #fff !important; } /* Adjust light badge for dark mode */
     .table .badge.bg-dark { background-color: #adb5bd !important; color: #000 !important; } /* Adjust dark badge for dark mode */

    /* Button styling */
     .table .btn-outline-primary { border-color: #0d6efd; color: #6cafff; }
     .table .btn-outline-primary:hover { background-color: #0d6efd; color: #fff; }
     .table .btn-outline-secondary { border-color: #6c757d; color: #adb5bd; }
     .table .btn-outline-secondary:hover { background-color: #6c757d; color: #fff; }
     .table .btn-outline-success { border-color: #198754; color: #75b798; }
     .table .btn-outline-success:hover { background-color: #198754; color: #fff; }
     .table .btn-outline-danger { border-color: #dc3545; color: #e06c75; }
     .table .btn-outline-danger:hover { background-color: #dc3545; color: #fff; }
     /* Ensure solid buttons (like toggle) are styled */
     .table .btn-success { background-color: #146c43 !important; border-color: #146c43 !important; color: #fff !important; }
     .table .btn-success:hover { background-color: #105634 !important; border-color: #105634 !important; }

    /* --- FullCalendar Event Styling (Dark Mode) --- */

    /* Default event styling */
    .fc-event {
        border: 1px solid #555 !important; /* Slightly lighter border than table */
        background-color: #3a3a3a !important; /* Match header background */
        color: #e0e0e0 !important; /* Light text */
    }

    /* Event title */
    .fc-event-title {
        font-weight: bold;
    }

    /* Completed events */
    .fc-event.fc-event-completed {
        background-color: #1a3a2a !important; /* Dark green background */
        border-color: #2a6a4a !important;
        color: #a7d7c5 !important; /* Lighter green text */
        opacity: 0.8; /* Slightly faded */
    }
    .fc-event.fc-event-completed .fc-event-title {
         text-decoration: line-through;
    }


    /* Priority styling */
    .fc-event.fc-event-priority-high {
        background-color: #5c1e26 !important; /* Darker red background */
        border-color: #a02a37 !important; /* Match table border */
        color: #f5c6cb !important; /* Lighter red text */
    }

    .fc-event.fc-event-priority-medium {
        background-color: #664d00 !important; /* Darker yellow background */
        border-color: #c39e00 !important; /* Match table border */
        color: #ffeeba !important; /* Lighter yellow text */
    }

    .fc-event.fc-event-priority-low {
        background-color: #0a3622 !important; /* Darker green background */
        border-color: #146c43 !important; /* Match table border */
        color: #a3cfbb !important; /* Lighter green text */
    }

    /* Ensure completed priority events blend styles */
     .fc-event.fc-event-completed.fc-event-priority-high,
     .fc-event.fc-event-completed.fc-event-priority-medium,
     .fc-event.fc-event-completed.fc-event-priority-low {
        opacity: 0.7; /* Make completed priority events slightly more faded */
     }
     /* Keep the priority background/border color but add line-through */
     .fc-event.fc-event-completed.fc-event-priority-high { background-color: #5c1e26 !important; border-color: #a02a37 !important; color: #f5c6cb !important; }
     .fc-event.fc-event-completed.fc-event-priority-medium { background-color: #664d00 !important; border-color: #c39e00 !important; color: #ffeeba !important; }
     .fc-event.fc-event-completed.fc-event-priority-low { background-color: #0a3622 !important; border-color: #146c43 !important; color: #a3cfbb !important; }


    /* Adjust link color within events */
    .fc-event a {
        color: inherit !important; /* Inherit text color from event */
        text-decoration: none;
    }
     .fc-event a:hover {
        text-decoration: underline;
     }

    /* Calendar view button styling */
    #calendar-view-options .btn.active {
        background-color: #0d6efd; /* Example primary color */
        color: white;
    }
    #calendar-container .btn-group .btn.active {
        background-color: #0d6efd;
        color: white;
    }
    #calendar-container .btn-group .btn:not(.active) {
        border-color: #6c757d;
        color: #adb5bd;
    }
     #calendar-container .btn-group .btn:not(.active):hover {
        background-color: #495057;
        color: white;
     }

}
