/* velocidad-lectura.css — estilos específicos */

/* Tabs de modo */
.tipo-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.75rem;
}

.tipo-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 1.1rem;
    border: 2px solid var(--border, #e2e8f0);
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted, #64748b);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.18s, background 0.18s, color 0.18s;
}

.tipo-tab:hover {
    border-color: var(--primary, #2563eb);
    color: var(--primary, #2563eb);
}

.tipo-tab.active {
    border-color: var(--primary, #2563eb);
    background: var(--primary, #2563eb);
    color: #fff;
}

.tipo-tab i {
    font-size: 0.8rem;
}

/* Form grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem 1.5rem;
    margin-bottom: 1.75rem;
}

.field-full {
    grid-column: 1 / -1;
}

/* Test cronometrado */
.test-box {
    background: var(--bg-alt, #f8fafc);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.75rem;
}

.test-box h3 {
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    color: var(--text, #1e293b);
    margin-bottom: 0.5rem;
}

.test-box p.test-intro {
    font-size: 0.875rem;
    color: var(--text-muted, #64748b);
    margin-bottom: 1rem;
}

.test-passage {
    background: #fff;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    font-size: 0.95rem;
    line-height: 1.75;
    color: var(--text, #1e293b);
    margin-bottom: 1rem;
    position: relative;
    user-select: none;
}

.test-passage.reading {
    border-color: var(--primary, #2563eb);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.test-overlay {
    position: absolute;
    inset: 0;
    background: rgba(248, 250, 252, 0.92);
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.5rem;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    transition: opacity 0.3s;
}

.test-overlay i {
    font-size: 1.5rem;
    color: var(--primary, #2563eb);
}

.test-overlay.hidden {
    display: none;
}

.test-timer {
    font-size: 2rem;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    color: var(--primary, #2563eb);
    text-align: center;
    margin-bottom: 0.75rem;
    letter-spacing: 0.04em;
}

.test-controls {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn-test {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.2rem;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s;
    border: 2px solid transparent;
}

.btn-test-primary {
    background: var(--primary, #2563eb);
    color: #fff;
}

.btn-test-primary:hover {
    background: #1d4ed8;
}

.btn-test-outline {
    background: transparent;
    border-color: var(--border, #e2e8f0);
    color: var(--text-muted, #64748b);
}

.btn-test-outline:hover {
    border-color: var(--primary, #2563eb);
    color: var(--primary, #2563eb);
}

/* Velocímetro visual */
.speedometer-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 1.5rem 0 0.5rem;
}

.speedometer-wrap svg {
    overflow: visible;
}

.speed-label {
    font-size: 0.8rem;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    color: var(--text-muted, #64748b);
    margin-top: 0.5rem;
    text-align: center;
}

/* Badge de nivel lector */
.reader-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 1rem;
    border-radius: 20px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.875rem;
    font-weight: 700;
    margin: 0.75rem 0;
}

.badge-lento {
    background: #fee2e2;
    color: #991b1b;
}

.badge-basico {
    background: #fef9c3;
    color: #854d0e;
}

.badge-medio {
    background: #dcfce7;
    color: #166534;
}

.badge-rapido {
    background: #dbeafe;
    color: #1e40af;
}

.badge-experto {
    background: #ede9fe;
    color: #5b21b6;
}

/* Tabla de tiempos de lectura */
.reading-table-wrap {
    margin-top: 1rem;
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid var(--border, #e2e8f0);
}

.reading-table-wrap table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.reading-table-wrap thead {
    background: var(--primary, #2563eb);
    color: #fff;
}

.reading-table-wrap thead th {
    padding: 0.6rem 1rem;
    text-align: left;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    white-space: nowrap;
}

.reading-table-wrap thead th:not(:first-child) {
    text-align: right;
}

.reading-table-wrap tbody tr:nth-child(even) {
    background: var(--bg-alt, #f8fafc);
}

.reading-table-wrap tbody td {
    padding: 0.55rem 1rem;
    color: var(--text, #1e293b);
    border-bottom: 1px solid var(--border, #e2e8f0);
}

.reading-table-wrap tbody td:not(:first-child) {
    text-align: right;
}

.reading-table-wrap tbody tr:last-child td {
    border-bottom: none;
}

.book-icon {
    display: inline-block;
    margin-right: 0.4rem;
    font-size: 0.85rem;
}

/* Tabla de comparativa de velocidades */
.speed-compare {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.8rem;
    box-shadow: var(--shadow);
    margin-top: 1.5rem;
}

.speed-compare h3 {
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    color: var(--text, #1e293b);
    margin-bottom: 0.75rem;
}

.speed-bar-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.speed-bar-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.speed-bar-label {
    font-size: 0.8rem;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    color: var(--text-muted, #64748b);
    min-width: 130px;
}

.speed-bar-track {
    flex: 1;
    height: 10px;
    background: var(--border, #e2e8f0);
    border-radius: 5px;
    overflow: hidden;
}

.speed-bar-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.6s ease;
}

.speed-bar-val {
    font-size: 0.8rem;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    color: var(--text, #1e293b);
    min-width: 70px;
    text-align: right;
}

/* Fórmulas SEO */
.seo-block .formula-box {
    background: var(--bg-formula, #f1f5f9);
    border-left: 4px solid var(--primary, #2563eb);
    border-radius: 0 8px 8px 0;
    padding: 0.75rem 1.1rem;
    margin: 0.75rem 0 1rem;
    overflow-x: auto;
}

.seo-block .formula-box code {
    font-size: 0.95rem;
    color: var(--primary, #2563eb);
    font-weight: 600;
    white-space: nowrap;
}

.formula-legend {
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.4rem 1rem;
}

.formula-legend li {
    font-size: 0.875rem;
    color: var(--text-muted, #64748b);
}

.formula-legend strong {
    color: var(--text, #1e293b);
}

/* Responsive */
@media (max-width: 600px) {
    .tipo-tabs {
        gap: 0.4rem;
    }

    .tipo-tab {
        flex: 1 1 auto;
        justify-content: center;
        font-size: 0.8rem;
        padding: 0.5rem 0.6rem;
    }

    .test-controls {
        flex-direction: column;
    }

    .btn-test {
        width: 100%;
        justify-content: center;
    }

    .speed-bar-label {
        min-width: 100px;
        font-size: 0.72rem;
    }

    .formula-legend {
        grid-template-columns: 1fr;
    }
}