/* Lesrooster API Plugin Styles */

/* CSS Custom Properties voor herbruikbaarheid */
:root {
    --lesrooster-gap: 20px;
    --lesrooster-padding: 20px;
    --lesrooster-border-radius: 8px;
    --lesrooster-primary-color: #007cba;
    --lesrooster-secondary-color: #28a745;
    --lesrooster-danger-color: #dc3545;
    --lesrooster-text-color: #495057;
    --lesrooster-bg-light: #f8f9fa;
    --lesrooster-border-color: #e9ecef;
    --lesrooster-refresh-timeout: 2000ms;
    --lesrooster-min-touch-height: 48px;
    
    /* Additional custom properties for filter styling */
    --primary-color: var(--lesrooster-primary-color);
    --border-radius: var(--lesrooster-border-radius);
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --border-color: var(--lesrooster-border-color);
    --hover-color: #f0f8ff;
    --text-color: #333;
    --text-muted: #999;
}

.lesrooster-container {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Filters */
.lesrooster-filters {
    margin-bottom: 16px;
}

.lesrooster-accordion {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #f8f9fa;
}

.lesrooster-accordion[open] {
    background: #ffffff;
}

.lesrooster-accordion-summary {
    list-style: none;
    cursor: pointer;
    padding: 12px 16px;
    font-weight: 600;
    color: #2c3e50;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.lesrooster-accordion-summary::-webkit-details-marker {
    display: none;
}

.lesrooster-accordion-summary::after {
    content: '▾';
    float: right;
    color: #6c757d;
}

.lesrooster-accordion[open] .lesrooster-accordion-summary::after {
    content: '▴';
}

.lesrooster-filter-bar {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: var(--lesrooster-gap);
    padding: var(--lesrooster-padding);
    border-top: 1px solid var(--lesrooster-border-color);
    align-items: start;
}

/* Flexbox fallback voor browsers zonder CSS Grid support */
@supports not (display: grid) {
    .lesrooster-filter-bar {
        display: flex;
        flex-wrap: wrap;
        gap: var(--lesrooster-gap);
    }
}

.lesrooster-search-input {
    padding: 12px 16px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    width: 100%;
    max-width: 300px;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.lesrooster-search-input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.lesrooster-day-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: #e8f4fd;
    border: 1px solid #007cba;
    border-radius: var(--lesrooster-border-radius);
}

.lesrooster-day-label {
    font-weight: 600;
    color: #495057;
    font-size: 14px;
    margin-bottom: 4px;
}

.lesrooster-day-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
}

/* Flexbox fallback voor day checkboxes */
@supports not (display: grid) {
    .lesrooster-day-checkboxes {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
}

/* Lesnaam zoekveld label en beschrijving */
.lesrooster-search {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: #e8f4fd;
    border: 1px solid #007cba;
    border-radius: var(--lesrooster-border-radius);
    min-width: 0;
    max-width: 100%;
}

.lesrooster-search-label {
    font-weight: 600;
    color: #495057;
    font-size: 14px;
    margin-bottom: 4px;
}

.lesrooster-search-description {
    font-size: 12px;
    color: #6c757d;
}

.lesrooster-day {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: #f1f3f5;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    font-size: 13px;
    color: #343a40;
    transition: all 0.2s ease;
    cursor: pointer;
}

.lesrooster-day:hover {
    background: #e9ecef;
    border-color: #007cba;
}

.lesrooster-day input[type="checkbox"]:checked + span {
    font-weight: 600;
    color: #007cba;
}

.lesrooster-day.checked {
    background: #e3f2fd;
    border-color: #007cba;
    color: #007cba;
}

.lesrooster-day input[type="checkbox"] {
    accent-color: #007cba;
    width: 16px;
    height: 16px;
    margin: 0;
    flex-shrink: 0;
}

/* Wijk filter styling */
.lesrooster-wijk-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: #d4edda;
    border: 1px solid #28a745;
    border-radius: var(--lesrooster-border-radius);
}

.lesrooster-wijk-label {
    font-weight: 600;
    color: #495057;
    font-size: 14px;
    margin-bottom: 4px;
}

