/* =====================================================
   EXPERT FULL — LAYOUT BASE
   ===================================================== */

.expert-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    align-items: stretch;
    padding: 20px 0;
}

/* MAIN PANEL */
.expert-main {
    width: 100%;
}

.expert-card {
    background: white;
    border-radius: 18px;
    padding: 32px;
    border: 1px solid var(--gray-200);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.25s ease;
    height: 100%;
}

.expert-card:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
}

/* =====================================================
   HEADER
   ===================================================== */

.expert-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 6px;
}

.expert-header h2 i {
    font-size: 20px;
    color: var(--primary-blue);
}

.expert-header p {
    font-size: 14px;
    color: var(--gray-500);
    margin: 0 0 24px 0;
}

/* =====================================================
   CONTROL GROUPS
   ===================================================== */

.expert-controls {
    display: flex;
    flex-direction: column;
    gap: 36px;
}

.control-group {
    padding-bottom: 28px;
    border-bottom: 1px solid var(--gray-100);
}

.control-group:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.control-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.control-header label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
}

.control-header label i {
    font-size: 18px;
    color: var(--gray-400);
}

.control-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-blue);
    background: rgba(37, 99, 235, 0.08);
    padding: 6px 12px;
    border-radius: 8px;
}

/* =====================================================
   SLIDERS (PREMIUM)
   ===================================================== */

.control-slider {
    width: 100%;
    height: 6px;
    border-radius: 4px;
    background: var(--gray-200);
    outline: none;
    -webkit-appearance: none;
    margin-bottom: 12px;
    cursor: pointer;
}

/* WebKit Thumb */
.control-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-blue);
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
    transition: all 0.2s ease;
}

.control-slider::-webkit-slider-thumb:hover {
    transform: scale(1.12);
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.45);
}

.control-slider::-webkit-slider-thumb:active {
    transform: scale(1.05);
}

/* Firefox Thumb */
.control-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-blue);
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
    transition: all 0.2s ease;
}

.control-slider::-moz-range-thumb:hover {
    transform: scale(1.12);
}

.control-scale {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--gray-400);
    margin-bottom: 12px;
}

/* =====================================================
   TOGGLES & OPTIONS
   ===================================================== */

.control-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--gray-50);
    padding: 12px 16px;
    border-radius: 10px;
    margin-top: 8px;
}

.control-option span {
    font-size: 13px;
    color: var(--gray-600);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 46px;
    height: 24px;
    background: var(--gray-300);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.25s ease;
    border: none;
}

.toggle-switch.active {
    background: var(--primary-blue);
}

.toggle-knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    transition: transform 0.25s ease;
}

.toggle-switch.active .toggle-knob {
    transform: translateX(22px);
}

/* =====================================================
   STORAGE TYPE BUTTONS
   ===================================================== */

.storage-type-selector {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.storage-type-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.25s ease;
}

.storage-type-btn:hover {
    background: white;
    border-color: var(--gray-300);
}

.storage-type-btn.active {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: white;
    transform: scale(1.05);
}

.storage-type-btn i {
    font-size: 14px;
}

/* =====================================================
   CONTROL HINT
   ===================================================== */

.control-hint {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 10px;
    padding: 10px 12px;
    background: rgba(37, 99, 235, 0.05);
    border-left: 3px solid rgba(37, 99, 235, 0.25);
    border-radius: 6px;
    font-size: 12px;
    color: var(--gray-600);
}

.control-hint i {
    font-size: 14px;
    color: var(--primary-blue);
}

/* =====================================================
   SIDEBAR CONTAINER
   ===================================================== */

.expert-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 100px;
}

.sidebar-card {
    background: white;
    border-radius: 14px;
    padding: 16px;
    border: 1px solid var(--gray-200);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.sidebar-card h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-700);
    margin-bottom: 12px;
}

.sidebar-card h3 i {
    font-size: 14px;
    color: var(--gray-400);
}


/* =====================================================
   REGION CARD (DISEÑO COMPACTO)
   ===================================================== */

.region-card h3 {
    color: var(--primary-blue);
    margin-bottom: 4px;
}

.card-subtitle {
    font-size: 11px;
    color: var(--gray-500);
    margin: 0 0 12px 0;
    line-height: 1.4;
}

.region-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.region-option {
    display: block;
    cursor: pointer;
    position: relative;
}

.region-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.region-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: var(--gray-50);
    border: 1.5px solid var(--gray-200);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.region-option:hover .region-label {
    background: white;
    border-color: var(--primary-blue);
}

.region-option input[type="radio"]:checked + .region-label {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(37, 99, 235, 0.03));
    border-color: var(--primary-blue);
}

.region-option input[type="radio"]:checked + .region-label::after {
    content: '✓';
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    background: var(--primary-blue);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
}

.region-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    flex-shrink: 0;
}

