/* V5 A2 */

/* Estilos para Plugin de Preferencias Educativas - 4° Semestre */

#educational-preferences-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e5e9;
}

/* Introducción actualizada */
.preferences-intro {
    background: linear-gradient(135deg, #611232 0%, #9b2247 100%);
    color: white;
    padding: 25px 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    text-align: center;
    position: relative;
}

.preferences-intro::before {
    content: '🎓';
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 30px;
    opacity: 0.7;
}

.preferences-intro p {
    margin: 0 0 10px 0;
    font-size: 16px;
    line-height: 1.6;
}

.preferences-intro p:first-child {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 15px;
}

/* Pasos del formulario */
.form-step {
    margin-bottom: 35px;
    animation: fadeInUp 0.6s ease;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 700;
    color: #2c3e50;
    font-size: 18px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    box-sizing: border-box;
    background-color: #fff;
    font-family: inherit;
}

/* Selects mejorados para opciones más largas */
.form-group select {
    padding: 18px 20px;
    line-height: 1.4;
    min-height: 55px;
}

.form-group select option {
    padding: 10px;
    line-height: 1.4;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

/* Botón de validar CURP */
#validate-curp-btn {
     background: linear-gradient(135deg, #611232 0%, #9b2247 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 15px;
    transition: all 0.3s ease;
    min-width: 150px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#validate-curp-btn:hover {
    background: linear-gradient(135deg, #9b2247, #611232);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

#validate-curp-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Mensajes de validación mejorados */
.message {
    padding: 18px 25px;
    border-radius: 12px;
    margin-top: 15px;
    font-weight: 600;
    font-size: 16px;
    display: none;
    border-left: 5px solid;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border-left-color: #28a745;
}

.message.success::before {
    content: '✅';
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border-left-color: #dc3545;
}

.message.error::before {
    content: '❌';
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
}

.message.warning {
    background-color: #fff3cd;
    color: #856404;
    border-left-color: #ffc107;
}

.message.warning::before {
    content: '⚠️';
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
}

.message.success,
.message.error,
.message.warning {
    padding-left: 50px;
}

/* Información del estudiante */
.student-info-display {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 35px;
    border-left: 6px solid #667eea;
    position: relative;
    overflow: hidden;
}

.student-info-display::before {
    content: '👤';
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 40px;
    opacity: 0.3;
}

.student-info-display::after {
    content: '4° SEMESTRE';
    position: absolute;
    top: 10px;
    left: 10px;
    background: #667eea;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.student-info-display h3 {
    margin-top: 0;
    margin-bottom: 25px;
    color: #667eea;
    font-size: 24px;
    font-weight: 700;
}

.student-info-display p {
    margin: 12px 0;
    font-size: 16px;
    line-height: 1.6;
}

.student-info-display strong {
    color: #2c3e50;
    font-weight: 700;
    display: inline-block;
    min-width: 160px;
}

/* Preferencias existentes */
.existing-preferences {
    background: #fff3cd;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 30px;
    border-left: 6px solid #ffc107;
    position: relative;
}

.existing-preferences::before {
    content: '📝';
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 30px;
    opacity: 0.5;
}

.existing-preferences h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #856404;
    font-size: 20px;
    font-weight: 700;
}

.current-prefs p {
    margin: 12px 0;
    font-size: 16px;
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    border-left: 4px solid #ffc107;
    line-height: 1.5;
}

.current-prefs strong {
    color: #856404;
    font-weight: 700;
    display: block;
    margin-bottom: 5px;
}

.current-prefs small {
    color: #6c757d;
    font-style: italic;
}

/* Selección de preferencias mejorada */
.preferences-selection {
    background: #f8f9fa;
    padding: 35px;
    border-radius: 15px;
    margin-bottom: 35px;
    border: 2px solid #e9ecef;
    position: relative;
}

.preferences-selection::before {
    content: '🎯';
    position: absolute;
    top: 25px;
    right: 30px;
    font-size: 35px;
    opacity: 0.4;
}

.preferences-selection::after {
    content: 'NUEVAS ÁREAS EDUCATIVAS';
    position: absolute;
    top: 10px;
    left: 15px;
    background: #28a745;
    color: white;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.preferences-selection h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #667eea;
    font-size: 24px;
    font-weight: 700;
}

.preferences-selection .instruction {
    margin-bottom: 30px;
    color: #6c757d;
    font-size: 16px;
    font-style: italic;
    text-align: center;
    padding: 18px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 12px;
    border: 2px dashed rgba(102, 126, 234, 0.3);
}

.preference-group {
    margin-bottom: 30px;
    position: relative;
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.preference-group:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.preference-group label {
    font-size: 20px;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.preference-group select {
    background-color: white;
    font-size: 16px;
    padding: 20px;
    border: 3px solid #e9ecef;
    transition: all 0.3s ease;
    border-radius: 12px;
    min-height: 60px;
    line-height: 1.4;
}

.preference-group select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.preference-group select.selected {
    animation: selectPulse 0.4s ease;
}

@keyframes selectPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); box-shadow: 0 0 0 8px rgba(102, 126, 234, 0.2); }
    100% { transform: scale(1); }
}

/* Texto de ayuda mejorado */
.help-text {
    display: block;
    color: #6c757d;
    font-size: 13px;
    margin-top: 8px;
    font-style: italic;
    animation: fadeIn 0.3s ease;
    padding: 8px 12px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 8px;
    border-left: 3px solid #667eea;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Acciones del formulario */
.form-actions {
    text-align: center;
    padding: 40px 0;
    border-top: 3px solid #e9ecef;
    margin-top: 40px;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border-radius: 15px;
}

.form-actions button {
    padding: 20px 40px;
    font-size: 18px;
    font-weight: 700;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    margin: 0 15px;
    transition: all 0.3s ease;
    min-width: 220px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

#save-preferences-btn {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

#save-preferences-btn:hover {
    background: linear-gradient(135deg, #218838, #1fa888);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(40, 167, 69, 0.4);
}

#generate-pdf-btn {
    background: linear-gradient(135deg, #dc3545, #fd7e14);
    color: white;
}

#generate-pdf-btn:hover {
    background: linear-gradient(135deg, #c82333, #e8590c);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(220, 53, 69, 0.4);
}

.form-actions button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Títulos principales */
h3 {
    color: #2c3e50;
    font-size: 22px;
    font-weight: 700;
    margin: 35px 0 25px 0;
    padding-bottom: 15px;
    border-bottom: 3px solid #667eea;
    position: relative;
}

/* Animaciones mejoradas */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Estados de carga */
.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 20px;
    width: 24px;
    height: 24px;
    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); }
}

/* Indicador de 4° semestre */
.semester-badge {
    display: inline-block;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 0.5px;
    margin-left: 10px;
    text-transform: uppercase;
}

/* Responsive Design mejorado */
@media (max-width: 768px) {
    #educational-preferences-container {
        padding: 20px;
        margin: 10px;
        border-radius: 10px;
    }
    
    .preferences-intro {
        padding: 20px;
        font-size: 14px;
    }
    
    .preferences-intro::before {
        display: none;
    }
    
    .form-group input,
    .form-group select {
        font-size: 16px; /* Previene zoom en iOS */
        padding: 15px;
        min-height: 50px;
    }
    
    .student-info-display,
    .preferences-selection {
        padding: 20px;
    }
    
    .student-info-display::after,
    .preferences-selection::after {
        position: static;
        display: block;
        margin-bottom: 15px;
        text-align: center;
    }
    
    .student-info-display strong {
        min-width: auto;
        display: block;
        margin-bottom: 5px;
    }
    
    .preference-group {
        padding: 20px 15px;
        margin-bottom: 25px;
    }
    
    .preference-group::before {
        position: static;
        display: block;
        margin: 0 auto 15px auto;
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .form-actions {
        padding: 25px 15px;
    }
    
    .form-actions button {
        width: 100%;
        margin: 10px 0;
        min-width: auto;
        font-size: 16px;
        padding: 18px 20px;
    }
    
    .preferences-selection::before,
    .student-info-display::before,
    .existing-preferences::before {
        display: none;
    }
}

@media (max-width: 480px) {
    #educational-preferences-container {
        padding: 15px;
    }
    
    h3 {
        font-size: 18px;
    }
    
    .form-group label {
        font-size: 16px;
    }
    
    .preference-group label {
        font-size: 18px;
    }
    
    .preference-group select {
        font-size: 15px;
        padding: 15px;
    }
    
    .current-prefs p {
        padding: 10px 15px;
    }
}

/* Mejoras de accesibilidad */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode support (opcional) */
@media (prefers-color-scheme: dark) {
    #educational-preferences-container {
        background: #2d3748;
        color: #e2e8f0;
        border-color: #4a5568;
    }
    
    .student-info-display,
    .preferences-selection {
        background: #4a5568;
        color: #e2e8f0;
    }
    
    .preference-group {
        background: #4a5568;
        border-color: #718096;
    }
}