/**
 * Estilos del Módulo de Evaluaciones
 * Fase 3.1 - Sistema de Evaluaciones
 */

/* ===== VARIABLES ===== */
:root {
    --eval-primary: rgb(250 204 21);
    --eval-secondary: #000000;
    --eval-success: #10B981;
    --eval-error: #EF4444;
    --eval-warning: #F59E0B;
}

/* ===== CARDS DE EVALUACIÓN ===== */
.eval-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
}

.eval-card:hover {
    transform: translateY(-4px);
    border-color: var(--eval-primary);
}

/* ===== ANIMACIONES ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ===== LOADING SPINNER ===== */
.eval-spinner {
    border: 3px solid rgba(252, 211, 77, 0.3);
    border-radius: 50%;
    border-top-color: var(--eval-primary);
    width: 40px;
    height: 40px;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== CAMPOS DE FORMULARIO ===== */
.eval-form-field {
    transition: all 0.2s ease;
}

.eval-form-field:focus {
    border-color: var(--eval-primary);
    box-shadow: 0 0 0 3px rgba(252, 211, 77, 0.1);
    outline: none;
}

.eval-form-field.error {
    border-color: var(--eval-error);
}

.eval-form-field.error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* ===== MENSAJES DE ERROR ===== */
.error-message {
    color: var(--eval-error);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: flex;
    align-items-center;
}

.error-message::before {
    content: "⚠️";
    margin-right: 0.5rem;
}

/* ===== NOTIFICACIONES ===== */
.eval-notification {
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
    animation: slide-in-right 0.3s ease-out;
}

@keyframes slide-in-right {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.eval-notification.success {
    background-color: #D1FAE5;
    border-color: var(--eval-success);
    color: #065F46;
}

.eval-notification.error {
    background-color: #FEE2E2;
    border-color: var(--eval-error);
    color: #991B1B;
}

.eval-notification.warning {
    background-color: #FEF3C7;
    border-color: var(--eval-warning);
    color: #92400E;
}

/* ===== BADGES ===== */
.eval-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.eval-badge.conocimiento {
    background-color: rgba(252, 211, 77, 0.1);
    color: var(--eval-secondary);
}

.eval-badge.diagnostico {
    background-color: rgba(30, 41, 59, 0.1);
    color: var(--eval-secondary);
}

.eval-badge.cumplimiento {
    background-color: rgba(16, 185, 129, 0.1);
    color: #065F46;
}

/* ===== BOTONES ===== */
.eval-btn {
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.eval-btn:active {
    transform: scale(0.98);
}

.eval-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.eval-btn.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.6s linear infinite;
}

/* ===== PROGRESS BAR ===== */
.eval-progress-bar {
    height: 8px;
    background-color: #E5E7EB;
    border-radius: 9999px;
    overflow: hidden;
}

.eval-progress-fill {
    height: 100%;
    background-color: var(--eval-primary);
    transition: width 0.3s ease;
}

/* ===== TOOLTIPS ===== */
.eval-tooltip {
    position: relative;
}

.eval-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 0.75rem;
    background-color: var(--eval-secondary);
    color: white;
    font-size: 0.75rem;
    border-radius: 0.375rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    margin-bottom: 0.5rem;
}

.eval-tooltip:hover::after {
    opacity: 1;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
    .eval-notification {
        left: 20px;
        right: 20px;
        max-width: none;
    }
    
    .eval-card {
        margin-bottom: 1rem;
    }
}

/* ===== ACCESSIBILITY ===== */
.eval-form-field:focus-visible,
.eval-btn:focus-visible {
    outline: 2px solid var(--eval-primary);
    outline-offset: 2px;
}

/* ===== PRINT STYLES ===== */
@media print {
    .eval-notification,
    .eval-btn {
        display: none;
    }
}

/* ===== DARK MODE SUPPORT (futuro) ===== */
@media (prefers-color-scheme: dark) {
    /* Estilos para modo oscuro si se implementa */
}

/* =====================================================
   CORRECCIÓN: Botones visibles en tarjetas
   ===================================================== */

/* Todos los botones de evaluación con fondo amarillo */
.eval-btn-start,
button[onclick^="iniciarEvaluacion"] {
/*    background-color: var(--eval-primary-low) !important; */ 
	@apply bg-yellow-300;
    color: var(--eval-secondary) !important; 
}

/* Hover effect */
.eval-btn-start:hover,
button[onclick^="iniciarEvaluacion"]:hover {
    background-color: var(--eval-primary) !important; 
/*    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(252, 211, 77, 0.4); */
}

/* Iconos del botón también en negro */
.eval-card button i,
.eval-btn-start i {
    color: var(--eval-secondary) !important;
}

/* =====================================================
   CORRECCIÓN: Margen superior adecuado
   ===================================================== */

/* Aumentar padding superior en todas las secciones */
section.py-20 {
    padding-top: 8rem !important; /* ~128px */
    padding-bottom: 5rem !important; /* Mantener original */
}

/* Header del contenido con margen adicional */
.eval-header,
.page-header,
section#evaluaciones-main > div:first-child {
    margin-top: 2rem;
}

/* Responsive: Ajustar en móviles */
@media (max-width: 768px) {
    section.py-20 {
        padding-top: 6rem !important; /* Menos en móviles */
    }
}

/* Tablets */
@media (min-width: 769px) and (max-width: 1024px) {
    section.py-20 {
        padding-top: 7rem !important;
    }
}

/* =====================================================
   MODAL DE COMPARTIR EVALUACIÓN
   ===================================================== */

#shareModal {
    animation: fadeIn 0.3s ease;
}

#shareModal > div {
    animation: slideUp 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Botones de redes sociales */
#shareModal button[onclick^="compartirEn"] {
    transition: all 0.2s ease;
}

#shareModal button[onclick^="compartirEn"]:hover {
    transform: translateY(-2px);
}

/* Input de URL */
#shareURL {
    user-select: all;
}

#shareURL:focus {
    outline: none;
    border-color: #FCD34D;
}

/* Modal de evaluación compartida (bienvenida) */
#modalEvaluacionCompartida {
    animation: fadeIn 0.3s ease;
}

#modalEvaluacionCompartida > div {
    animation: slideUp 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

/* Responsive */
@media (max-width: 640px) {
    #shareModal > div,
    #modalEvaluacionCompartida > div {
        max-width: 95%;
        padding: 1.5rem;
    }
    
    #shareModal .grid-cols-5 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Botón Compartir - Color Gris Fijo */
.eval-btn-compartir {
    background-color: #E5E5E5 !important;
    color: #374151 !important; /* text-gray-700 */
    border: none !important;
}

.eval-btn-compartir:hover {
    background-color: #D6D6D6 !important;
}