@import "../lopd-ia/styles.css";

/* ── ESTILOS ESPECÍFICOS DEL INTERRUPTÓMETRO (PÁGINA ÚNICA) ── */

/* Override max-height limit from lopd-ia styles for our single-page layout */
.calculator-card {
    max-height: none !important;
    display: block !important;
}

/* ── ODÓMETRO STICKY (Siempre visible al hacer scroll) ── */
.odometer-wrapper {
    background: #0f172a;
    color: #fff;
    padding: 1rem 0.75rem;
    border-radius: 0 0 16px 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: none;
    text-align: center;
    box-shadow: 0 15px 35px rgba(0, 107, 240, 0.15);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: box-shadow 0.3s ease;
}
.odometer-wrapper.is-stuck {
    border-radius: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}
.odometer-wrapper::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--danger-color), var(--warning-color));
}
.odo-header-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.75rem;
}
.odo-period-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.6rem 0.4rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.odo-period-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    font-weight: 700;
    margin-bottom: 0.2rem;
}
.odo-period-item .money {
    font-size: 1.25rem;
    font-weight: 800;
    color: #22c55e;
    font-family: monospace;
    margin-bottom: 0.1rem;
}
.odo-period-item .hours {
    font-size: 0.9rem;
    font-weight: 700;
    color: #38bdf8;
    font-family: monospace;
}

/* ── SLIDERS Y VARIABLES ── */
.slider-group {
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}
.slider-group.hidden {
    display: none !important;
}
.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}
.slider-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-dark);
}
.slider-bubble {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--primary-color);
    background: rgba(0, 107, 240, 0.08);
    padding: 2px 10px;
    border-radius: 20px;
}
.input-slider {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 999px;
    outline: none;
    -webkit-appearance: none;
    accent-color: var(--primary-color);
}

/* Texto aclaratorio debajo de cada slider de canal */
.slider-hint {
    font-size: 0.68rem;
    color: var(--text-light);
    font-style: italic;
    line-height: 1.3;
    margin-top: 0.35rem;
    padding-left: 2px;
}

/* ── PASO 4: Secciones de canal diferenciadas ── */
.channel-slider-section {
    padding: 1.25rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}
.channel-slider-section.calls-section {
    background: rgba(0, 107, 240, 0.02);
    border-left: 3px solid var(--primary-color);
}
.channel-slider-section.mail-section {
    background: rgba(245, 158, 11, 0.02);
    border-left: 3px solid var(--warning-color);
}
.channel-slider-section.chat-section {
    background: rgba(34, 197, 94, 0.02);
    border-left: 3px solid var(--success-color);
}
.channel-slider-section .slider-group {
    margin-bottom: 0.5rem;
}

/* ── TOGGLES DE SELECCIÓN DE CANALES (3 Columnas Verticales) ── */
.channels-toggle-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
    margin-top: 0.5rem;
}
.channel-toggle-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    background: var(--bg-white);
    border: 1.5px solid var(--border-color);
    padding: 1rem 0.75rem;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
    min-height: 140px;
    box-shadow: var(--shadow-sm);
}
.channel-toggle-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
}
.channel-toggle-item .channel-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-dark);
}
.channel-toggle-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    cursor: pointer;
    margin: 0;
}
.channel-toggle-item:hover {
    border-color: var(--primary-color);
    background-color: rgba(0, 107, 240, 0.02);
}
.channel-toggle-item.active {
    border-color: var(--primary-color);
    background: rgba(0, 107, 240, 0.04);
    color: var(--primary-color);
}
/* Icono: círculo con gradiente premium */
.channel-icon-wrap {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.55rem;
    color: #fff;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    flex-shrink: 0;
    align-self: center;
    margin: 10px auto 0 auto; /* Added 10px top margin as requested */
}
.channel-toggle-item:hover .channel-icon-wrap {
    transform: scale(1.08);
}
.channel-toggle-item.active .channel-icon-wrap {
    transform: scale(1.1);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}
