/* Estilos para exibição de horários por mês */

.horarios-mes-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.dia-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dia-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.dia-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.dia-header h4 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 1.2em;
    font-weight: 600;
}

.dia-header h4 i {
    color: #6c5ce7;
    margin-right: 8px;
}

.data-dia {
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 500;
    display: inline-block;
}

.periodo-manhã,
.periodo-tarde,
.periodo-noite {
    margin-bottom: 20px;
}

.periodo-manhã h5,
.periodo-tarde h5,
.periodo-noite h5 {
    margin: 0 0 12px 0;
    font-size: 1em;
    font-weight: 600;
    color: #555;
    display: flex;
    align-items: center;
    gap: 8px;
}

.periodo-manhã h5 i {
    color: #fdcb6e;
}

.periodo-tarde h5 i {
    color: #f39c12;
}

.periodo-noite h5 i {
    color: #3498db;
}

.horarios-grid-mes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 8px;
}

.horario-btn-mes {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 10px 8px;
    font-size: 0.85em;
    font-weight: 500;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 40px;
}

.horario-btn-mes:hover {
    background: #e3f2fd;
    border-color: #2196f3;
    color: #1976d2;
    transform: translateY(-1px);
}

.horario-btn-mes.selected {
    background: linear-gradient(135deg, #4caf50, #66bb6a);
    border-color: #4caf50;
    color: white;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.horario-btn-mes.selected:hover {
    background: linear-gradient(135deg, #45a049, #5cb85c);
    transform: translateY(-1px);
}

.horario-btn-mes i {
    font-size: 0.8em;
}

/* Estilos para estados vazios e loading */
.horarios-empty,
.horarios-error,
.horarios-placeholder,
.horarios-loading {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    margin: 20px 0;
}

.horarios-empty i,
.horarios-error i,
.horarios-placeholder i,
.horarios-loading i {
    font-size: 3em;
    margin-bottom: 15px;
    color: #6c757d;
}

.horarios-loading i {
    color: #6c5ce7;
}

.horarios-error i {
    color: #dc3545;
}

.horarios-empty h3,
.horarios-error h3 {
    margin: 0 0 10px 0;
    color: #495057;
    font-size: 1.3em;
}

.horarios-empty p,
.horarios-error p,
.horarios-placeholder p,
.horarios-loading p {
    margin: 0;
    color: #6c757d;
    font-size: 1em;
    line-height: 1.5;
}

.btn-retry {
    background: #dc3545;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 500;
    cursor: pointer;
    margin-top: 15px;
    transition: background-color 0.2s ease;
}

.btn-retry:hover {
    background: #c82333;
}

/* Estilos para paginação */
.info-paginacao {
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 8px;
    margin: 10px 0;
    text-align: center;
    border: 1px solid #e9ecef;
}

.info-paginacao span {
    color: #6c757d;
    font-size: 0.9em;
    font-weight: 500;
}

.info-paginacao i {
    color: #6c5ce7;
    margin-right: 6px;
}

.paginacao-container {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.info-paginacao-bottom {
    text-align: center;
    margin-bottom: 15px;
}

.info-paginacao-bottom span {
    color: #6c757d;
    font-size: 0.9em;
    font-weight: 500;
}

.botoes-paginacao {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-paginacao {
    background: #fff;
    border: 2px solid #6c5ce7;
    color: #6c5ce7;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    justify-content: center;
}

.btn-paginacao:hover {
    background: #6c5ce7;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
}

.btn-mostrar-mais {
    border-color: #28a745;
    color: #28a745;
}

.btn-mostrar-mais:hover {
    background: #28a745;
    color: white;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.btn-mostrar-menos {
    border-color: #dc3545;
    color: #dc3545;
}

.btn-mostrar-menos:hover {
    background: #dc3545;
    color: white;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.btn-mostrar-todos {
    border-color: #17a2b8;
    color: #17a2b8;
}

.btn-mostrar-todos:hover {
    background: #17a2b8;
    color: white;
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
}

/* Responsividade */
@media (max-width: 768px) {
    .horarios-mes-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .dia-card {
        padding: 15px;
    }
    
    .horarios-grid-mes {
        grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
        gap: 6px;
    }
    
    .horario-btn-mes {
        padding: 8px 6px;
        font-size: 0.8em;
        min-height: 36px;
    }
    
    .botoes-paginacao {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-paginacao {
        min-width: 200px;
    }
    
    .paginacao-container {
        padding: 15px;
    }
}

/* Media query específica para resolução 408x883 */
@media (max-width: 420px) and (min-height: 800px) {
    .horarios-mes-container {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-top: 15px;
        padding: 0 8px;
    }
    
    .dia-card {
        padding: 10px;
        margin: 0;
        width: 100%;
        box-sizing: border-box;
    }
    
    .horarios-grid-mes {
        grid-template-columns: repeat(3, 1fr);
        gap: 4px;
        max-width: 100%;
        overflow: visible;
        width: 100%;
    }
    
    .horario-btn-mes {
        padding: 6px 2px;
        font-size: 0.65em;
        min-height: 32px;
        word-wrap: break-word;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        width: 100%;
        box-sizing: border-box;
    }
    
    .periodo-noite .horarios-grid-mes {
        grid-template-columns: repeat(3, 1fr);
        gap: 4px;
        width: 100%;
        overflow-x: auto;
        padding-bottom: 5px;
    }
    
    .periodo-noite .horario-btn-mes {
        padding: 6px 2px;
        font-size: 0.65em;
        min-height: 32px;
        min-width: 0;
        flex-shrink: 1;
    }
    
    .dia-header h4 {
        font-size: 0.95em;
    }
    
    .data-dia {
        font-size: 0.7em;
        padding: 3px 6px;
    }
    
    /* Garantir que não haja overflow horizontal */
    .periodo-manhã,
    .periodo-tarde,
    .periodo-noite {
        width: 100%;
        overflow: visible;
    }
}

/* Media query específica para resolução 408x883 e similares */
@media (max-width: 410px) and (min-height: 880px) {
    .horarios-mes-container {
        padding: 0 5px;
        gap: 10px;
    }
    
    .dia-card {
        padding: 8px;
        margin: 0;
    }
    
    .horarios-grid-mes {
        grid-template-columns: repeat(3, 1fr);
        gap: 3px;
        width: 100%;
        max-width: 100%;
    }
    
    .horario-btn-mes {
        padding: 4px 1px;
        font-size: 0.6em;
        min-height: 28px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .periodo-noite .horarios-grid-mes {
        grid-template-columns: repeat(3, 1fr);
        gap: 3px;
        overflow-x: visible;
        width: 100%;
    }
    
    .periodo-noite .horario-btn-mes {
        padding: 4px 1px;
        font-size: 0.6em;
        min-height: 28px;
        max-width: 100%;
    }
    
    .dia-header h4 {
        font-size: 0.9em;
    }
    
    .data-dia {
        font-size: 0.65em;
        padding: 2px 4px;
    }
}

@media (max-width: 480px) {
    .horarios-grid-mes {
        grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    }
    
    .horario-btn-mes {
        padding: 6px 4px;
        font-size: 0.75em;
        min-height: 32px;
    }
    
    .dia-header h4 {
        font-size: 1.1em;
    }
    
    .data-dia {
        font-size: 0.8em;
        padding: 4px 10px;
    }
    
    .btn-paginacao {
        padding: 8px 16px;
        font-size: 0.8em;
        min-width: 180px;
    }
    
    .info-paginacao,
    .paginacao-container {
        margin: 15px 0;
        padding: 12px;
    }
}