@charset "UTF-8";

/* ===== MODERN SCHOOL TIMETABLE STYLESHEET ===== */
/* Clean, readable design optimized for educational environments */

/* Import Google Fonts - cleaner, more readable fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Source+Sans+Pro:wght@400;600;700&display=swap');

/* Global Reset and Base Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Source Sans Pro', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.5;
    color: #2d3748;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    min-height: 100vh;
    padding: 16px;
    margin: 0;
    font-size: 14px;
}

#top {
    max-width: 1600px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
}

/* Page Break Controls */
table.odd_table,
table.even_table {
    page-break-before: always;
}

/* Navigation Links */
p.back {
    margin: 24px 0;
    padding: 16px 20px;
    background: #4a5568;
    border-radius: 8px;
    color: white;
    text-align: center;
    font-weight: 500;
}

p.back a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    margin: 0 4px;
    display: inline-block;
    transition: all 0.2s ease;
    font-size: 13px;
}

p.back a:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

/* Enhanced Table Styling */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-family: 'Source Sans Pro', sans-serif;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    background: white;
    margin: 16px auto;
    page-break-inside: avoid;
}

table.detailed {
    margin: 16px auto;
    text-align: center;
    border: 0;
}

/* Modern Caption */
caption {
    font-size: 22px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 20px;
    text-align: center;
    padding: 12px 0;
    font-family: 'Inter', sans-serif;
}

/* Text Styling */
span.institution {
    font-weight: 700;
    color: #3182ce;
    font-size: 1.1em;
}

span.name {
    font-weight: 500;
    color: #2d3748;
}

span.comment {
    font-style: italic;
    color: #718096;
    font-size: 0.9em;
}

span.legend_title {
    font-weight: 600;
    color: #2d3748;
    font-size: 1.05em;
}

/* Header Styling */
thead {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
}

thead th,
thead td {
    color: white !important;
    font-weight: 600;
    padding: 14px 10px;
    text-align: center;
    font-size: 13px;
    border: none;
    letter-spacing: 0.3px;
}

/* Footer Styling */
tr.foot {
    background: #718096;
}

tr.foot td {
    color: white !important;
    font-weight: 500;
    padding: 12px;
    text-align: center;
    font-size: 13px;
}

/* Body Cells */
tbody {
    background: white;
}

tbody tr {
    transition: background-color 0.2s ease;
}

tbody tr:hover {
    background: rgba(74, 85, 104, 0.03);
}

th {
    background: #f7fafc;
    color: #2d3748;
    font-weight: 600;
    padding: 12px 8px;
    border: 1px solid #e2e8f0;
    font-size: 13px;
    text-align: center;
}

td {
    padding: 10px 8px;
    border: 1px solid #e2e8f0;
    font-weight: 500;
    font-size: 12px;
    text-align: center;
    transition: all 0.2s ease;
}

td.detailed {
    border: 1px solid #e2e8f0;
    border-bottom: 0;
    border-top: 0;
}

