:root {
    --border-color: #333;
    --header-bg: #2c3e50;
    --header-text: #fff;
    --cell-padding: 8px;
    --navbar-bg: #2c3e50;
    --navbar-hover: #34495e;
    --navbar-text: #fff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 11px;
    line-height: 1.3;
    color: #333;
    background: #f5f5f5;
    padding: 20px;
}

/* ==========================================
   Navigation Bar
   ========================================== */

.navbar {
    background: var(--navbar-bg);
    padding: 0;
    margin: -20px -20px 20px -20px;
    border-radius: 8px 8px 0 0;
}

.navbar-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 20px;
}

.navbar-menu {
    list-style: none;
    display: flex;
    align-items: center;
}

.navbar-item {
    position: relative;

    &:hover {
        background: var(--navbar-hover);
        border-radius: 4px;
    }
}

.navbar-link {
    display: block;
    padding: 15px 20px;
    color: var(--navbar-text);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: background 0.2s;
}

/* Dropdown styles */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--navbar-bg);
    min-width: 200px;
    list-style: none;
    z-index: 1000;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-item {
    display: block;
    padding: 12px 20px;
    color: var(--navbar-text);
    text-decoration: none;
    font-size: 13px;
    transition: background 0.2s;

    &:hover {
        background: var(--navbar-hover);
    }
}

.dropdown-toggle {
    cursor: pointer;
}

@media print {
    .navbar {
        display: none;
    }
}

.container {
    max-width: 100%;
    margin: 0 auto;
    background: #fff;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

h1 {
    text-align: center;
    color: var(--header-bg);
    margin-bottom: 10px;
    font-size: 24px;
}

h2 {
    text-align: center;
    color: #555;
    margin-bottom: 20px;
    font-size: 16px;
    font-weight: normal;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    table-layout: fixed;
}

th, td {
    border: 1px solid var(--border-color);
    padding: var(--cell-padding);
    text-align: center;
    vertical-align: middle;
    background-color: white;

    a:link, a:visited {
        color: inherit;
    }
}

th {
    background: var(--header-bg);
    color: var(--header-text);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.5px;
}

.periodo-cell {
    background: #ecf0f1;
    font-weight: 600;
}

.celula-disciplina {
    font-weight: 700;
    font-size: clamp(6px, 1cqi, 12px);
    white-space: nowrap;
    overflow: hidden;
    color: #2c3e50;
}

.celula-professor-esmaecido {
    font-weight: 400;
    font-size: clamp(5px, .9cqi, 10px);
    color: #666;
}

.celula-turma {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    color: #333;
    margin: 2px;
}

.mobile-only-table-cell, .mobile-only-inline {
    display: none;
}

/*
 * Classes dinâmicas de cores para professores e turmas
 * São geradas automaticamente em styles.css pelo código Python
 */

/* ==========================================
   Mobile Styles
   ========================================== */

@media (max-width: 1024px) {
    .container {
        display: contents;
    }

    .mobile-only-table-cell {
        display: table-cell !important;
    }

    .mobile-only-inline {
        display: inline !important;
    }

    .mobile-hidden {
        display: none !important;
    }
}

@media print {
    body {
        background: #fff;
        padding: 0;
    }

    .container {
        box-shadow: none;
        padding: 10px;
    }

    h1 {
        font-size: 18px;
    }

    h2 {
        font-size: 14px;
    }

    th, td {
        padding: 4px;
        font-size: 9px;
    }
}

.page-break {
    page-break-before: always;
}

/* ==========================================
   Índice (index.mustache)
   ========================================== */

body.index {
    body {
        font-size: 14px;
        line-height: 1.6;
    }

    .container {
        max-width: 1200px;
        padding: 30px;
    }

    h1 {
        font-size: 28px;
    }

    h2 {
        margin: 30px 0 15px;
        font-size: 20px;
        border-bottom: 2px solid #3498db;
        padding-bottom: 10px;
    }

    .intro {
        text-align: center;
        color: #666;
        margin-bottom: 30px;
        font-size: 16px;
    }

    .grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 10px;
        margin-bottom: 20px;
    }

    .card {
        padding: 15px;
        background: #f5f5f5;
        border-radius: 6px;
        text-decoration: none;
        color: #2c3e50;
        font-weight: 500;
        text-align: center;
        transition: background 0.2s, transform 0.2s;
        border: 1px solid #ddd;

        &:hover {
            background: #3498db;
            color: #fff;
            transform: translateY(-2px);
        }

        &.destaque {
            background: #2c3e50;
            color: #fff;
            font-size: 16px;

            &:hover {
                background: #3498db;
            }
        }
    }
}

@media print {
    body {
        width: 100%;
        max-width: none;

        &.index {
            background: #fff;
            padding: 0;
        }
    }

    .container {
        box-shadow: none;
        padding: 10px;
    }

    h1 {
        font-size: 18px;
    }

    h2 {
        font-size: 14px;
    }

    .card {
        &:hover {
            transform: none;
        }
    }

    tbody {
        break-inside: avoid;
    }

    tbody tr.subheader {
        break-before: always;
    }

    a:link, a:visited {
        text-decoration: none;
    }
}


.prof-anderson { background-color: #FFB3B3; }
.prof-bruna { background-color: #B3E5E0; }
.prof-eduardo { background-color: #B3D9E5; }
.prof-eliane { background-color: #FFC9B3; }
.prof-gabriela { background-color: #C9E8E0; }
.prof-ilaine { background-color: #F8E8B3; }
.prof-jean { background-color: #D9C9E8; }
.prof-joana { background-color: #B3D4E8; }
.prof-juliane { background-color: #F8E0B3; }
.prof-jessica { background-color: #B3E5E5; }
.prof-lenir { background-color: #FFB3D9; }
.prof-leomar { background-color: #B3E5B3; }
.prof-maira { background-color: #FFD4B3; }
.prof-rodrigo { background-color: #D4C9E8; }
.turma-61 { background-color: #E3F2FD; }
.turma-62 { background-color: #E8F5E9; }
.turma-71 { background-color: #FFF3E0; }
.turma-72 { background-color: #F3E5F5; }
.turma-81 { background-color: #FFEBEE; }
.turma-82 { background-color: #E0F7FA; }
.turma-91 { background-color: #FFF8E1; }
.turma-92 { background-color: #F1F8E9; }
