/**
 * biblioteca_planilha.atribuir.css
 *
 * Estilos customizados para a interface de atribuição de planilhas
 *
 * @requires AdminLTE 3.x
 * @requires Bootstrap 4.x
 */

/* ========================================
   Card de Preview
   ======================================== */

#card-preview {
    border-top: 3px solid #ffc107;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#card-preview .card-header {
    background-color: #fff3cd;
    border-bottom: 1px solid #ffc107;
}

#card-preview .card-title {
    color: #856404;
    font-weight: 600;
}

/* ========================================
   Tabela de Preview
   ======================================== */

#table-preview {
    margin-bottom: 0;
}

#table-preview thead {
    background-color: #f8f9fa;
}

#table-preview thead th {
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #495057;
    padding: 12px;
    vertical-align: middle;
}

#table-preview tbody tr {
    transition: background-color 0.2s ease;
}

#table-preview tbody tr:hover {
    background-color: #f8f9fa;
}

#table-preview tbody td {
    vertical-align: middle;
    padding: 12px;
}

/* Linha com warning (aluno sem zonas) */
#table-preview tbody tr.table-warning {
    background-color: #fff3cd;
}

#table-preview tbody tr.table-warning:hover {
    background-color: #ffe8a1;
}

/* ========================================
   Zonas Faltantes
   ======================================== */

.zonas-faltantes {
    font-size: 0.9rem;
}

.zonas-faltantes > div {
    padding: 8px;
    background-color: #fff;
    border-left: 3px solid #dc3545;
    margin-bottom: 8px;
}

.zonas-faltantes .btn-xs {
    font-size: 0.75rem;
    padding: 2px 8px;
}

/* ========================================
   Info Boxes Customizados
   ======================================== */

.info-box.bg-light {
    background-color: #f8f9fa !important;
    border: 1px solid #e9ecef;
}

.info-box.bg-light .info-box-icon {
    background-color: rgba(0, 123, 255, 0.1) !important;
    color: #007bff;
}

.info-box.bg-purple {
    background: linear-gradient(45deg, #6f42c1, #9370db) !important;
}

.info-box.bg-purple .info-box-icon {
    background-color: rgba(255, 255, 255, 0.2) !important;
}

/* ========================================
   Alertas do Preview
   ======================================== */

#preview-alerts .alert {
    border-left-width: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

#preview-alerts .alert h5 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
}

#preview-alerts .alert-warning {
    background-color: #fff3cd;
    border-left-color: #ffc107;
    color: #856404;
}

#preview-alerts .alert-success {
    background-color: #d4edda;
    border-left-color: #28a745;
    color: #155724;
}

/* ========================================
   Formulário de Atribuição
   ======================================== */

#form-atribuir .form-group label {
    font-weight: 600;
    color: #495057;
}

#form-atribuir .text-danger {
    color: #dc3545 !important;
}

#form-atribuir .form-text {
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* Select2 customizado */
.select2-container--bootstrap4 .select2-selection {
    min-height: 38px;
    border-color: #ced4da;
}

.select2-container--bootstrap4 .select2-selection:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Input de data */
input[type="date"].form-control {
    padding: 0.375rem 0.75rem;
}

/* ========================================
   Botões de Ação
   ======================================== */

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 500;
}

.btn-lg i {
    font-size: 1.2rem;
}

#btn-preview {
    transition: all 0.3s ease;
}

#btn-preview:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

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

#btn-confirmar {
    transition: all 0.3s ease;
}

#btn-confirmar:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

/* ========================================
   Modal de Processamento
   ======================================== */

#modal-processamento .modal-content {
    border: none;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

#modal-processamento .modal-body {
    padding: 3rem 2rem;
}

#modal-processamento .spinner-border {
    margin-bottom: 1.5rem;
}

#modal-processamento h4 {
    color: #007bff;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

#modal-processamento p {
    color: #6c757d;
    margin-bottom: 0;
}

/* ========================================
   Badges de Status
   ======================================== */

.badge {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.4em 0.8em;
}

.badge-success {
    background-color: #28a745;
}

