/* ==========================================================================
   Herramientas Técnicas de Preimpresión - Estilos (tools.css)
   ========================================================================== */

.tools-intro {
    max-width: 820px;
    margin: 0 auto 2.5rem;
    text-align: center;
    color: var(--text-light);
    font-size: 1.15rem;
    line-height: 1.7;
}

/* Selector de pestañas / Herramientas */
.tools-nav {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin-bottom: 2.5rem;
}

.tool-tab-btn {
    background: #fff;
    border: 2px solid #e2e8f0;
    color: var(--text-dark);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.75rem 1.4rem;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.tool-tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(201, 160, 80, 0.15);
}

.tool-tab-btn.active {
    background: var(--dark-bg);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

/* Contenedor de la herramienta */
.tool-panel {
    display: none;
    animation: fadeInTool 0.35s ease;
}

.tool-panel.active {
    display: block;
}

@keyframes fadeInTool {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tool-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.05);
    border: 1px solid #e9ecef;
    padding: 2.2rem;
    margin-bottom: 2.5rem;
}

.tool-card-header {
    border-bottom: 2px solid #f1f3f5;
    padding-bottom: 1.2rem;
    margin-bottom: 2rem;
}

.tool-card-header h2 {
    font-size: 1.6rem;
    color: #1a1a1a;
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.tool-card-header p {
    color: #666;
    margin: 0;
    font-size: 0.98rem;
    line-height: 1.5;
}

/* Disposición de 2 columnas: Entradas vs Resultados */
.tool-layout {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 2.5rem;
}

@media (max-width: 900px) {
    .tool-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* Grupo de campos de formulario */
.form-group {
    margin-bottom: 1.4rem;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.45rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-control {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1.5px solid #dcdfe6;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #2c2c2c;
    background: #fdfdfd;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(201, 160, 80, 0.2);
    background: #fff;
}

.input-with-unit {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-unit .form-control {
    padding-right: 3rem;
}

.input-unit {
    position: absolute;
    right: 0.9rem;
    font-size: 0.85rem;
    color: #888;
    pointer-events: none;
    font-weight: 500;
}

/* Sliders con indicador numérico */
.slider-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.range-slider {
    flex: 1;
    -webkit-appearance: none;
    height: 7px;
    border-radius: 5px;
    background: #e2e8f0;
    outline: none;
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    transition: transform 0.15s;
}

.range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.range-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.slider-val-badge {
    min-width: 55px;
    text-align: center;
    background: #f1f3f5;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.9rem;
    color: #2c2c2c;
    border: 1px solid #dee2e6;
}

/* Botones rápidos de preajuste (Presets) */
.presets-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.5rem;
}

.preset-chip {
    background: #f4f4f4;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
}

.preset-chip:hover {
    background: #ececec;
    color: #1a1a1a;
    border-color: #ccc;
}

.preset-chip.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* Panel de Resultados */
.results-card {
    background: #fafafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.8rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.3rem;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 0.8rem;
}

.results-header h3 {
    margin: 0;
    font-size: 1.15rem;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-copy-specs {
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 6px;
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.btn-copy-specs:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #fffdf9;
}

/* Cajas de métricas clave */
.metric-highlight {
    background: #fff;
    border-radius: 10px;
    padding: 1.2rem;
    margin-bottom: 1rem;
    border-left: 5px solid var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.metric-label {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #777;
    margin-bottom: 0.3rem;
}

.metric-value-large {
    font-size: 2rem;
    font-weight: 800;
    color: #1a1a1a;
    line-height: 1.1;
}

.metric-value-unit {
    font-size: 1rem;
    font-weight: 500;
    color: #666;
    margin-left: 0.25rem;
}

.metric-secondary-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
    margin-bottom: 1.2rem;
}

.metric-sub-box {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 0.8rem 1rem;
}

.metric-sub-label {
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 0.2rem;
}

.metric-sub-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: #2c2c2c;
}

/* Banners de estado/diagnóstico (Éxito, Alerta, Peligro) */
.tool-alert-banner {
    border-radius: 8px;
    padding: 0.9rem 1.1rem;
    font-size: 0.88rem;
    line-height: 1.5;
    margin-top: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
}

.alert-success {
    background-color: #e6f4ea;
    border: 1px solid #b7e1cd;
    color: #137333;
}

.alert-warning {
    background-color: #fef7e0;
    border: 1px solid #fce8b2;
    color: #b06000;
}

.alert-danger {
    background-color: #fce8e6;
    border: 1px solid #fad2cf;
    color: #c5221f;
}

/* Diagrama SVG interactivo para Lomo y Cubierta */
.diagram-container {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1.2rem;
    margin-top: 1.5rem;
    text-align: center;
}

.diagram-container h4 {
    margin: 0 0 0.8rem 0;
    font-size: 0.95rem;
    color: #444;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.svg-diagram-wrapper {
    width: 100%;
    max-height: 240px;
    overflow: hidden;
    display: flex;
    justify-content: center;
}

.svg-diagram-wrapper svg {
    max-width: 100%;
    height: auto;
}

/* Herramienta TAC - Parche de color y barras */
.cmyk-swatch-box {
    display: flex;
    gap: 1.2rem;
    align-items: center;
    background: #fff;
    padding: 1rem;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    margin-bottom: 1.2rem;
}

.cmyk-swatch-color {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    border: 2px solid #ddd;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    flex-shrink: 0;
    transition: background-color 0.2s ease;
}

.cmyk-swatch-info {
    flex: 1;
}

.tac-meter-container {
    margin-top: 0.6rem;
}

.tac-meter-bar {
    height: 12px;
    background: #e9ecef;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.tac-meter-fill {
    height: 100%;
    width: 0%;
    transition: width 0.3s ease, background-color 0.3s ease;
    border-radius: 6px;
}

/* Toast de Copiado */
.toast-msg {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #1a1a1a;
    color: #fff;
    padding: 0.8rem 1.4rem;
    border-radius: 30px;
    font-size: 0.88rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.25);
    border-left: 4px solid var(--primary);
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 9999;
}

.toast-msg.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* Explicación técnica complementaria */
.tool-technical-guide {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid #eaeaea;
    margin-top: 2rem;
}

.tool-technical-guide h3 {
    margin-top: 0;
    font-size: 1.25rem;
    color: #1a1a1a;
    border-left: 4px solid var(--primary);
    padding-left: 0.8rem;
}

.tool-technical-guide p, .tool-technical-guide li {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.7;
}