/* Gradientes por canal */
.channel-toggle-item.call-toggle .channel-icon-wrap {
    background: linear-gradient(135deg, #006bf0, #38bdf8);
    box-shadow: 0 4px 14px rgba(0, 107, 240, 0.25);
}
.channel-toggle-item.mail-toggle .channel-icon-wrap {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.25);
}
.channel-toggle-item.chat-toggle .channel-icon-wrap {
    background: linear-gradient(135deg, #16a34a, #4ade80);
    box-shadow: 0 4px 14px rgba(34, 197, 94, 0.25);
}
/* Estado inactivo: gradiente desaturado */
.channel-toggle-item:not(.active) .channel-icon-wrap {
    filter: grayscale(60%) opacity(0.6);
}
.channel-toggle-item.active:not(:hover) .channel-icon-wrap {
    filter: none;
}
/* (Los estilos de texto y checkbox ahora están arriba en .channel-toggle-header) */

/* ── MODALES CENTRADOS ── */
.custom-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5000;
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 1.25rem;
}
.custom-modal-overlay.active {
    opacity: 1; pointer-events: auto;
}
.custom-modal {
    background: #fff;
    border-radius: 20px;
    width: 100%;
    max-width: 450px;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1.5px solid var(--border-color);
}
.custom-modal-overlay.active .custom-modal {
    transform: scale(1);
}
.custom-modal.info-modal {
    max-width: 540px;
    max-height: 82vh;
    overflow-y: auto;
    text-align: left;
}
.custom-modal.info-modal h3 { text-align: center; }
.info-modal-body {
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-light);
    margin-top: 0.75rem;
}
.info-modal-body p { margin-bottom: 0.75rem; }
.info-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--bg-light);
    color: var(--primary-color);
    border: 1.5px solid var(--border-color);
    border-radius: 20px;
    padding: 0.45rem 0.9rem;
    font-weight: 700;
    font-family: var(--font-main);
    font-size: 0.78rem;
    cursor: pointer;
    text-align: left;
    transition: var(--transition);
}
.info-link-btn i { font-size: 0.85rem; }
.info-link-btn:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* ── BLOQUEO CON BLUR ── */
.results-locked {
    filter: blur(6px);
    pointer-events: none;
    user-select: none;
    transition: filter 0.5s ease;
}
.lock-message-card {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border: 2px solid var(--primary-color);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 10;
}
.lock-message-card h2 {
    color: var(--primary-color);
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.lock-message-card .subtitle {
    font-size: 0.85rem;
    color: var(--text-light);
    text-align: center;
    margin-bottom: 1.5rem;
}

/* ── EQUIVALENCIAS Y DESGLOSE ── */
.results-block {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
}
.block-title {
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 6px;
}
.block-title i { color: var(--primary-color); }
.eq-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.eq-item {
    font-size: 0.82rem;
    color: var(--text-dark);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    line-height: 1.4;
}
.eq-item i {
    color: var(--warning-color);
    font-size: 1rem;
    margin-top: 2px;
}

/* ── REJILLA DE TOTALES GENERAL ── */
.general-results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin-top: 1rem;
}
.gen-result-item {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    border-radius: 10px;
    text-align: center;
}
.gen-result-item .label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-light);
    margin-bottom: 0.25rem;
    display: block;
}
.gen-result-item .val-h {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--primary-color);
    display: block;
    margin-bottom: 0.15rem;
}
.gen-result-item .val-m {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--success-color);
    display: block;
}

/* ── TARJETAS POR CANAL DE RESULTADOS ── */
.channel-result-card {
    background: var(--bg-white);
    border: 1.5px solid var(--border-color);
    border-radius: 14px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}
.channel-result-card.hidden {
    display: none !important;
}
.channel-result-card.calls { border-left: 4px solid var(--primary-color); }
.channel-result-card.emails { border-left: 4px solid var(--warning-color); }
.channel-result-card.chats { border-left: 4px solid var(--success-color); }

.channel-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
}
.channel-card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-bottom: 0.75rem;
}
.channel-grid-item {
    background: var(--bg-light);
    padding: 0.5rem;
    border-radius: 8px;
    text-align: center;
}
.channel-grid-item span { display: block; }
.channel-grid-item .lbl {
    font-size: 0.62rem;
    color: var(--text-light);
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 0.15rem;
}
.channel-grid-item .val-h {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary-color);
}
.channel-grid-item .val-m {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--success-color);
}
.explanation-text {
    font-size: 0.73rem;
    color: var(--text-light);
    line-height: 1.4;
    padding: 0.5rem 0.75rem;
    background: var(--bg-light);
    border-radius: 6px;
    text-align: left;
}

/* ── RESPONSIVE ── */
@media (max-width: 580px) {
    .odo-header-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    .channels-toggle-grid {
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }
    .channel-toggle-item {
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        gap: 12px;
        min-height: auto;
        padding: 0.75rem 1rem;
    }
    .channel-toggle-header {
        justify-content: flex-start;
        flex: 1;
    }
    .channel-toggle-item .channel-icon-wrap {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
        order: -1; /* Move icon to the left on mobile */
    }
    .general-results-grid, .channel-card-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

/* ── PERCENTIL ── */
.percentil-box {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.05), rgba(245, 158, 11, 0.01));
    border: 1px dashed var(--warning-color);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    margin-bottom: 1.25rem;
}
.percentil-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #d97706;
    margin-bottom: 0.25rem;
}
.percentil-desc {
    font-size: 0.72rem;
    color: var(--text-light);
    line-height: 1.3;
}

/* ── TARJETA DE COMPARTIR ── */
.share-card {
    border: 1px dashed var(--border-color); border-radius: 12px;
    padding: 0.9rem; margin: 1rem 0; text-align: center; background: var(--bg-light);
}
.share-card-preview {
    width: 100%; max-width: 260px; margin: 0.6rem auto; border-radius: 10px;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    color: #fff; padding: 1.1rem; box-shadow: var(--shadow-md);
}
.share-card-preview .sc-score { font-size: 2rem; font-weight: 800; }
.share-card-preview .sc-label { font-size: 0.7rem; opacity: 0.85; text-transform: uppercase; letter-spacing: 0.05em; }
.share-btns { display: flex; gap: 0.5rem; justify-content: center; margin-top: 0.6rem; }
.share-btns button {
    border: none; border-radius: 8px; padding: 0.5rem 0.8rem; font-size: 0.75rem;
    font-weight: 600; cursor: pointer; color: #fff;
}
.share-linkedin { background: #0A66C2; }
.share-whatsapp { background: #25D366; }
