@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');

body {
    font-family: 'Roboto', sans-serif;
    background-color: #f4f7f6;
    color: #333;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.container {
    width: 100%;
    max-width: 600px;
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

h1 {
    text-align: center;
    color: #0056b3;
    margin-bottom: 25px;
}

form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

label {
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

input[type="number"],
select {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
}

#team-names-container input {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    margin-bottom: 8px;
}

button {
    padding: 12px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: background-color 0.3s ease;
    margin-top: 10px;
}

button:hover {
    background-color: #0056b3;
}

#schedule-output {
    margin-top: 30px;
}

#schedule-table {
    width: 100%;
    border-collapse: collapse;
}

#schedule-table th,
#schedule-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
}

#schedule-table .table-header th {
    background-color: #333;
    color: white;
    text-align: center;
}

#schedule-table .month-header th {
    background-color: #007bff;
    color: white;
    text-align: left; /* Alinhado à esquerda */
    font-size: 1.1em;
    padding-left: 10px;
}

#action-buttons {
    text-align: center;
    margin-top: 25px;
}

#print-button {
    background-color: #28a745;
}
#print-button:hover {
    background-color: #218838;
}

.hidden {
    display: none;
}

#print-header {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

#print-header img {
    max-height: 80px;
}

#print-header h2 {
   font-size: 1.5em;
   margin: 0;
   color: #333;
}

/* Esconde o rodapé na visualização normal */
#print-footer {
    display: none;
}


/* --- ESTILOS DE IMPRESSÃO --- */
@media print {
    /* Define margens para a página, criando espaço para o rodapé */
    @page {
        size: A4;
        margin: 1.5cm 1cm;
    }

    h1, form, #action-buttons {
        display: none;
    }

    body, .container {
        background-color: #fff;
        box-shadow: none;
        padding: 0;
        margin: 0;
        width: 100%;
        max-width: 100%;
        font-size: 9.5pt;
    }
    
    #print-header {
        display: flex;
        page-break-after: avoid; 
    }

    #schedule-output {
        margin: 0;
        column-count: 2;
        column-gap: 25px;
    }

    #schedule-table {
        width: 100%;
    }
    
    #schedule-table th, #schedule-table td {
        border: 1px solid #000 !important;
        padding: 6px;
    }

    #schedule-table tr {
        break-inside: avoid;
    }
    
    #schedule-table .month-header {
        page-break-after: avoid;
    }

    #schedule-table .month-header th {
        background-color: #e9ecef !important;
        color: #000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    #schedule-table .table-header th {
        background-color: #333 !important;
        color: white !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* ESTILOS DO RODAPÉ DE IMPRESSÃO */
    #print-footer {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        text-align: center;
        font-size: 9pt;
        color: #666;
    }
}

/* --- ESTILOS PARA O BOTÃO "GERAR ESCALA" --- */
form button[type="submit"] {
    background-color: #dc3545;
    width: 50%;
    align-self: center;
}

form button[type="submit"]:hover {
    background-color: #c82333;
}