/* css/opti-companion.css */
/* Estilos para el Compañero de Ventas Inteligente OptiSmart */
:root {
    --companion-primary: #6366f1;
    --companion-secondary: #ec4899;
    --companion-accent: #8b5cf6;
    --companion-dark: #1e293b;
    --companion-light: #f8fafc;
    --companion-glass: rgba(255, 255, 255, 0.95);
}

/* Botón flotante de análisis (se inyectará cerca de la fórmula) */
.opti-analyze-btn {
    background: linear-gradient(135deg, var(--companion-primary), var(--companion-accent));
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    transition: all 0.3s ease;
    animation: pulse-glow 2s infinite;
}

.opti-analyze-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

@keyframes pulse-glow {
    0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(99, 102, 241, 0); }
    100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}

/* Modal del Compañero */
.companion-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    /* removed backdrop-filter */
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.companion-modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.companion-content {
    background: white;
    width: 90%;
    max-width: 900px;
    height: 90vh; /* Aumentado ligeramente para acomodar mas contenido */
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.companion-modal-overlay.active .companion-content {
    transform: scale(1);
}

/* Header Premium */
.companion-header {
    background: linear-gradient(135deg, #1e1b4b, #312e81);
    padding: 20px 30px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.companion-header::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(99,102,241,0.4) 0%, rgba(0,0,0,0) 70%);
    border-radius: 50%;
    pointer-events: none;
}

.companion-title {
    font-size: 1.5rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 12px;
}

.companion-subtitle {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: 4px;
}

.companion-close {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    z-index: 2;
}

.companion-close:hover {
    background: rgba(255,255,255,0.2);
}

/* Layout Principal */
.companion-body {
    flex: 1;
    display: grid;
    grid-template-columns: 350px 1fr;
    overflow: hidden;
}

/* Sidebar de Diagnóstico */
.companion-sidebar {
    background: #f8fafc;
    padding: 25px;
    border-right: 1px solid #e2e8f0;
    overflow-y: auto;
}

.diagnosis-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    border: 1px solid #f1f5f9;
}

.diagnosis-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #64748b;
    font-weight: 700;
    margin-bottom: 12px;
}

.rx-summary {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.rx-eye {
    flex: 1;
    background: #f1f5f9;
    padding: 10px;
    border-radius: 10px;
    text-align: center;
}

.rx-eye.od { border-left: 3px solid var(--companion-primary); }
.rx-eye.os { border-left: 3px solid var(--companion-secondary); }

.rx-val { font-weight: 700; color: #334155; font-size: 1.1rem; }
.rx-label { font-size: 0.7rem; color: #94a3b8; }

/* Visualizador de Lente */
.lens-simulator {
    width: 100%;
    height: 180px;
    background: #e2e8f0;
    border-radius: 12px;
    position: relative;
    margin-top: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.simulated-lens {
    width: 80%;
    height: 20px; /* Base thickness */
    background: rgba(148, 163, 184, 0.5);
    border-radius: 50% / 10%;
    position: relative;
    box-shadow: inset 0 0 20px rgba(255,255,255,0.5);
    transition: all 0.5s ease;
}

.simulated-lens::before {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 100%; height: 100%;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(255,255,255,0.8);
    border-radius: inherit;
}

/* Área de Recomendaciones */
.companion-main {
    padding: 30px;
    overflow-y: auto;
    background: #ffffff;
}

/* LIFESTYLE STYLES (NUEVO) */
.lifestyle-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.lifestyle-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #f1f5f9;
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 15px 10px;
    color: #64748b;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lifestyle-btn:hover {
    background: #e2e8f0;
    transform: translateY(-2px);
}

.lifestyle-btn.active {
    background: #eff6ff;
    border-color: var(--companion-primary);
    color: var(--companion-primary);
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.2);
}

.lifestyle-btn .material-symbols-outlined {
    font-size: 28px;
}

/* --- FIN LIFESTYLE --- */

.rec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.rec-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    border: 2px solid #f1f5f9;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.rec-card:hover {
    border-color: var(--companion-primary);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px -10px rgba(99, 102, 241, 0.3);
}

.rec-card.selected {
    border-color: var(--companion-primary);
    background: #eff6ff;
}

.rec-card.selected::after {
    content: '✅';
    position: absolute;
    top: 10px; right: 10px;
    font-size: 1.2rem;
}

.rec-icon {
    width: 40px; height: 40px;
    background: #e0e7ff;
    color: var(--companion-primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.rec-title {
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 6px;
    font-size: 1.1rem;
}

.rec-desc {
    font-size: 0.9rem;
    color: #64748b;
    line-height: 1.5;
}

.sales-script-box {
    background: linear-gradient(135deg, #fff1f2 0%, #fff 100%);
    border: 1px dashed #f43f5e;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.script-title {
    color: #e11d48;
    font-weight: 700;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.script-text {
    font-style: italic;
    color: #475569;
    font-size: 1.05rem;
    line-height: 1.6;
}

/* Modo Comparación */
.comparison-view {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.lens-option {
    text-align: center;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
}

.lens-visual {
    height: 100px;
    margin-bottom: 10px;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    position: relative;
}

.lens-blur { filter: blur(4px); }
.lens-clear { filter: blur(0); }

/* Botones de Acción */
.action-bar {
    padding: 20px 30px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.btn-companion {
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary { background: white; border: 1px solid #cbd5e1; color: #64748b; }
.btn-secondary:hover { background: #f1f5f9; color: #334155; }

.btn-primary-comp {
    background: linear-gradient(135deg, var(--companion-primary), var(--companion-accent));
    color: white;
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.3);
}

.btn-primary-comp:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.4);
}
