/* ============================================================
   TEMA MODERNO — AZUL SEE-AC
   Compatível com Bootstrap 4.6.2
   ============================================================ */

:root {
    --see-blue: #0479ff;
    /* Azul principal SEE-AC */
    --see-blue-light: #1a5db3;
    /* Hover / foco */
    --see-gray: #b8c2cc;
    --see-gray-light: #e9ecef;
}

/* --- Estrutura base sem conflitos --- */
.custom-control {
    position: relative;
    display: block;
    min-height: 1.6rem;
    padding-left: 2rem;
    cursor: pointer;
}

.custom-control-input {
    position: absolute;
    left: 0;
    width: 1.2rem;
    height: 1.2rem;
    opacity: 0;
    z-index: 2;
    cursor: pointer;
}

.custom-control-label {
    margin-bottom: 0;
    cursor: pointer;
    line-height: 1.3rem;

    padding-left: 1.8rem !important;
    position: relative;
    top: 1px;
    /* 1 a 2px é o padrão de equilíbrio */
}

/* ============================================================
   CHECKBOX — Tema SEE-AC
   ============================================================ */

.custom-checkbox .custom-control-label::before,
.custom-checkbox .custom-control-label::after {
    position: absolute;
    top: 0;
    left: 0;
    width: 1.2rem;
    height: 1.2rem;
    content: "";
    border-radius: 0.25rem;
    transition: all 0.20s ease;
}

/* Caixa base */
.custom-checkbox .custom-control-label::before {
    border: 2px solid var(--see-gray);
    background: #fff;
}

/* Marcado */
.custom-checkbox .custom-control-input:checked~.custom-control-label::before {
    background: var(--see-blue);
    border-color: var(--see-blue);
}

