/* =========================================================
   NEXENG | Fraction MM Converter
   Archivo: /apps/fraction_mm_converter/assets/fraction-mm-converter.css
   Version: 1.0.0

   Mantener este archivo mínimo.
   La estética principal vive en:
   /assets/css/nexeng-app-base.css
   ========================================================= */

/* =========================================================
   Control segmentado
   ========================================================= */

.nx-segmented-control {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 18px 0 22px;
    padding: 6px;
    border: 1px solid rgba(15, 87, 130, 0.12);
    border-radius: 999px;
    background: rgba(248, 251, 255, 0.88);
}

.nx-segmented-btn {
    min-height: 44px;
    border: 0;
    border-radius: 999px;
    padding: 0 16px;
    background: transparent;
    color: var(--nx-soft);
    font-weight: 900;
    font-size: 0.9rem;
    cursor: pointer;
    transition:
        background 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.nx-segmented-btn:hover {
    color: var(--nx-accent);
}

.nx-segmented-btn.is-active {
    color: #ffffff;
    background: linear-gradient(135deg, var(--nx-accent), var(--nx-accent-3));
    box-shadow: 0 14px 30px rgba(2, 132, 199, 0.22);
}

.nx-segmented-btn.is-active:hover {
    color: #ffffff;
    transform: translateY(-1px);
}

/* =========================================================
   Paneles de conversión
   ========================================================= */

.fc-mode-panel {
    display: none;
}

.fc-mode-panel.is-active {
    display: block;
    animation: fcPanelIn 0.22s ease both;
}

@keyframes fcPanelIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================================
   Botones rápidos
   ========================================================= */

.fc-quick-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 4px;
}

.fc-quick-btn {
    min-height: 36px;
    border: 1px solid rgba(15, 87, 130, 0.14);
    border-radius: 999px;
    padding: 0 12px;
    background: rgba(255, 255, 255, 0.82);
    color: var(--nx-soft);
    font-weight: 850;
    font-size: 0.82rem;
    cursor: pointer;
    transition:
        background 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease,
        transform 0.18s ease,
        box-shadow 0.18s ease;
}

.fc-quick-btn:hover {
    transform: translateY(-1px);
    border-color: var(--nx-border-strong);
    background: #ffffff;
    color: var(--nx-accent);
    box-shadow: var(--nx-shadow-soft);
}

.fc-quick-btn.is-active {
    border-color: rgba(2, 132, 199, 0.34);
    background: rgba(14, 165, 233, 0.10);
    color: var(--nx-accent);
}

/* =========================================================
   Fórmulas
   ========================================================= */

.fc-formula-box {
    display: grid;
    gap: 6px;
    padding: 14px 15px;
    border: 1px solid rgba(15, 87, 130, 0.12);
    border-radius: 16px;
    background: rgba(248, 251, 255, 0.86);
}

.fc-formula-box + .fc-formula-box {
    margin-top: 12px;
}

.fc-formula-box strong {
    color: var(--nx-text);
    font-size: 0.86rem;
    font-weight: 950;
}

.fc-formula-box span {
    color: var(--nx-soft);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 0.88rem;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

/* =========================================================
   Resultados
   ========================================================= */

#heroPrimaryResult,
#previewPrimaryResult,
#summaryLastResult,
#resultInputDisplay,
#resultDecimalInches,
#resultMillimeters,
#resultFraction,
#resultDifference {
    overflow-wrap: anywhere;
}

#resultFraction {
    font-feature-settings: "frac";
}

.fc-fraction-large {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.fc-fraction-stack {
    display: inline-grid;
    grid-template-rows: auto 2px auto;
    align-items: center;
    justify-items: center;
    line-height: 1;
}

.fc-fraction-stack span {
    display: block;
}

.fc-fraction-line {
    width: 100%;
    min-width: 26px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

/* =========================================================
   Avisos técnicos
   ========================================================= */

#engineeringWarning {
    white-space: normal;
}

#engineeringWarning ul {
    margin: 8px 0 0;
    padding-left: 20px;
}

