/* ================================================
   FACIALTEC - ESTILOS DE RESULTADOS PROFESIONALES
   Agregar después de styles.css en index.php
   ================================================ */

/* ================================================
   BOTÓN DE INFORMACIÓN (i)
   ================================================ */
.metric-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.info-btn {
    width: 22px;
    height: 22px;
    min-width: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(154, 108, 255, 0.15), rgba(154, 108, 255, 0.05));
    border: 1px solid rgba(154, 108, 255, 0.3);
    color: #9a6cff;
    font-size: 11px;
    font-weight: 700;
    font-style: italic;
    font-family: Georgia, serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
}

.info-btn:hover {
    background: linear-gradient(135deg, #9a6cff, #7c4dff);
    color: white;
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(154, 108, 255, 0.4);
}

/* ================================================
   BARRA DE NIVEL TIPO SEMÁFORO
   ================================================ */
.level-bar-wrapper {
    margin-top: 12px;
}

.level-bar {
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, 
        #ef4444 0%,      /* Rojo - Muy Bajo */
        #f97316 16%,     /* Naranja */
        #fbbf24 33%,     /* Amarillo */
        #a3e635 50%,     /* Lima */
        #22c55e 66%,     /* Verde */
        #10b981 83%,     /* Esmeralda */
        #059669 100%     /* Verde oscuro - Excelente */
    );
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
    border: 1px solid rgba(0,0,0,0.05);
}

.level-indicator {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background: white;
    border: 3px solid #333;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    z-index: 2;
    transition: left 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.level-indicator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background: #333;
    border-radius: 50%;
}

.level-bar-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    padding: 0 2px;
}

.level-bar-labels span {
    font-size: 7px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.2px;
}

/* ================================================
   MODAL DE INFORMACIÓN EDUCATIVA
   ================================================ */
.info-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.info-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.info-modal {
    background: white;
    border-radius: 20px;
    max-width: 480px;
    width: 100%;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0,0,0,0.35);
    transform: scale(0.9) translateY(30px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.info-modal-overlay.active .info-modal {
    transform: scale(1) translateY(0);
}

.info-modal-header {
    background: linear-gradient(135deg, #9a6cff, #7c4dff);
    padding: 18px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.info-modal-header h3 {
    color: white;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.info-modal-header h3 i {
    font-size: 18px;
}

.info-modal-close {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.info-modal-close:hover {
    background: rgba(255,255,255,0.3);
    transform: rotate(90deg);
}

.info-modal-body {
    padding: 22px;
    overflow-y: auto;
    max-height: calc(85vh - 70px);
}

.info-section {
    margin-bottom: 20px;
}

.info-section:last-child {
    margin-bottom: 0;
}

.info-section h4 {
    font-size: 13px;
    font-weight: 700;
    color: #9a6cff;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(154, 108, 255, 0.1);
}

.info-section h4 i {
    font-size: 14px;
}

.info-section p {
    font-size: 13px;
    color: #555;
    line-height: 1.7;
    margin: 0;
}

/* Tabla de niveles en el modal */
.info-levels {
    background: linear-gradient(135deg, #f8f9fa, #f1f5f9);
    border-radius: 12px;
    padding: 14px;
    border: 1px solid #e5e7eb;
}

.info-level-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.info-level-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.info-level-item:first-child {
    padding-top: 0;
}

.info-level-range {
    width: 60px;
    font-size: 12px;
    font-weight: 700;
    color: #333;
    flex-shrink: 0;
}

.info-level-bar {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.info-level-desc {
    flex: 1;
    font-size: 12px;
    color: #555;
}

/* ================================================
   MEJORAS EN MÉTRICAS
   ================================================ */
.metric-item {
    background: white;
    border: 1px solid rgba(154, 108, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.metric-item:hover {
    border-color: rgba(154, 108, 255, 0.25);
    box-shadow: 0 4px 15px rgba(154, 108, 255, 0.1);
    transform: translateX(3px);
}

.metric-item:last-child {
    margin-bottom: 0;
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
}

.metric-label {
    font-size: 11px;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-score {
    font-size: 15px;
    font-weight: 700;
}

.metric-value {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
    margin-bottom: 4px;
}

.metric-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 11px;
    color: #9a6cff;
    margin-bottom: 4px;
}

.metric-meta i {
    font-size: 10px;
}

.metric-zona,
.metric-cantidad {
    display: flex;
    align-items: center;
    gap: 4px;
}

.metric-severidad {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.severity-badge-leve {
    background: rgba(34, 197, 94, 0.15);
    color: #16a34a;
}

.severity-badge-moderada {
    background: rgba(251, 191, 36, 0.15);
    color: #d97706;
}

.severity-badge-severa {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 600px) {
    .info-modal {
        margin: 10px;
        max-height: 90vh;
        border-radius: 16px;
    }
    
    .info-modal-header {
        padding: 16px 18px;
    }
    
    .info-modal-header h3 {
        font-size: 15px;
    }
    
    .info-modal-body {
        padding: 18px;
    }
    
    .level-bar-labels span {
        font-size: 6px;
    }
    
    .metric-item {
        padding: 14px;
    }
}

/* ================================================
   PRINT / PDF
   ================================================ */
@media print {
    .info-btn,
    .info-modal-overlay {
        display: none !important;
    }
    
    .level-bar {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    .metric-item {
        break-inside: avoid;
    }
}