/* Ícone de check */
.custom-checkbox .custom-control-input:checked~.custom-control-label::after {
    background-image: url("data:image/svg+xml,%3Csvg stroke='white' fill='none' stroke-width='3' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4.5 12.75l6 4.5 9-13.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 85%;
}

/* Foco */
.custom-checkbox .custom-control-input:focus~.custom-control-label::before {
    box-shadow: 0 0 0 0.2rem rgba(0, 30, 255, 0.65);
}

/* Disabled */
.custom-checkbox .custom-control-input:disabled~.custom-control-label {
    color: #aaa;
}

.custom-checkbox .custom-control-input:disabled~.custom-control-label::before {
    background: var(--see-gray-light);
    border-color: #d0d0d0;
}

/* ============================================================
   RADIO — Tema SEE-AC
   ============================================================ */

.custom-radio .custom-control-label::before,
.custom-radio .custom-control-label::after {
    position: absolute;
    top: 0.22rem;
    left: 0;
    width: 1.15rem;
    height: 1.15rem;
    content: "";
    border-radius: 50%;
    transition: all 0.20s ease;
}

/* Círculo base */
.custom-radio .custom-control-label::before {
    border: 2px solid var(--see-gray);
    background: #fff;
}

/* Marcado */
.custom-radio .custom-control-input:checked~.custom-control-label::before {
    background: var(--see-blue);
    border-color: var(--see-blue);
}

.custom-radio .custom-control-input:checked~.custom-control-label::after {
    background: white;
    width: 0.55rem;
    height: 0.55rem;
    top: 0.47rem;
    left: 0.32rem;
}

/* Foco */
.custom-radio .custom-control-input:focus~.custom-control-label::before {
    box-shadow: 0 0 0 0.2rem rgba(0, 30, 255, 0.65);
}

/* ============================================================
   SWITCH — Tema SEE-AC (estilo iOS)
   ============================================================ */

.custom-switch {
    padding-left: 2.7rem;
}

.custom-switch .custom-control-label::before {
    position: absolute;
    top: 0.25rem;
    left: 0;
    width: 2.2rem;
    height: 1.1rem;
    border-radius: 1rem;
    background: var(--see-gray-light);
    content: "";
    transition: background 0.25s ease;
}

.custom-switch .custom-control-label::after {
    position: absolute;
    top: 0.25rem;
    left: 0.05rem;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    content: "";
    transition: transform 0.25s ease;
}

/* Ativo */
.custom-switch .custom-control-input:checked~.custom-control-label::before {
    background: var(--see-blue);
}

.custom-switch .custom-control-input:checked~.custom-control-label::after {
    transform: translateX(1.05rem);
}

/* Foco */
.custom-switch .custom-control-input:focus~.custom-control-label::before {
    box-shadow: 0 0 0 0.2rem rgba(0, 30, 255, 0.65);
}

/* Disabled */
.custom-switch .custom-control-input:disabled~.custom-control-label {
    color: #aaa;
}

.custom-switch .custom-control-input:disabled~.custom-control-label::before {
    opacity: 0.5;
}

/* CORREÇÃO: deslocar o texto da label para a direita */
.custom-control-label {
    padding-left: 1.8rem !important;
    /* ajuste fino */
}

/* Garantir alinhamento perfeito da caixa */
.custom-checkbox .custom-control-label::before,
.custom-checkbox .custom-control-label::after {
    left: 0.2rem !important;
}

/* ============================================================
   RELATÓRIOS DE NOTAS - INDEX
   ============================================================ */

/* Lista de relatórios */
.relatorios-lista {
    max-height: 500px;
    overflow-y: auto;
}

/* Item de relatório */
.relatorio-item {
    cursor: pointer;
    transition: all 0.2s ease;
}

.relatorio-item:hover {
    background-color: rgba(0, 123, 255, 0.03);
}

/* Radio selecionado - destaque no item */
.relatorio-radio:checked+label {
    font-weight: 600;
}

.relatorio-radio:checked~* .relatorio-item,
.relatorio-item:has(.relatorio-radio:checked) {
    background-color: rgba(0, 123, 255, 0.08);
    border-left: 4px solid var(--see-blue, #007bff) !important;
}

/* Input ano com destaque */
#ano:focus {
    border-color: var(--see-blue, #007bff);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Alert de relatório selecionado */
#relatorioSelecionado {
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#infoRelatorio {
    width: 100%;
}

/* Scrollbar customizada para lista de relatórios */
.relatorios-lista::-webkit-scrollbar {
    width: 8px;
}

.relatorios-lista::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.relatorios-lista::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.relatorios-lista::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Animação suave no botão */
#btnGerarRelatorio:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
    transition: all 0.2s ease;
}

#btnGerarRelatorio:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Card de ajuda */
.border-info {
    border-left: 4px solid #17a2b8 !important;
}

/* Responsividade */
@media (max-width: 768px) {
    .relatorios-lista {
        max-height: 300px;
    }

    #btnGerarRelatorio {
        width: 100%;
        margin-top: 1rem;
    }
}

/* ============================================================
   CUSTOM RADIO - Aprimoramento do tema SEE-AC
   ============================================================ */

.custom-radio .custom-control-label {
    cursor: pointer;
    user-select: none;
}