.region-icon i {
    font-size: 16px;
    color: var(--gray-500);
}

.region-option:hover .region-icon,
.region-option input[type="radio"]:checked + .region-label .region-icon {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
}

.region-option:hover .region-icon i,
.region-option input[type="radio"]:checked + .region-label .region-icon i {
    color: white;
}

.region-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1;
    min-width: 0;
}

.region-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-900);
}

.region-option input[type="radio"]:checked + .region-label .region-name {
    color: var(--primary-blue);
}

.region-desc {
    font-size: 11px;
    color: var(--gray-400);
}

/* Region Badge */
.region-badge {
    display: inline-flex;
    padding: 2px 8px;
    background: rgba(37, 99, 235, 0.1);
    border-radius: 6px;
    color: var(--primary-blue);
    font-weight: 700;
    font-size: 12px;
    animation: regionPulse 2s infinite;
}

@keyframes regionPulse {
    0%, 100% { background: rgba(37, 99, 235, 0.1); }
    50% { background: rgba(37, 99, 235, 0.15); }
}

/* =====================================================
   FILTERS (DISEÑO RICO)
   ===================================================== */

.filter-group {
    margin-bottom: 20px;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-group h4 {
    position: relative;
    padding-left: 10px;
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.filter-group h4::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 10px;
    background: var(--primary-blue);
    border-radius: 2px;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 8px;
    border-radius: 6px;
    transition: background 0.2s ease;
    cursor: pointer;
    user-select: none;
}

.filter-checkbox:hover {
    background: var(--gray-50);
}

.filter-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
}

.checkmark {
    width: 18px;
    height: 18px;
    background: var(--gray-100);
    border: 2px solid var(--gray-300);
    border-radius: 5px;
    flex-shrink: 0;
    transition: all 0.2s ease;
    position: relative;
}

.filter-checkbox:hover .checkmark {
    border-color: var(--primary-blue);
}

.filter-checkbox input[type="checkbox"]:checked ~ .checkmark {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
}