.badge-warning {
    background-color: #ffc107;
    color: #212529;
}

.badge-danger {
    background-color: #dc3545;
}

/* ========================================
   Ícones de Status
   ======================================== */

.fa-check-circle.text-success {
    color: #28a745 !important;
}

.fa-exclamation-triangle.text-warning {
    color: #ffc107 !important;
}

.fa-times-circle.text-danger {
    color: #dc3545 !important;
}

/* ========================================
   Breadcrumbs
   ======================================== */

.breadcrumb {
    background-color: transparent;
    padding: 0;
    margin-bottom: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: #6c757d;
}

.breadcrumb-item a {
    color: #007bff;
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: #0056b3;
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: #6c757d;
}

/* ========================================
   Animações
   ======================================== */

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#card-preview {
    animation: fadeInDown 0.5s ease;
}

/* ========================================
   Responsividade
   ======================================== */

@media (max-width: 768px) {
    /* Ajustes para mobile */

    .info-box .info-box-number {
        font-size: 1.2rem !important;
    }

    .info-box .info-box-text {
        font-size: 0.85rem;
    }

    #table-preview {
        font-size: 0.9rem;
    }

    #table-preview thead th,
    #table-preview tbody td {
        padding: 8px;
    }

    .btn-lg {
        padding: 0.5rem 1rem;
        font-size: 1rem;
    }

    .zonas-faltantes {
        font-size: 0.85rem;
    }

    /* Esconder colunas menos importantes em mobile */
    #table-preview thead th:first-child,
    #table-preview tbody td:first-child {
        display: none;
    }
}

@media (max-width: 576px) {
    /* Ajustes adicionais para telas muito pequenas */

    .content-header h1 {
        font-size: 1.5rem;
    }

    .card-title {
        font-size: 1.1rem;
    }

    .info-box {
        margin-bottom: 1rem;
    }

    #preview-alerts .alert {
        font-size: 0.9rem;
    }
}

/* ========================================
   Impressão
   ======================================== */

@media print {
    /* Esconder elementos desnecessários */
    .breadcrumb,
    .btn,
    #btn-preview,
    #btn-editar,
    #btn-confirmar,
    .card-tools,
    #modal-processamento {
        display: none !important;
    }

    /* Ajustar layout para impressão */
    #card-preview,
    .card {
        border: 1px solid #000;
        box-shadow: none;
        page-break-inside: avoid;
    }

    /* Cores para impressão */
    .alert-warning {
        border: 2px solid #000 !important;
    }

    .alert-success {
        border: 2px solid #000 !important;
    }
}

/* ========================================
   Acessibilidade
   ======================================== */

/* Foco visível para navegação por teclado */
.btn:focus,
.form-control:focus,
.select2-container--bootstrap4.select2-container--focus .select2-selection {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Melhor contraste para textos */
.text-muted {
    color: #6c757d !important;
}

/* Links acessíveis */
a:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* ========================================
   Utilitários
   ======================================== */

/* Espaçamento adicional */
.mt-4 {
    margin-top: 1.5rem !important;
}

.mb-4 {
    margin-bottom: 1.5rem !important;
}

/* Bordas arredondadas */
.rounded-lg {
    border-radius: 0.5rem !important;
}

/* Sombras */
.shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

.shadow {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* ========================================
   Estados de Loading
   ======================================== */

.swal2-container.swal2-loading .swal2-popup {
    border: 2px solid #007bff;
}

.swal2-container .swal2-loader {
    border-color: #007bff transparent #007bff transparent;
}

/* ========================================
   Customizações do SweetAlert2
   ======================================== */

.swal2-popup {
    border-radius: 8px;
    font-family: inherit;
}

.swal2-title {
    color: #495057;
    font-weight: 600;
}

.swal2-html-container {
    color: #6c757d;
}

.swal2-confirm {
    background-color: #28a745 !important;
    border-color: #28a745 !important;
}

.swal2-confirm:focus {
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.5) !important;
}

.swal2-cancel {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
}

.swal2-cancel:focus {
    box-shadow: 0 0 0 3px rgba(108, 117, 125, 0.5) !important;
}