/* Axis Headers */
th.xAxis {
    background: linear-gradient(135deg, #3182ce 0%, #2c5282 100%);
    color: white;
    min-width: 100px;
    font-weight: 600;
}

th.yAxis {
    height: 60px;
    background: linear-gradient(135deg, #edf2f7 0%, #e2e8f0 100%);
    color: #2d3748;
    font-weight: 600;
    writing-mode: horizontal-tb;
}

/* Navigation Paragraphs */
p {
    padding: 16px 20px;
    background: #edf2f7;
    border-radius: 8px;
    margin: 16px 0;
    border-left: 4px solid #3182ce;
}

p a {
    color: #3182ce;
    text-decoration: none;
    font-weight: 600;
    padding: 6px 12px;
    background: rgba(49, 130, 206, 0.1);
    border-radius: 4px;
    margin: 2px;
    display: inline-block;
    transition: all 0.2s ease;
    font-size: 13px;
}

p a:hover {
    background: rgba(49, 130, 206, 0.2);
    transform: translateY(-1px);
}

/* Content Spans */
span.subject {
    font-weight: 600;
    color: #2d3748;
}

span.activitytag {
    font-size: 0.85em;
    color: #718096;
    font-style: italic;
}

span.empty {
    color: #a0aec0;
    font-style: italic;
}

td.empty {
    border-color: #e2e8f0;
    border-style: dotted;
    background: #f7fafc;
    color: #a0aec0;
}

span.notAvailable {
    color: #e53e3e;
    font-weight: 500;
}

td.notAvailable {
    border-color: #fed7d7;
    border-style: dotted;
    background: #fed7d7;
    color: #c53030;
}

span.break {
    color: #d69e2e;
    font-weight: 500;
}

td.break {
    border-color: #faf089;
    border-style: dotted;
    background: #faf089;
    color: #b7791f;
}

/* Row Types */
tr.studentsset, div.studentsset {
    background: rgba(49, 130, 206, 0.05);
}

tr.teacher, div.teacher {
    background: rgba(128, 90, 213, 0.05);
}

tr.room, div.room {
    background: rgba(56, 161, 105, 0.05);
}

tr.line0, div.line0 {
    font-size: 0.85em;
    color: #718096;
}

tr.line1, div.line1 {
    font-weight: 500;
    color: #2d3748;
}

tr.line2, div.line2 {
    font-size: 0.9em;
    color: #4a5568;
}

tr.line3, div.line3 {
    font-size: 0.85em;
    color: #718096;
}

/* Teacher Status Indicators */
div.DESCRIPTION {
    text-align: left;
    font-size: 0.9em;
    padding: 8px 12px;
    background: #f7fafc;
    border-radius: 6px;
    margin: 4px 0;
    border-left: 3px solid #3182ce;
    color: #2d3748;
}

div.TEACHER_HAS_SINGLE_GAP {
    color: #2b6cb0;
    background: rgba(49, 130, 206, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    margin: 2px 0;
    font-size: 0.85em;
}

div.TEACHER_HAS_BORDER_GAP {
    color: #4a5568;
    background: rgba(113, 128, 150, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    margin: 2px 0;
    font-size: 0.85em;
}

div.TEACHER_HAS_BIG_GAP {
    color: #718096;
    background: rgba(160, 174, 192, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    margin: 2px 0;
    font-size: 0.85em;
}

div.TEACHER_MUST_COME_EARLIER {
    color: #805ad5;
    background: rgba(128, 90, 213, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    margin: 2px 0;
    font-weight: 500;
    font-size: 0.85em;
}

div.TEACHER_MUST_COME_MUCH_EARLIER {
    color: #d53f8c;
    background: rgba(213, 63, 140, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    margin: 2px 0;
    font-weight: 500;
    font-size: 0.8em;
}

div.TEACHER_MUST_STAY_LONGER {
    color: #38a169;
    background: rgba(56, 161, 105, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    margin: 2px 0;
    font-weight: 500;
    font-size: 0.85em;
}

div.TEACHER_MUST_STAY_MUCH_LONGER {
    color: #319795;
    background: rgba(49, 151, 149, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    margin: 2px 0;
    font-weight: 500;
    font-size: 0.8em;
}

div.TEACHER_HAS_A_FREE_DAY {
    color: #e53e3e;
    background: rgba(229, 62, 62, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    margin: 2px 0;
    font-weight: 500;
    font-size: 0.8em;
}

div.TEACHER_IS_NOT_AVAILABLE {
    color: #d69e2e;
    background: rgba(214, 158, 46, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    margin: 2px 0;
    font-weight: 500;
    font-size: 0.8em;
}

/* Responsive Design */
@media (max-width: 1024px) {
    #top {
        padding: 16px;
        margin: 8px;
    }
    
    table {
        font-size: 13px;
    }
    
    th, td {
        padding: 8px 6px;
    }
    
    caption {
        font-size: 18px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 8px;
    }
    
    #top {
        padding: 12px;
    }
    
    table {
        font-size: 12px;
    }
    
    th, td {
        padding: 6px 4px;
    }
    
    caption {
        font-size: 16px;
    }
    
    th.yAxis {
        height: 50px;
    }
}

/* Activity Colors - Softer, School-Appropriate Palette */
/* Mathematics & Sciences - Cool Blues and Teals */
td.c_1 { background-color: #bee3f8; color: #1a365d; } /* Light blue */
td.c_2 { background-color: #90cdf4; color: #1a202c; } /* Sky blue */
td.c_3 { background-color: #68d391; color: #1a202c; } /* Light green */
td.c_4 { background-color: #9ae6b4; color: #1a202c; } /* Mint green */
td.c_5 { background-color: #63b3ed; color: #1a202c; } /* Blue */
td.c_6 { background-color: #9f7aea; color: white; } /* Purple */
td.c_7 { background-color: #4c51bf; color: white; } /* Indigo */

/* Languages - Warm Earth Tones */
td.c_8 { background-color: #f6e05e; color: #1a202c; } /* Yellow */
td.c_9 { background-color: #fbb6ce; color: #1a202c; } /* Pink */
td.c_10 { background-color: #fbd38d; color: #1a202c; } /* Orange */
td.c_11 { background-color: #fc8181; color: #1a202c; } /* Red */
td.c_12 { background-color: #a78bfa; color: white; } /* Purple */

/* Arts & Humanities - Soft Pastels */
td.c_13 { background-color: #c6f6d5; color: #1a202c; } /* Light green */
td.c_14 { background-color: #fed7e2; color: #1a202c; } /* Light pink */
td.c_15 { background-color: #e9d8fd; color: #1a202c; } /* Light purple */
td.c_16 { background-color: #fef5e7; color: #1a202c; } /* Light orange */
td.c_17 { background-color: #ebf8ff; color: #1a202c; } /* Light blue */

/* Continue with similar soft, readable color patterns */
td.c_18 { background-color: #f0fff4; color: #1a202c; }
td.c_19 { background-color: #fefcbf; color: #1a202c; }
td.c_20 { background-color: #e6fffa; color: #1a202c; }
td.c_21 { background-color: #fef5e7; color: #1a202c; }
td.c_22 { background-color: #fed7d7; color: #1a202c; }
td.c_23 { background-color: #c6f6d5; color: #1a202c; }
td.c_24 { background-color: #bee3f8; color: #1a202c; }
td.c_25 { background-color: #fbb6ce; color: #1a202c; }

/* Enhanced activity cell styling */
td[class^="c_"] {
    font-weight: 600;
    border-radius: 4px;
    padding: 10px 6px;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    line-height: 1.3;
}

td[class^="c_"]:hover {
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 5;
}

/* Print Styles */
@media print {
    body {
        background: white;
        padding: 0;
    }
    
    #top {
        box-shadow: none;
        border: none;
        padding: 0;
    }
    
    table {
        box-shadow: none;
        page-break-inside: avoid;
    }
    
    td[class^="c_"]:hover {
        transform: none;
        box-shadow: none;
    }
    
    .no-print {
        display: none;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    td[class^="c_"] {
        border: 2px solid #000;
        font-weight: 700;
    }
}

/* Focus styles for accessibility */
a:focus,
td:focus {
    outline: 2px solid #3182ce;
    outline-offset: 2px;
}