/**
 * File: style.css
 * Location: /wp-content/plugins/somtoday-ical-schedule/assets/css/style.css
 * 
 * Main stylesheet voor SOMtoday iCal Schedule Plugin
 * Bevat alle styling voor admin en frontend timetable weergave
 */

:root {
    --timetable-border: #ddd;
    --timetable-header-bg: #f8f9fa;
    --timetable-header-text: #333;
    --lesson-bg: #fff;
    --lesson-border: #e9ecef;
    --lesson-text: #333;
    --lesson-secondary: #666;
    --time-bg: #f5f5f5;
    --time-text: #555;
    --today-highlight: #fff3cd;
    --current-time-highlight: #d4edda;
}

/* ===============================
   ADMIN TIMETABLE STYLING
   =============================== */

/* Clean header without excessive styling */
.somtoday-timetable-header {
    margin-bottom: 20px;
    padding: 15px;
    background: #fff;
    border: 1px solid var(--timetable-border);
    border-radius: 4px;
}

.somtoday-timetable-header h1 {
    margin: 0 0 15px 0;
    color: var(--timetable-header-text);
    font-size: 1.5rem;
    font-weight: 600;
}

.week-navigation {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.week-navigation .current-week {
    font-weight: 500;
    color: var(--lesson-text);
    padding: 5px 10px;
    background: var(--timetable-header-bg);
    border: 1px solid var(--timetable-border);
    border-radius: 3px;
}

.timetable-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Main timetable container */
.somtoday-timetable-container {
    background: #fff;
    border: 1px solid var(--timetable-border);
    border-radius: 4px;
    overflow-x: auto;
}

/* Clean, professional timetable */
.somtoday-timetable {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 13px;
}

/* Simple header styling */
.somtoday-timetable thead {
    background: var(--timetable-header-bg);
    border-bottom: 2px solid var(--timetable-border);
}

.somtoday-timetable th {
    padding: 12px 8px;
    text-align: center;
    font-weight: 600;
    color: var(--timetable-header-text);
    border-right: 1px solid var(--timetable-border);
    font-size: 14px;
}

.somtoday-timetable th:last-child {
    border-right: none;
}

/* Time column styling */
.time-column {
    width: 80px;
    min-width: 80px;
    background: var(--time-bg);
}

.day-column {
    width: calc((100% - 80px) / 5);
    min-width: 120px;
}

/* Today column highlighting */
.day-column.today {
    background: var(--today-highlight);
    font-weight: 600;
}

.day-name {
    font-size: 14px;
    margin-bottom: 3px;
}

.day-date {
    font-size: 11px;
    color: var(--lesson-secondary);
    font-weight: normal;
}

/* Time cells */
.time-cell {
    background: var(--time-bg);
    border-right: 2px solid var(--timetable-border);
    padding: 8px 6px;
    text-align: center;
    vertical-align: middle;
    font-family: monospace;
    font-size: 12px;
    color: var(--time-text);
    font-weight: 600;
}

.lesson-time .time-start {
    display: block;
    font-size: 13px;
    line-height: 1.2;
}

.lesson-time .time-end {
    display: block;
    font-size: 11px;
    color: var(--lesson-secondary);
    margin-top: 1px;
}

/* Row styling */
.time-row {
    border-bottom: 1px solid var(--timetable-border);
    height: 50px;
}

.time-row:last-child {
    border-bottom: none;
}

/* Current time row highlighting */
.time-row.current-time {
    background: var(--current-time-highlight);
}

.time-row.current-time .time-cell {
    background: var(--current-time-highlight);
    border-right-color: #28a745;
}

/* Lesson cells */
.lesson-cell {
    padding: 4px;
    vertical-align: top;
    border-right: 1px solid var(--timetable-border);
    background: var(--lesson-bg);
    height: 50px;
}

.lesson-cell:last-child {
    border-right: none;
}

.lesson-cell.today {
    background: var(--today-highlight);
}

.lesson-cell.empty-cell {
    background: #fafafa;
}

/* Clean lesson blocks */
.lesson-block {
    background: #fff;
    border: 1px solid var(--lesson-border);
    border-radius: 2px;
    padding: 4px 6px;
    margin-bottom: 2px;
    text-align: center;
    font-size: 11px;
    line-height: 1.3;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.lesson-block:last-child {
    margin-bottom: 0;
}

.lesson-block:hover {
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    border-color: #007bff;
}

.lesson-subject {
    font-weight: 600;
    color: var(--lesson-text);
    font-size: 11px;
    margin-bottom: 1px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.lesson-teacher {
    color: var(--lesson-secondary);
    font-size: 10px;
    margin-bottom: 1px;
}

.lesson-room {
    color: var(--lesson-secondary);
    font-size: 10px;
}

/* Empty cells */
.empty-lesson {
    color: #ccc;
    text-align: center;
    font-size: 18px;
    line-height: 42px;
}

/* ===============================
   FRONTEND TIMETABLE STYLING
   =============================== */

.somtoday-frontend-timetable {
    margin: 20px 0;
    background: #fff;
    border: 1px solid var(--timetable-border);
    border-radius: 4px;
    overflow-x: auto;
}

.somtoday-week-table {
    width: 100%;
    min-width: 500px;
    border-collapse: collapse;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 12px;
}

.somtoday-week-table thead {
    background: var(--timetable-header-bg);
    border-bottom: 2px solid var(--timetable-border);
}

.somtoday-week-table th {
    padding: 10px 6px;
    text-align: center;
    font-weight: 600;
    color: var(--timetable-header-text);
    border-right: 1px solid var(--timetable-border);
    font-size: 13px;
}

.somtoday-week-table th:last-child {
    border-right: none;
}

.time-header {
    width: 70px;
    background: var(--time-bg);
}

.day-header {
    width: calc((100% - 70px) / 5);
    min-width: 80px;
}

.day-header.today {
    background: var(--today-highlight);
    font-weight: 700;
}

.day-abbr {
    font-size: 13px;
    font-weight: 700;
}

.day-num {
    font-size: 11px;
    color: var(--lesson-secondary);
    margin-top: 2px;
}

.lesson-row {
    border-bottom: 1px solid var(--timetable-border);
}

.lesson-row:last-child {
    border-bottom: none;
}

.lesson-row.current-lesson {
    background: var(--current-time-highlight);
}

.time-slot {
    background: var(--time-bg);
    border-right: 2px solid var(--timetable-border);
    padding: 8px 4px;
    text-align: center;
    vertical-align: middle;
    font-family: monospace;
    font-size: 11px;
    color: var(--time-text);
}

.time-display {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.start-time {
    font-weight: 600;
    font-size: 12px;
}

.end-time {
    font-size: 10px;
    color: var(--lesson-secondary);
    margin-top: 1px;
}

.lesson-slot {
    padding: 2px;
    vertical-align: top;
    border-right: 1px solid var(--timetable-border);
    background: var(--lesson-bg);
    height: 45px;
}

.lesson-slot:last-child {
    border-right: none;
}

.lesson-slot.today-slot {
    background: var(--today-highlight);
}

.lesson-slot.empty-slot {
    background: #fafafa;
}

.subject-block {
    background: #f8f9fa;
    border: 1px solid var(--lesson-border);
    border-radius: 2px;
    padding: 3px 4px;
    margin-bottom: 1px;
    text-align: center;
    font-size: 10px;
    line-height: 1.2;
}

.subject-block:last-child {
    margin-bottom: 0;
}

.subject-block:hover {
    background: #e9ecef;
    border-color: #007bff;
}

.subject-name {
    font-weight: 600;
    color: var(--lesson-text);
    font-size: 11px;
    margin-bottom: 1px;
    text-transform: uppercase;
}

.teacher-name {
    color: var(--lesson-secondary);
    font-size: 9px;
    margin-bottom: 1px;
}

.room-name {
    color: var(--lesson-secondary);
    font-size: 9px;
}

.no-lessons {
    text-align: center;
    padding: 40px 20px;
    color: var(--lesson-secondary);
    font-style: italic;
}

/* ===============================
   GENERAL STYLING
   =============================== */

.somtoday-no-data {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border: 1px dashed var(--timetable-border);
    border-radius: 4px;
    color: var(--lesson-secondary);
    font-style: italic;
}

/* Admin styling */
.wrap .somtoday-admin-actions {
    margin: 15px 0;
    padding: 15px;
    background: #f9f9fa;
    border: 1px solid var(--timetable-border);
    border-radius: 4px;
}

.wrap .somtoday-admin-actions h2 {
    margin-top: 0;
}

.wrap .somtoday-admin-actions .button {
    margin-right: 10px;
    margin-bottom: 5px;
}

.wrap #action-result,
.wrap #sync-result,
.wrap #sync-result-view,
.wrap #sync-result-timetable {
    margin: 15px 0;
}

.wrap .notice.inline {
    display: inline-block;
    margin: 0;
    padding: 8px 12px;
}

/* ===============================
   RESPONSIVE DESIGN
   =============================== */

@media (max-width: 768px) {
    .somtoday-timetable-header {
        padding: 10px;
    }
    
    .somtoday-timetable-header h1 {
        font-size: 1.2rem;
    }
    
    .week-navigation {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .week-navigation .current-week {
        text-align: center;
    }
    
    .timetable-actions {
        justify-content: center;
    }
    
    .somtoday-timetable {
        min-width: 500px;
        font-size: 11px;
    }
    
    .day-column {
        min-width: 85px;
    }
    
    .lesson-block {
        padding: 2px 4px;
        font-size: 10px;
    }
    
    .lesson-subject {
        font-size: 10px;
    }
    
    .lesson-teacher,
    .lesson-room {
        font-size: 9px;
    }
    
    .time-cell {
        padding: 6px 4px;
        font-size: 11px;
    }
    
    /* Frontend mobile */
    .somtoday-week-table {
        min-width: 400px;
        font-size: 11px;
    }
    
    .somtoday-week-table th {
        padding: 8px 4px;
        font-size: 12px;
    }
    
    .day-header {
        min-width: 65px;
    }
    
    .time-slot {
        padding: 6px 2px;
        font-size: 10px;
    }
    
    .subject-block {
        padding: 2px 3px;
        font-size: 9px;
    }
    
    .subject-name {
        font-size: 10px;
    }
    
    .teacher-name,
    .room-name {
        font-size: 8px;
    }
}

@media (max-width: 480px) {
    .somtoday-timetable-container,
    .somtoday-frontend-timetable {
        margin: 0 -10px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    .somtoday-timetable {
        min-width: 450px;
    }
    
    .day-column {
        min-width: 70px;
    }
    
    .somtoday-week-table {
        min-width: 380px;
    }
    
    .day-header {
        min-width: 55px;
    }
    
    .time-header {
        width: 60px;
    }
}

/* ===============================
   PRINT STYLES
   =============================== */

@media print {
    .somtoday-timetable-header,
    .timetable-actions,
    .week-navigation .button,
    .wrap .somtoday-admin-actions {
        display: none !important;
    }
    
    .somtoday-timetable-container,
    .somtoday-frontend-timetable {
        background: white !important;
        box-shadow: none !important;
        border: 1px solid #000 !important;
    }
    
    .somtoday-timetable,
    .somtoday-week-table {
        font-size: 10px !important;
    }
    
    .somtoday-timetable th,
    .somtoday-week-table th {
        background: #f0f0f0 !important;
        color: #000 !important;
        border: 1px solid #000 !important;
    }
    
    .lesson-block,
    .subject-block {
        background: #f5f5f5 !important;
        color: #000 !important;
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
    
    .week-navigation .current-week {
        background: white !important;
        border: 1px solid #000 !important;
        color: #000 !important;
    }
}