:root {
    --primary-color: #3b82f6;
    --background-bg: #0b0f19;
    --card-bg: #161b22;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border-color: #30363d;
    --accent-glow: rgba(59, 130, 246, 0.2);
    --chart-bg: #ffffff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--background-bg);
    color: var(--text-main);
    line-height: 1.5;
}

.atc-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.atc-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.atc-header h1 {
    font-size: 2.75rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, #60a5fa 0%, #c084fc 50%, #60a5fa 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 10px 30px rgba(96, 165, 250, 0.3);
    animation: shine 5s linear infinite;
}

@keyframes shine {
    to { background-position: 200% center; }
}

.atc-header p {
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto;
}

.atc-main-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 900px) {
    .atc-main-grid {
        grid-template-columns: 1fr;
    }
}

.atc-fusion-fix .atc-card {
    background: var(--card-bg) !important;
    border-radius: 1rem !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3) !important;
    padding: 1.25rem !important;
    margin-bottom: 1.5rem !important;
    display: block !important;
    visibility: visible !important;
    height: auto !important;
}

.atc-chart-container {
    height: 480px;
    position: relative;
    background: var(--chart-bg);
    border-radius: 0.5rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
}

.atc-controls-group {
    margin-bottom: 1.25rem;
}

.atc-controls-group h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.075em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.4rem;
}

/* Selectores e Inputs con especificidad reforzada para WordPress/Avada */
.atc-fusion-fix .atc-select, 
.atc-fusion-fix select.atc-select {
    background-color: #1e293b !important;
    background: #1e293b !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
    padding: 12px !important;
    color: #ffffff !important;
    font-size: 1rem !important;
    width: 100% !important;
    height: auto !important;
    min-height: 48px !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    transition: border-color 0.2s ease !important;
    appearance: auto !important;
    -webkit-appearance: auto !important;
}

.atc-fusion-fix .atc-select option {
    background-color: #1e293b !important;
    color: #ffffff !important;
}

select.atc-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.atc-input-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.atc-input-row label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #cbd5e1;
}

.atc-input-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.atc-val-input {
    width: 75px;
    padding: 0.35rem;
    background: #0d1117;
    color: #60a5fa;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
}

.atc-btn-step {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #30363d;
    color: white;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 0.75rem;
}

.atc-btn-step:hover {
    background: #484f58;
}

.atc-slider-block {
    margin-top: 1rem;
}

.atc-fusion-fix .atc-slider-row {
    margin-bottom: 0.75rem !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.atc-fusion-fix .atc-slider-label {
    display: flex !important;
    justify-content: space-between !important;
    margin-bottom: 0.25rem !important;
    font-size: 0.85rem !important;
    color: #e2e8f0 !important;
    visibility: visible !important;
}

.atc-fusion-fix .atc-val-perc {
    color: var(--primary-color) !important;
    font-weight: bold !important;
    display: inline !important;
}

.atc-fusion-fix input[type=range].atc-range {
    width: 100% !important;
    height: 25px !important;
    accent-color: var(--primary-color) !important;
    cursor: pointer !important;
    display: block !important;
    visibility: visible !important;
    margin: 10px 0 !important;
    appearance: auto !important;
}

.atc-schematic-wrap {
    text-align: center;
    padding: 1.5rem;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.atc-schematic-wrap img {
    max-width: 100%;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

/* Footer & Buttons */
.atc-footer-hub {
    margin-top: 5rem;
    padding: 4rem 0;
    border-top: 1px solid var(--border-color);
}

.atc-hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    max-width: 1000px;
    margin: 0 auto 4rem;
}

.atc-hub-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.25rem;
    border-radius: 0.75rem;
    color: white;
    text-decoration: none;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.2);
}

.atc-hub-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4);
    filter: brightness(1.1);
}