.lesrooster-wijk-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
}

/* Flexbox fallback voor wijk checkboxes */
@supports not (display: grid) {
    .lesrooster-wijk-checkboxes {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
}

.lesrooster-wijk {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: #f1f3f5;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    font-size: 13px;
    color: #343a40;
    transition: all 0.2s ease;
    cursor: pointer;
}

.lesrooster-wijk:hover {
    background: #e9ecef;
    border-color: #28a745;
}

.lesrooster-wijk input[type="checkbox"]:checked + span {
    font-weight: 600;
    color: #28a745;
}

.lesrooster-wijk.checked {
    background: #d4edda;
    border-color: #28a745;
    color: #28a745;
}

/* Fallback voor browsers zonder :has() support - verwijderd duplicatie */

.lesrooster-wijk input[type="checkbox"] {
    accent-color: #28a745;
    width: 16px;
    height: 16px;
    margin: 0;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .lesrooster-accordion-summary {
        padding: 16px;
        font-size: 16px;
        min-height: 48px;
        display: flex;
        align-items: center;
    }
    
    .lesrooster-filter-bar {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 12px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .lesrooster-search {
        padding: 10px;
        background: #f0f8ff;
        border: 1px solid #b3d9ff;
        border-radius: 6px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        flex-shrink: 1;
    }
    
    .lesrooster-search-input {
        width: 100%;
        padding: 10px 12px;
        font-size: 14px;
        box-sizing: border-box;
    }
    
    .lesrooster-day-group {
        padding: 8px;
        background: #f0f8ff;
        border: 1px solid #b3d9ff;
        border-radius: 6px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        flex-shrink: 1;
    }
    
    .lesrooster-wijk-group {
        padding: 10px;
        background: #f0fff0;
        border: 1px solid #90ee90;
        border-radius: 6px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        flex-shrink: 1;
    }
    
    .lesrooster-day-checkboxes {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    
    .lesrooster-wijk-checkboxes {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .lesrooster-day {
        justify-content: flex-start;
        padding: 6px 10px;
        font-size: 14px;
        min-height: 40px;
        border-radius: 6px;
    }
    
    .lesrooster-day-label {
        font-size: 16px;
        font-weight: 700;
        color: #2c3e50;
    }
    
    .lesrooster-search-label {
        font-size: 16px;
        font-weight: 700;
        color: #2c3e50;
    }
    
    .lesrooster-wijk {
        justify-content: flex-start;
        padding: 6px 10px;
        font-size: 14px;
        min-height: 40px;
        border-radius: 6px;
    }
    
    .lesrooster-wijk-label {
        font-size: 16px;
        font-weight: 700;
        color: #2c3e50;
    }
}

.lesrooster-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.lesrooster-refresh-btn {
    background: #007cba;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.lesrooster-refresh-btn:hover {
    background: #005a87;
}

.lesrooster-refresh-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.lesrooster-last-updated {
    font-size: 12px;
    color: #666;
    font-style: italic;
}

.lesrooster-table-wrapper {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-width: 100%;
    position: relative;
}

/* Prevent horizontal scroll beyond table */
.lesrooster-table-wrapper::-webkit-scrollbar {
    height: 8px;
}

.lesrooster-table-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.lesrooster-table-wrapper::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.lesrooster-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.lesrooster-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 14px;
}

/* Base table header styles - used as fallback and base styling */
/* Note: These styles are duplicated in THEME OVERRIDE PROTECTION section below */
/* with .lesrooster-container prefix for higher specificity. This duplication is */
/* intentional to ensure styles work even if container class is missing. */
.lesrooster-table thead {
    background: #007cba !important;
    color: white !important;
}

.lesrooster-table thead tr {
    background: #007cba !important;
}

.lesrooster-table th {
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: white !important;
    background: #007cba !important;
}

.lesrooster-table thead th {
    color: white !important;
    background: #007cba !important;
}

.lesrooster-table td {
    padding: 12px;
    border-bottom: 1px solid #e9ecef;
    vertical-align: top;
}

.lesrooster-table tbody tr:hover {
    background-color: #f5f5f5;
}

.lesrooster-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* Prevent completely empty rows (all cells empty) */
/* Note: :empty pseudo-selector only matches elements with no content (including whitespace) */
/* Rows with whitespace-only content will NOT be hidden by this selector */
/* This is intentional to avoid hiding rows that might have legitimate whitespace */
.lesrooster-table tbody tr:empty {
    display: none;
}

/* Only hide rows where ALL cells are empty or whitespace-only */
/* Note: This is a conservative approach - we only hide rows, not individual cells */
/* Individual empty cells are kept visible as they might be intentional */

/* Ensure consistent row heights */
.lesrooster-table tbody tr:last-child td {
    padding: 12px;
}

.course-name {
    font-weight: normal;
    color: #333;
    min-width: 200px;
}

.course-day {
    color: #333;
    font-weight: normal;
    text-transform: capitalize;
    min-width: 100px;
}

.course-age-group {
    color: #333;
    font-weight: normal;
    font-size: 13px;
    min-width: 100px;
}

.course-location {
    color: #333;
    font-weight: normal;
    font-size: 13px;
    min-width: 150px;
}

.location-link {
    color: #007cba;
    text-decoration: underline;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.location-link:hover {
    color: #005a87;
    text-decoration: underline;
}

.location-link:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
    border-radius: 2px;
}

.maps-icon {
    font-size: 12px;
    opacity: 0.7;
}

/* Responsive Filter Layout */
.lesrooster-filters {
    margin-bottom: 20px;
}

/* Desktop Layout - Single Accordion */
.desktop-only {
    display: block;
}

.mobile-only {
    display: none;
}

/* ========================================
   CSS CUSTOM PROPERTIES (merged with main :root above)
   ======================================== */

/* ========================================
   DESKTOP FILTER STYLING
   ======================================== */
.lesrooster-filter-bar {
    display: flex;
    flex-direction: row;
    gap: 40px;
    padding: 24px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    align-items: flex-start;
}

.lesrooster-day-group,
.lesrooster-wijk-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.filter-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid #e9ecef;
}

.filter-title {
    font-weight: 600;
    color: #333;
    font-size: 15px;
}

.selection-hint {
    color: #999;
    font-size: 11px;
    font-weight: 400;
    font-style: italic;
}

.lesrooster-day-checkboxes,
.lesrooster-wijk-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: start;
}

/* Desktop Filter Chips - Enhanced chip styling */
.lesrooster-day,
.lesrooster-wijk {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border: 2px solid #d1d5db;
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
    position: relative;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
    user-select: none;
    min-height: 40px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.lesrooster-day:hover,
.lesrooster-wijk:hover {
    border-color: var(--primary-color);
    background: var(--hover-color);
    color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 124, 186, 0.15);
}

.lesrooster-day input,
.lesrooster-wijk input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.day-name,
.wijk-name {
    font-size: 13px;
    color: inherit;
    transition: all 0.15s ease;
    font-weight: 500;
}

/* Desktop checkbox-custom styling (hidden on desktop) */
.lesrooster-day .checkbox-custom,
.lesrooster-wijk .checkbox-custom {
    display: none;
}

.lesrooster-day input:checked + .day-name,
.lesrooster-wijk input:checked + .wijk-name {
    color: #007cba;
    font-weight: 600;
}

.lesrooster-day input:checked,
.lesrooster-wijk input:checked {
    border-color: #007cba;
    background: #007cba;
    color: white;
    box-shadow: 0 2px 6px rgba(0, 124, 186, 0.25);
}

/* Desktop checked state - explicit styling to avoid conflicts */
.lesrooster-filter-bar .lesrooster-day.checked,
.lesrooster-filter-bar .lesrooster-wijk.checked {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
    box-shadow: 0 2px 6px rgba(0, 124, 186, 0.25);
    transform: translateY(-1px);
}

.lesrooster-filter-bar .lesrooster-day.checked .day-name,
.lesrooster-filter-bar .lesrooster-wijk.checked .wijk-name {
    color: white;
    font-weight: 600;
}

/* Desktop filter count styling */
#desktop-filter-count {
    background: #6c757d;
    color: white;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 500;
    margin-left: 6px;
    display: none;
}