.custom-radio .custom-control-input:checked~.custom-control-label {
    color: var(--see-blue, #007bff);
}

/* Efeito de hover no label */
.custom-radio .custom-control-label:hover::before {
    border-color: var(--see-blue, #007bff);
}

/* Transição suave */
.custom-radio .custom-control-label::before,
.custom-radio .custom-control-label::after {
    transition: all 0.15s ease-in-out;
}

/* ============================================================
   SELEÇÃO DE TURMAS - 2 COLUNAS
   ============================================================ */

/* Lista de turmas com scroll */
.turmas-lista {
    max-height: 400px;
    overflow-y: auto;
}

/* Scrollbar customizada */
.turmas-lista::-webkit-scrollbar {
    width: 6px;
}

.turmas-lista::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.turmas-lista::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.turmas-lista::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Item de turma */
.turmas-lista .list-group-item {
    transition: background-color 0.2s ease;
}

.turmas-lista .list-group-item:hover {
    background-color: rgba(0, 123, 255, 0.03);
}

/* Checkbox/Radio selecionado */
.turma-checkbox:checked+label,
.turma-radio:checked+label {
    background-color: rgba(0, 123, 255, 0.08);
    font-weight: 600;
}

/* Responsividade */
@media (max-width: 768px) {
    .turmas-lista {
        max-height: 300px;
    }
}

/* ============================================================
   SELEÇÃO DE DISCIPLINAS - 2 COLUNAS
   ============================================================ */

/* Grid de disciplinas */
.disciplinas-grid {
    max-height: 500px;
    overflow-y: auto;
    padding-right: 5px;
}

/* Item individual de disciplina */
.disciplina-item {
    background-color: #fff;
    transition: all 0.2s ease;
    cursor: pointer;
    min-height: 40px;
    display: flex;
    align-items: center;
}

.disciplina-item:hover {
    background-color: rgba(0, 123, 255, 0.03);
    border-color: var(--see-blue, #007bff) !important;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.1);
}

/* Item selecionado */
.disciplina-checkbox:checked~label .disciplina-item,
.disciplina-radio:checked~label .disciplina-item,
.disciplina-item:has(.disciplina-checkbox:checked),
.disciplina-item:has(.disciplina-radio:checked) {
    background-color: rgba(0, 123, 255, 0.08);
    border-color: var(--see-blue, #007bff) !important;
    border-width: 2px !important;
}

/* Custom control dentro do item */
.disciplina-item .custom-control {
    width: 100%;
    padding-left: 2.5rem;
    /* ✅ MARGEM ESQUERDA AUMENTADA */
    margin-bottom: 0;
}

/* Posicionamento do checkbox/radio */
.disciplina-item .custom-control-input {
    position: absolute;
    left: 0.75rem;
    /* ✅ AFASTADO DA BORDA */
    top: 50%;
    transform: translateY(-50%);
    width: 1.25rem;
    height: 1.25rem;
    z-index: 1;
}

/* Label do custom control */
.disciplina-item .custom-control-label {
    cursor: pointer;
    user-select: none;
    padding-left: 0.5rem;
    width: 100%;
}

/* Indicador visual customizado (antes/depois) */
.disciplina-item .custom-control-label::before {
    left: -2rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid #dee2e6;
    transition: all 0.15s ease-in-out;
}

.disciplina-item .custom-control-label::after {
    left: -2rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.25rem;
    height: 1.25rem;
}

/* Checkbox marcado - cor azul */
.disciplina-item .custom-checkbox .custom-control-input:checked~.custom-control-label::before {
    background-color: var(--see-blue, #007bff);
    border-color: var(--see-blue, #007bff);
}

/* Radio marcado - cor azul */
.disciplina-item .custom-radio .custom-control-input:checked~.custom-control-label::before {
    background-color: var(--see-blue, #007bff);
    border-color: var(--see-blue, #007bff);
}

/* Texto da disciplina */
.disciplina-item .font-weight-bold {
    font-size: 0.95rem;
    line-height: 1.4;
    color: #333;
}

.disciplina-item .text-muted {
    font-size: 0.85rem;
}

/* Badge de carga horária */
.disciplina-item .badge {
    font-size: 0.75rem;
    padding: 0.35rem 0.6rem;
    white-space: nowrap;
}

/* Scrollbar customizada */
.disciplinas-grid::-webkit-scrollbar {
    width: 8px;
}

.disciplinas-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.disciplinas-grid::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.disciplinas-grid::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Responsividade */
@media (max-width: 768px) {
    .disciplinas-grid {
        max-height: 400px;
    }

    .disciplina-item {
        min-height: 30px;
    }

    /* Em mobile, forçar 1 coluna */
    .disciplinas-grid .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Animação suave ao selecionar */
.disciplina-item {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Estado de foco acessível */
.disciplina-item .custom-control-input:focus~.custom-control-label::before {
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Melhorar alinhamento vertical */
.disciplina-item .d-flex {
    align-items: center;
}