.checkmark::after {
    content: '';
    position: absolute;
    display: none;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.filter-checkbox input[type="checkbox"]:checked ~ .checkmark::after {
    display: block;
}

.filter-label {
    font-size: 13px;
    color: var(--gray-600);
    font-weight: 500;
}

.filter-checkbox input[type="checkbox"]:checked ~ .filter-label {
    color: var(--gray-900);
    font-weight: 600;
}

/* =====================================================
   INSIGHT CARD
   ===================================================== */

.insight-card {
    display: flex;
    gap: 14px;
    background: rgba(245, 158, 11, 0.06);
    border-color: rgba(245, 158, 11, 0.15);
    padding: 20px;
    border-radius: 12px;
}

.insight-icon {
    flex-shrink: 0;
}

.insight-icon i {
    font-size: 24px;
    color: var(--warning-amber);
}

.insight-text {
    font-size: 13px;
    color: var(--gray-600);
    line-height: 1.5;
    margin: 0;
}

.insight-text strong {
    color: var(--gray-700);
}

/* MAIN ACTION BUTTON (debajo de los filtros) */
.expert-main-actions {
    margin-top: 24px;
    display: flex;
    justify-content: flex-end;
}

.btn-find-matches-main {
    background: var(--primary);
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease, transform 0.1s ease;
}

.btn-find-matches-main i {
    font-size: 16px;
}

.btn-find-matches-main:hover {
    background: var(--primary-dark, #1d4ed8);
    transform: translateY(-1px);
}

.btn-find-matches-main:active {
    transform: translateY(0);
}


.expert-results-panel {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* HEADER DE RESULTADOS (homologado con wizard) */
.expert-results-header {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 40px;
}

.expert-results-header .header-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
    border-radius: 14px;
    flex-shrink: 0;
}

.expert-results-header .header-icon i {
    font-size: 24px;
    color: var(--success-green, #10b981);
}

.expert-results-header .header-info h2 {
    font-size: clamp(1.25rem, 3vw, 1.5rem);
    font-weight: 700;
    color: var(--gray-900);
    margin: 0 0 8px 0;
}

.expert-results-header .header-info p {
    margin: 0;
    font-size: clamp(14px, 2vw, 15px);
    color: var(--gray-500, #6b7280);
    line-height: 1.5;
}

/* TECHNICAL SUMMARY (homologado con wizard) */
.expert-summary {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 32px;
    padding: 20px;
    background: var(--gray-50, #f9fafb);
    border-radius: 12px;
}

.expert-summary .summary-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--gray-600, #4b5563);
}

.expert-summary .summary-item i {
    font-size: 16px;
    color: var(--gray-400, #9ca3af);
}

/* RESULTS CONTAINER (si no lo tienes ya desde wizard) */
.results-comparison {
    margin-top: 8px;
}

/* Placeholder de carga (igual que wizard) */
.results-placeholder {
    border-radius: 10px;
    padding: 24px;
    border: 1px dashed rgba(148,163,184,0.6);
    text-align: center;
    color: #6b7280;
    background: rgba(15,23,42,0.02);
}

.results-placeholder .placeholder-icon {
    font-size: 22px;
    margin-bottom: 8px;
}

.expert-actions {
    margin-top: 24px;
    display: flex;
    justify-content: center;
}

.expert-actions .btn-restart {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #64748b;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.expert-actions .btn-restart:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #475569;
}

.expert-actions .btn-restart i {
    font-size: 16px;
}

.btn-compare {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,0.7);
    background: #fff;
    color: #4b5563;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-compare i {
    font-size: 14px;
}

.btn-compare:hover {
    background: #f9fafb;
    border-color: rgba(148,163,184,1);
}

/* Hide results panel until user clicks Find Best Matches */
.expert-results-panel {
    display: none;
}

/* =====================================================
   RESPONSIVE - EXPERT FULL
   ===================================================== */

@media (max-width: 992px) {
    .expert-layout {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    /* Main (sliders) va primero */
    .expert-main {
        order: 1;
    }

    /* Sidebar (región + live preview) va después */
    .expert-sidebar {
        order: 2;
        display: flex;
        flex-direction: column;
        gap: 16px;
    }


    .region-options {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
}

@media (max-width: 768px) {
    .expert-layout {
        gap: 16px;
        padding: 16px 0;
    }

    .expert-sidebar {
        gap: 12px;
    }

    .expert-card {
        padding: 20px 16px;
        border-radius: 14px;
    }

    .expert-header h2 {
        font-size: 1.15rem;
        gap: 8px;
    }

    .expert-header h2 i {
        font-size: 18px;
    }

    .expert-header p {
        font-size: 13px;
        margin-bottom: 20px;
    }

    .expert-controls {
        gap: 24px;
    }

    .control-group {
        padding-bottom: 20px;
    }

    .control-header {
        margin-bottom: 10px;
    }

    .control-header label {
        font-size: 13px;
        gap: 8px;
    }

    .control-header label i {
        font-size: 16px;
    }

    .control-value {
        font-size: 13px;
        padding: 4px 10px;
    }

    .control-slider {
        height: 6px;
    }

    .control-slider::-webkit-slider-thumb {
        width: 18px;
        height: 18px;
    }

    .control-scale {
        font-size: 10px;
        margin-top: 6px;
    }

    /* Region options - mobile */
    .region-options {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .region-option {
        padding: 10px;
        gap: 10px;
    }

    .region-option .region-icon {
        width: 34px;
        height: 34px;
    }

    .region-option .region-icon i {
        font-size: 15px;
    }

    .region-option h4 {
        font-size: 12px;
    }

    .region-option span {
        font-size: 10px;
    }

    /* CPU toggle */
    .cpu-type-toggle {
        padding: 6px 8px;
        margin-top: 8px;
    }

    .cpu-type-toggle span {
        font-size: 11px;
    }

    /* Storage type */
    .storage-type {
        gap: 6px;
        margin-top: 8px;
    }

    .storage-type-btn {
        padding: 6px 10px;
        font-size: 11px;
    }

    /* Sidebar */
    .sidebar-section {
        padding: 16px;
    }

    .sidebar-section h4 {
        font-size: 13px;
        margin-bottom: 12px;
    }

    /* Live results */
    .live-result {
        padding: 12px;
    }

    .live-provider {
        font-size: 13px;
    }

    .live-specs {
        font-size: 11px;
    }

    /* Actions */
    .expert-actions {
        margin-top: 20px;
        justify-content: center;
    }

    .btn-calculate,
    .btn-compare {
        width: 100%;
        justify-content: center;
        padding: 12px 16px;
    }

    /* Summary */
    .expert-summary {
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
    }

    .summary-item {
        padding: 6px 10px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .expert-card {
        padding: 16px 12px;
        border-radius: 12px;
    }

    .expert-header h2 {
        font-size: 1.05rem;
    }

    .expert-controls {
        gap: 20px;
    }

    .control-group {
        padding-bottom: 16px;
    }

    .control-header label {
        font-size: 12px;
    }

    .control-value {
        font-size: 12px;
        padding: 3px 8px;
    }

    .control-scale {
        font-size: 9px;
    }

    .region-options {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .region-option {
        padding: 8px;
        gap: 8px;
    }

    .region-option .region-icon {
        width: 30px;
        height: 30px;
    }

    .region-option h4 {
        font-size: 11px;
    }

    .region-option span {
        font-size: 9px;
    }

    .cpu-type-toggle span {
        font-size: 10px;
    }

    .storage-type-btn {
        padding: 5px 8px;
        font-size: 10px;
    }
}