#desktop-filter-count:not(:empty) {
    display: inline-block;
}

/* Mobile Layout - Multiple Accordions */
@media (max-width: 768px) {
    .desktop-only {
        display: none;
    }
    
    .mobile-only {
        display: block;
    }
}

.lesrooster-filters-header {
    margin-bottom: 15px;
}

.lesrooster-filters-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.lesrooster-filter-accordions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lesrooster-filter-accordion {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    transition: all 0.3s ease;
}

.lesrooster-filter-accordion:hover {
    border-color: #007cba;
    box-shadow: 0 2px 8px rgba(0, 124, 186, 0.1);
}

.lesrooster-filter-accordion.open {
    border-color: #007cba;
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.15);
}

.lesrooster-filter-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: #f8f9fa;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    border: none;
    outline: none;
}

/* Mobile filter summary layout */
@media (max-width: 768px) {
    .lesrooster-filter-summary {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 14px 18px;
        background: #f8f9fa;
        border-radius: 8px;
        border: 1px solid var(--border-color);
    }
}

.lesrooster-filter-summary:hover {
    background: #e9ecef;
}

.lesrooster-filter-summary:focus {
    background: #e3f2fd;
    outline: 2px solid #007cba;
    outline-offset: -2px;
}

.filter-title {
    font-weight: 600;
    color: #333;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Mobile filter title with inline count */
@media (max-width: 768px) {
    .filter-title {
        font-size: 15px;
        display: flex;
        align-items: center;
        gap: 6px;
        flex: 1;
    }
}

.filter-count {
    background: #007cba;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
    display: none;
}

.filter-count:not(:empty) {
    display: inline-block;
}

/* Mobile filter count positioning */
@media (max-width: 768px) {
    .filter-count {
        padding: 1px 4px;
        font-size: 10px;
        border-radius: 6px;
        min-width: 16px;
        margin-left: 4px;
        background: #6c757d;
        color: white;
        font-weight: 500;
    }
}

.filter-arrow {
    color: #666;
    font-size: 14px;
    transition: transform 0.2s ease;
    min-width: 20px;
    text-align: center;
}

/* Mobile filter arrow - more prominent */
@media (max-width: 768px) {
    .filter-arrow {
        color: #007cba;
        font-size: 16px;
        font-weight: bold;
        min-width: 24px;
        text-align: center;
    }
}

.lesrooster-filter-accordion.open .filter-arrow {
    transform: rotate(180deg);
}

.lesrooster-filter-content {
    padding: 0;
    background: white;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.lesrooster-filter-accordion[open] .lesrooster-filter-content {
    padding: 12px;
    max-height: none; /* Remove fixed height to allow dynamic sizing */
}

.lesrooster-day-checkboxes,
.lesrooster-wijk-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}

.lesrooster-day,
.lesrooster-wijk {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
    position: relative;
    min-height: 48px; /* Touch-friendly */
}

.lesrooster-day:hover,
.lesrooster-wijk:hover {
    border-color: #007cba;
    background: #f8f9ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 124, 186, 0.1);
}

.lesrooster-day input,
.lesrooster-wijk input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 4px;
    background: white;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.lesrooster-day input:checked + .checkbox-custom,
.lesrooster-wijk input:checked + .checkbox-custom {
    background: #007cba;
    border-color: #007cba;
}

.lesrooster-day input:checked + .checkbox-custom::after,
.lesrooster-wijk input:checked + .checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.lesrooster-day input:checked + .checkbox-custom + .checkbox-label,
.lesrooster-wijk input:checked + .checkbox-custom + .checkbox-label {
    color: #007cba;
    font-weight: 600;
}

.checkbox-label {
    font-size: 14px;
    color: #333;
    transition: all 0.2s ease;
    flex: 1;
}

.lesrooster-day.checked,
.lesrooster-wijk.checked {
    border-color: #007cba;
    background: #f0f8ff;
}

/* ========================================
   MOBILE FILTER STYLING
   ======================================== */
@media (max-width: 768px) {
    .lesrooster-filter-accordions {
        gap: 8px;
    }
    
    .lesrooster-filter-summary {
        padding: 14px 18px;
        background: #f8f9fa;
        border-radius: 8px;
        border: 1px solid var(--border-color);
    }
    
    .filter-title {
        font-size: 15px;
    }
    
    /* Compact checkbox list - no thick tiles */
    .lesrooster-day-checkboxes,
    .lesrooster-wijk-checkboxes {
        display: flex;
        flex-direction: column;
        gap: 4px;
        width: 100%;
    }
    
    /* Consolideer herhalende mobile styles */
    .lesrooster-day,
    .lesrooster-wijk {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 6px 8px;
        min-height: 32px;
        width: 100%;
        border: none;
        border-radius: 4px;
        cursor: pointer;
        transition: all 0.15s ease;
        background: transparent;
        position: relative;
        box-sizing: border-box;
    }
    
    .lesrooster-day:hover,
    .lesrooster-wijk:hover {
        background: #f8f9fa;
    }
    
    .lesrooster-day input,
    .lesrooster-wijk input {
        position: absolute;
        opacity: 0;
        cursor: pointer;
    }
    
    /* Cleaner checkbox styling - only border + icon when selected */
    .checkbox-custom {
        width: 16px;
        height: 16px;
        border: 2px solid #dee2e6;
        border-radius: 3px;
        background: white;
        position: relative;
        transition: all 0.15s ease;
        flex-shrink: 0;
    }
    
    .lesrooster-day input:checked + .checkbox-custom,
    .lesrooster-wijk input:checked + .checkbox-custom {
        background: white;
        border-color: #007cba;
    }
    
    .lesrooster-day input:checked + .checkbox-custom::after,
    .lesrooster-wijk input:checked + .checkbox-custom::after {
        content: '✓';
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        color: #007cba;
        font-size: 9px;
        font-weight: bold;
    }
    
    .lesrooster-day input:checked + .checkbox-custom + .checkbox-label,
    .lesrooster-wijk input:checked + .checkbox-custom + .checkbox-label {
        color: #007cba;
        font-weight: 500;
    }
    
    .checkbox-label {
        font-size: 14px;
        color: #495057;
        transition: all 0.15s ease;
        flex: 1;
        line-height: 1.3;
    }
    
    /* Selected state - only border + icon, no background (mobile only) */
    .lesrooster-day.checked,
    .lesrooster-wijk.checked {
        background: transparent;
    }
}

@media (max-width: 480px) {
    .lesrooster-filter-summary {
        padding: 12px 16px;
    }
    
    .filter-title {
        font-size: 14px;
    }
    
    .lesrooster-day,
    .lesrooster-wijk {
        padding: 6px 8px;
        min-height: 32px;
    }
}

.course-time {
    color: #333;
    font-family: inherit;
    font-size: 13px;
    min-width: 120px;
}


.lesrooster-info {
    margin-top: 15px;
    padding: 10px 15px;
    background: #e8f4fd;
    border-left: 4px solid #007cba;
    border-radius: 0 4px 4px 0;
    font-size: 13px;
    color: #2c3e50;
}

.lesrooster-error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #f5c6cb;
    margin: 20px 0;
}

