/**
 * CSS do Modal de Cadastro de Turma
 * Padrão moderno e responsivo
 */

/* ===========================
   HEADER DO MODAL
   =========================== */
.turma-modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom: none;
    border-radius: 0.25rem 0.25rem 0 0;
    padding: 1rem 1.5rem;
}

.turma-modal-header .modal-title {
    font-weight: 600;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.turma-modal-header .modal-title i {
    font-size: 1.1rem;
    opacity: 0.9;
}

.turma-modal-header .close {
    color: white;
    opacity: 0.8;
    text-shadow: none;
    font-size: 1.5rem;
    transition: all 0.2s ease;
}

.turma-modal-header .close:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* ===========================
   BODY DO MODAL
   =========================== */
.turma-modal-body {
    padding: 1.5rem;
    max-height: 70vh;
    overflow-y: auto;
    background: #f8f9fa;
}

/* Scroll customizado */
.turma-modal-body::-webkit-scrollbar {
    width: 6px;
}

.turma-modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.turma-modal-body::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 3px;
}

.turma-modal-body::-webkit-scrollbar-thumb:hover {
    background: #5a6fd8;
}

/* ===========================
   SEÇÕES DO FORMULÁRIO
   =========================== */
.form-section {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.form-section:hover {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    border-color: #667eea;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title i {
    color: #667eea;
    font-size: 1rem;
}

/* ===========================
   CAMPOS DO FORMULÁRIO
   =========================== */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-control {
    border-radius: 6px;
    border: 1px solid #ced4da;
    padding: 0.75rem;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    background-color: #fff;
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    background-color: #fff;
}

.form-control.is-invalid {
    border-color: #dc3545;
    background-image: none;
}

.form-control.is-invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* ===========================
   INPUT GROUPS
   =========================== */
.input-group-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: 1px solid #667eea;
    font-weight: 500;
    border-radius: 6px 0 0 6px;
}

.input-group .form-control {
    border-left: none;
    border-radius: 0 6px 6px 0;
}

.input-group .form-control:focus {
    border-color: #667eea;
    border-left: 1px solid #667eea;
}

.input-group-append .input-group-text {
    border-radius: 0 6px 6px 0;
    border-left: none;
}

/* ===========================
   VALIDAÇÃO
   =========================== */
.invalid-feedback {
    display: block;
    font-size: 0.8rem;
    color: #dc3545;
    margin-top: 0.25rem;
    font-weight: 500;
}

.was-validated .form-control:valid {
    border-color: #28a745;
    background-image: none;
}

.was-validated .form-control:valid:focus {
    border-color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

/* ===========================
   LINK DE INSCRIÇÃO
   =========================== */
.alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    border: 1px solid #b8daff;
    border-left: 4px solid #17a2b8;
    border-radius: 8px;
    padding: 1rem;
}

.alert-info strong {
    color: #0c5460;
}

.alert-info p {
    color: #0c5460;
    margin-bottom: 0.5rem;
}

/* Botões do link */
.input-group-append .btn {
    border-radius: 0 6px 6px 0;
    padding: 0.75rem 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.input-group-append .btn:not(:last-child) {
    border-radius: 0;
    border-right: none;
}

.input-group-append .btn:hover {
    transform: translateY(-1px);
}

.input-group-append .btn-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border-color: #007bff;
}

.input-group-append .btn-success {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    border-color: #28a745;
}

/* ===========================
   FOOTER DO MODAL
   =========================== */
.turma-modal-footer {
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 1rem 1.5rem;
    border-radius: 0 0 0.25rem 0.25rem;
}

.turma-modal-footer .btn {
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.turma-modal-footer .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.turma-modal-footer .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
}

.turma-modal-footer .btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    border-color: #6c757d;
}

.turma-modal-footer .btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    border-color: #dc3545;
}

.turma-modal-footer .btn-light {
    background: #f8f9fa;
    border-color: #f8f9fa;
    color: #6c757d;
}

.turma-modal-footer .btn-light:hover {
    background: #e2e6ea;
    border-color: #dae0e5;
    color: #495057;
}

/* ===========================
   COMPONENTES INTERNOS
   =========================== */

/* Ajustes para componente de produto */
.form-section .produto-container,
.form-section .funcionario-container {
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

/* Ajustes para date-field */
.form-section .date-field-container {
    margin-bottom: 0;
}

.form-section .date-field-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

/* ===========================
   RESPONSIVIDADE
   =========================== */
@media (max-width: 768px) {
    .turma-modal-body {
        padding: 1rem;
        max-height: 75vh;
    }
    
    .form-section {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .section-title {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
    
    .turma-modal-footer {
        padding: 1rem;
    }
    
    .turma-modal-footer .d-flex {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .turma-modal-footer .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Ajustar colunas em mobile */
    .row .col-md-4,
    .row .col-md-6,
    .row .col-md-2 {
        margin-bottom: 1rem;
    }
}

@media (max-width: 576px) {
    .turma-modal-header {
        padding: 0.75rem 1rem;
    }
    
    .turma-modal-header .modal-title {
        font-size: 1.1rem;
    }
    
    .input-group-append .btn {
        padding: 0.75rem 0.75rem;
        font-size: 0.9rem;
    }
}

/* ===========================
   ANIMAÇÕES E EFEITOS
   =========================== */
.form-section {
    animation: slideUpFade 0.3s ease;
}

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

/* Efeito hover nos campos */
.form-control:hover:not(:focus) {
    border-color: #adb5bd;
}

/* Loading state */
.turma-modal-body.loading {
    opacity: 0.7;
    pointer-events: none;
}

.turma-modal-body.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
} 