.btn-recta { background: linear-gradient(135deg, #9333ea 0%, #6b21a8 100%); }
.btn-salud { background: linear-gradient(135deg, #22c55e 0%, #15803d 100%); }
.btn-taller { background: linear-gradient(135deg, #f97316 0%, #c2410c 100%); }
.btn-bias { background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%); }

.atc-guides-section {
    max-width: 1100px;
    margin: 0 auto;
    text-align: center;
}

.atc-guides-title {
    color: #f59e0b;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.atc-links-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

@media (max-width: 768px) {
    .atc-links-grid { grid-template-columns: 1fr; }
}

.atc-link-box {
    background: #1e293b;
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 0.5rem;
    color: #fbbf24;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.atc-link-box:hover {
    background: #334155;
    border-color: #fbbf24;
    color: #fff;
}

/* Info and Help Section */
.atc-info-card {
    line-height: 1.7;
}

.atc-info-card h2 {
    color: #60a5fa;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.atc-glossary {
    margin-top: 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 700px) {
    .atc-glossary { grid-template-columns: 1fr; }
}

.glossary-item b {
    color: #fcd34d;
    display: block;
    margin-bottom: 0.25rem;
}

.glossary-item p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.impedance-note {
    background: rgba(59, 130, 246, 0.1);
    border-left: 4px solid var(--primary-color);
    padding: 1rem;
    margin-top: 1rem;
    border-radius: 0 0.5rem 0.5rem 0;
    font-size: 0.9rem;
}

#atc-impedance-info {
    font-weight: 800;
    color: #fff;
}

/* Action Group below Sliders */
.atc-action-group {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.atc-btn {
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    border-radius: 8px;
    padding: 0.85rem 1.5rem;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    flex: 1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-action-reset {
    background: rgba(31, 41, 55, 0.8);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.btn-action-reset:hover {
    background: #f59e0b;
    color: #111;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(245, 158, 11, 0.3);
}

.btn-action-print {
    background: daily-gradient(135deg, #3b82f6, #2563eb);
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
}

.btn-action-print:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px -5px rgba(37, 99, 235, 0.4);
    filter: brightness(1.1);
}

/* ==========================================================================
   VERSION DE IMPRESIÓN (A4 HORIZONTAL)
   ========================================================================== */
@media print {
    @page {
        size: A4 landscape;
        margin: 1cm;
    }

    body {
        background: white !important;
        color: #111 !important;
        font-size: 10pt;
    }

    /* Ocultar elementos sobrantes */
    .atc-header, .atc-selector-wrap, .atc-action-group, 
    #atc-btn-print, #atc-btn-reset, .atc-recommendation, 
    .atc-footer-hub, #atc-help-section, .atc-schematic-wrap {
        display: none !important;
    }

    /* Resetear contenedor principal */
    .atc-container {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .atc-main-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
    }

    .atc-card {
        background: white !important;
        border: 1px solid #ddd !important;
        box-shadow: none !important;
        padding: 10px !important;
        break-inside: avoid;
    }

    .atc-card h3 {
        color: #333 !important;
        border-bottom: 2px solid #3b82f6 !important;
        margin-bottom: 10px !important;
    }

    /* Gráfica */
    .atc-chart-container {
        height: 350px !important;
        border: 1px solid #000 !important;
        background: white !important;
    }

    /* Contenedores de datos en rejilla para ahorro de espacio */
    #atc-sliders-container, #atc-components-container {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 10px !important;
    }

    .atc-slider-row, .atc-input-row {
        border-bottom: 1px dotted #ccc !important;
        margin-bottom: 5px !important;
        padding-bottom: 5px !important;
        display: block !important;
    }

    /* Ocultar los deslizantes físicos y botones +/- al imprimir */
    input[type=range].atc-range, .atc-btn-step {
        display: none !important;
    }

    .atc-slider-label, .atc-input-row {
        color: #111 !important;
        font-weight: 600 !important;
    }

    .atc-val-perc, .atc-val-input {
        color: #2563eb !important;
        font-weight: 800 !important;
        background: none !important;
        border: none !important;
        padding: 0 !important;
        font-size: 11pt !important;
    }

    aside.atc-sidebar {
        width: 100% !important;
        display: block !important;
    }

    /* Título de impresión */
    body::before {
        content: "REPORTE DE DISEÑO: TONE STACK CALCULATOR PRO";
        display: block;
        font-size: 18pt;
        font-weight: 800;
        text-align: center;
        margin-bottom: 20px;
        color: #1e3a8a;
    }
}