/* Loading state */
.lesrooster-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.lesrooster-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #007cba;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .lesrooster-controls {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .lesrooster-table {
        font-size: 12px;
    }
    
    .lesrooster-table th,
    .lesrooster-table td {
        padding: 8px 6px;
    }
    
    .course-name {
        min-width: 150px;
    }
    
    .course-age-group {
        min-width: 80px;
        font-size: 11px;
    }
    
    .course-location {
        min-width: 120px;
        font-size: 11px;
    }
    
    .course-day {
        min-width: 80px;
    }
    
    .course-time {
        min-width: 100px;
    }
    
}

/* Updated timestamp */
.lesrooster-updated {
    text-align: right;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
    color: #666;
    font-size: 13px;
}

.lesrooster-updated small {
    font-style: italic;
}

@media (max-width: 768px) {
    .lesrooster-updated {
        text-align: center;
        font-size: 12px;
    }
}

/* Mobile breakpoint */
@media (max-width: 480px) {
    .lesrooster-filter-bar {
        padding: 12px;
        gap: 16px;
    }
    
    .lesrooster-day-checkboxes {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    
    .lesrooster-wijk-checkboxes {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    
    .lesrooster-day {
        padding: 12px 16px;
        font-size: 15px;
        min-height: var(--lesrooster-min-touch-height);
        border-radius: 8px;
        justify-content: flex-start;
    }
    
    .lesrooster-day input[type="checkbox"] {
        width: 18px;
        height: 18px;
    }
    
    .lesrooster-day-label {
        font-size: 18px;
        margin-bottom: 8px;
    }
    
    .lesrooster-search-label {
        font-size: 18px;
        margin-bottom: 8px;
    }
    
    .lesrooster-table {
        font-size: 11px;
    }
    
    .lesrooster-table th,
    .lesrooster-table td {
        padding: 6px 4px;
    }
    
    .course-name {
        min-width: 120px;
    }
    
    .course-age-group {
        min-width: 70px;
        font-size: 10px;
    }
    
    .course-location {
        min-width: 100px;
        font-size: 10px;
    }
}

/* ========================================
   THEME OVERRIDE PROTECTION
   Verhoogde specificiteit om theme conflicts te voorkomen
   
   Note: This section duplicates some base styles (see above) but with
   .lesrooster-container prefix for higher CSS specificity. The !important
   flags are necessary to override aggressive theme CSS that may target
   generic table selectors. This is a deliberate design choice for
   theme compatibility, not a code smell.
   ======================================== */
.lesrooster-container .lesrooster-table {
    width: 100% !important;
    border-collapse: collapse !important;
    background: white !important;
    font-size: 14px !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
}

.lesrooster-container .lesrooster-table thead {
    background: #007cba !important;
    color: white !important;
}

.lesrooster-container .lesrooster-table thead tr {
    background: #007cba !important;
}

.lesrooster-container .lesrooster-table th {
    padding: 15px 12px !important;
    text-align: left !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    color: white !important;
    background: #007cba !important;
}

.lesrooster-container .lesrooster-table thead th {
    color: white !important;
    background: #007cba !important;
}

.lesrooster-container .lesrooster-table thead th * {
    color: white !important;
}

.lesrooster-container .lesrooster-table td {
    padding: 12px !important;
    border-bottom: 1px solid #e9ecef !important;
    vertical-align: top !important;
}

/* Prevent completely empty rows at bottom of table */
/* Only hide rows where ALL cells are empty, not individual cells */
.lesrooster-container .lesrooster-table tbody tr:empty {
    display: none !important;
}

/* Ensure all table rows have consistent height */
.lesrooster-container .lesrooster-table tbody tr {
    height: auto !important;
    min-height: auto !important;
}

.lesrooster-container .lesrooster-table tbody tr td {
    height: auto !important;
    min-height: auto !important;
    width: auto !important;
}

/* Prevent last row from being smaller */
.lesrooster-container .lesrooster-table tbody tr:last-child {
    height: auto !important;
}

.lesrooster-container .lesrooster-table tbody tr:last-child td {
    padding: 12px !important;
    height: auto !important;
    min-height: auto !important;
}

.lesrooster-container .lesrooster-refresh-btn {
    background: #007cba !important;
    color: white !important;
    border: none !important;
    padding: 10px 20px !important;
    border-radius: 5px !important;
    cursor: pointer !important;
    font-size: 14px !important;
    font-weight: 500 !important;
}

.lesrooster-container .lesrooster-refresh-btn:hover {
    background: #005a87 !important;
}

.lesrooster-container .lesrooster-filter-bar {
    display: flex !important;
    flex-direction: row !important;
    gap: 40px !important;
    padding: 24px !important;
    background: #f8f9fa !important;
    border-radius: 8px !important;
    border: 1px solid var(--border-color) !important;
}

@media (max-width: 768px) {
    .lesrooster-container .lesrooster-filter-bar {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 12px !important;
        padding: 12px !important;
    }
}