#engineeringWarning li + li {
    margin-top: 6px;
}

/* =========================================================
   Tabla de referencia
   ========================================================= */

.fc-reference-section {
    margin-top: 22px;
}

.fc-table-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.fc-filter-btn {
    min-height: 34px;
    border: 1px solid rgba(15, 87, 130, 0.14);
    border-radius: 999px;
    padding: 0 12px;
    background: rgba(255, 255, 255, 0.78);
    color: var(--nx-soft);
    font-weight: 850;
    font-size: 0.8rem;
    cursor: pointer;
    transition:
        background 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease,
        box-shadow 0.18s ease;
}

.fc-filter-btn:hover {
    border-color: var(--nx-border-strong);
    background: #ffffff;
    color: var(--nx-accent);
}

.fc-filter-btn.is-active {
    border-color: rgba(2, 132, 199, 0.32);
    background: rgba(14, 165, 233, 0.10);
    color: var(--nx-accent);
}

.fc-table-wrap {
    max-height: 520px;
    overflow: auto;
    border: 1px solid rgba(15, 87, 130, 0.12);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.78);
}

.fc-reference-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 560px;
}

.fc-reference-table thead {
    position: sticky;
    top: 0;
    z-index: 2;
    background: rgba(248, 251, 255, 0.98);
    backdrop-filter: blur(14px);
}

.fc-reference-table th,
.fc-reference-table td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(15, 87, 130, 0.10);
    text-align: left;
}

.fc-reference-table th {
    color: var(--nx-muted);
    font-size: 0.74rem;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.fc-reference-table td {
    color: var(--nx-text);
    font-size: 0.92rem;
}

.fc-reference-table tbody tr {
    cursor: pointer;
    transition:
        background 0.16s ease,
        color 0.16s ease;
}

.fc-reference-table tbody tr:hover {
    background: rgba(14, 165, 233, 0.07);
}

.fc-reference-table .fc-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-weight: 800;
}

.fc-reference-table .fc-mm {
    color: var(--nx-accent);
    font-weight: 900;
}

.fc-visual-bar {
    height: 8px;
    width: 100%;
    min-width: 110px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(15, 87, 130, 0.08);
}

.fc-visual-fill {
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--nx-accent), var(--nx-accent-3));
}

/* =========================================================
   Historial
   ========================================================= */

.fc-history-direction {
    color: var(--nx-muted);
    font-weight: 850;
}

.fc-history-result {
    color: var(--nx-accent);
    font-weight: 950;
}

.fc-history-chip {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 999px;
    color: var(--nx-accent);
    background: rgba(14, 165, 233, 0.10);
    font-size: 0.72rem;
    font-weight: 900;
}

/* =========================================================
   Noscript
   ========================================================= */

.nx-noscript {
    width: min(100% - 32px, 720px);
    margin: 24px auto;
    padding: 16px 18px;
    border: 1px solid rgba(220, 38, 38, 0.22);
    border-radius: 18px;
    background: rgba(220, 38, 38, 0.08);
    color: #991b1b;
    font-weight: 800;
    text-align: center;
}

/* =========================================================
   Responsive específico
   ========================================================= */

@media (max-width: 720px) {
    .nx-segmented-control {
        grid-template-columns: 1fr;
        border-radius: 22px;
    }

    .nx-segmented-btn {
        border-radius: 18px;
        min-height: 42px;
    }

    .fc-quick-grid {
        gap: 7px;
    }

    .fc-quick-btn {
        flex: 1 1 auto;
    }
}

@media (max-width: 560px) {
    .fc-formula-box span {
        font-size: 0.8rem;
    }

    .fc-table-wrap {
        max-height: 430px;
    }

    .fc-reference-table th,
    .fc-reference-table td {
        padding: 10px 12px;
    }
}