/* ==========================================================================
   MIMETAPLUS - TABLET OPTIMIZATION STYLESHEET (Clean & Refactored MVC)
   Ajustes ergonómicos de escala visual, tipografía y contenedores para tablets.
   Afecta de forma aislada al rango de tablet sin alterar teléfonos ni pantallas de PC.
   ========================================================================== */

/* ==========================================================================
   1. TABLET UNIVERSAL: RETRATO, PAISAJE Y TABLETS DE GRAN FORMATO (768px a 1366px)
   (Soporta iPad 10.2", iPad Air/Pro 11", iPad Pro 12.9", Samsung Galaxy Tab S7/S8/S9 FE/+)
   ========================================================================== */
@media screen and (min-width: 768px) and (max-width: 1024px),
       screen and (min-width: 1025px) and (max-width: 1366px) and (orientation: landscape),
       screen and (min-width: 1025px) and (max-width: 1366px) and (max-height: 950px),
       screen and (min-width: 768px) and (max-width: 1400px) and (pointer: coarse) {

    /* --- Factor de Escala Armónico para Tablet --- */
    html {
        font-size: 14px !important; /* Reduce en 12.5% proporcionalmente todos los 'rem' para formato tablet ergonómico */
    }

    body {
        padding-bottom: 60px;
    }

    /* --- Contenedores Principales de Página --- */
    .main-container {
        padding-top: 75px;
        padding-bottom: 1.5rem;
    }

    .content-container {
        max-width: 100%;
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .test-container {
        max-width: 760px;
        padding-top: 75px;
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    .test-container.curso-page {
        max-width: 100%;
        padding: 3.8rem 1.5rem 1.5rem 1.5rem;
    }

    /* --- Barra de Navegación Superior --- */
    .top-navbar {
        height: 56px;
    }

    .navbar-inner {
        padding: 0 1.25rem;
        max-width: 100%;
    }

    .navbar-logo {
        height: 34px;
        left: 1.25rem;
    }

    .nav-item {
        font-size: 0.88rem;
        padding: 0.35rem 0.55rem;
    }

    .navbar-right {
        gap: 0.5rem;
    }

    .profile-circle {
        width: 38px;
        height: 38px;
        font-size: 0.95rem;
    }

    /* --- Dashboard y Cabeceras --- */
    .test-header .dashboard-logo,
    img.dashboard-logo,
    .dashboard-logo {
        max-width: 320px !important;
        margin-bottom: 0.5rem;
    }

    .dashboard-tools {
        top: 10px;
        right: 15px;
        gap: 0.85rem;
    }

    .test-header {
        margin-bottom: 2rem;
        padding-bottom: 1rem;
    }

    .test-header h1 {
        font-size: 1.5rem;
    }

    .test-header p {
        font-size: 0.95rem;
    }

    .test-header .block-subtitle {
        font-size: 1.25rem;
        margin-bottom: 0.6rem;
    }

    /* --- Rejilla de Cursos (Dashboard) --- */
    .menu-container {
        gap: 1.25rem;
        padding: 0.75rem 0;
    }

    .menu-container .block-card,
    .block-card {
        flex: 0 1 calc(50% - 0.75rem);
        max-width: calc(50% - 0.75rem);
    }

    .course-card-image-container {
        height: 80px;
    }

    .course-card-content {
        padding: 0.5rem 0.85rem;
    }

    .block-card h2 {
        font-size: 1.15rem;
        margin-bottom: 0.35rem;
    }

    .block-card p {
        font-size: 0.88rem;
        line-height: 1.35;
    }

    /* --- Entorno de Tests y Preguntas --- */
    .question-card {
        padding: 1.35rem 1.6rem;
        margin-bottom: 1.75rem;
        border-radius: var(--border-radius-md);
    }

    .question-header {
        margin-bottom: 1.1rem;
    }

    .question-header .q-text {
        font-size: 1.05rem;
        line-height: 1.45;
    }

    .answers {
        margin-bottom: 1.1rem;
    }

    .answers li {
        padding: 0.85rem 1.1rem;
        margin-bottom: 0.65rem;
        font-size: 0.95rem;
        min-height: 44px; /* Ergonomía táctil Apple / Google */
    }

    .answers li .ans-letter {
        width: 28px;
        height: 28px;
        font-size: 0.82rem;
        margin-right: 0.9rem;
    }

    .test-controls-top {
        margin-bottom: 1.25rem;
    }

    .controls {
        gap: 0.75rem;
    }

    .test-navigation-footer {
        margin-top: 2rem;
        padding-top: 1.25rem;
    }

    .nav-test-btn {
        padding: 0.5rem 0.85rem;
        font-size: 0.9rem;
    }

    /* Botón flotante Cuaderno / Notas */
    .cuaderno-launcher-btn {
        display: flex !important;
        left: 16px !important;
        bottom: 16px !important;
        width: 44px !important;
        height: 44px !important;
    }

    .notebook-floating-modal {
        width: 420px;
        max-width: 90vw;
    }

    /* --- Listas de Temas y Bloques --- */
    .topic-list {
        gap: 0.75rem;
    }

    .topic-item {
        padding: 0.85rem 1.1rem;
        gap: 0.75rem;
    }

    .topic-card-content {
        padding: 0.85rem 1.1rem;
        gap: 0.75rem;
    }

    /* --- Página de Ajustes --- */
    .settings-layout {
        gap: 20px;
    }

    .settings-nav {
        flex: 0 0 180px;
    }

    .settings-nav ul li a {
        padding: 10px 14px;
        font-size: 0.9rem;
    }

    .settings-content {
        flex: 1;
        min-width: 0;
        max-width: 100%;
    }

    .settings-section {
        padding: 20px;
    }

    /* --- Ranking y Estadísticas --- */
    .ranking-container {
        padding: 0 1rem 2rem 1rem;
    }

    .ranking-header {
        margin-bottom: 2rem;
    }

    .ranking-header h1 {
        font-size: 1.85rem;
    }

    .ranking-header p {
        font-size: 0.95rem;
    }

    .ranking-layout {
        grid-template-columns: 260px 1fr;
        gap: 1.5rem;
    }

    /* --- Fichas 3D --- */
    .scene {
        max-width: 720px;
        height: 310px;
    }

    .fichas-container h1 {
        font-size: 1.75rem;
    }
}

/* ==========================================================================
   2. REFINAMIENTO PARA TABLET EN MODO HORIZONTAL (LANDSCAPE)
   (Optimizado para Samsung Tab S7 FE, iPad Pro 11"/12.9" y tablets de 1024px a 1366px)
   ========================================================================== */
@media screen and (min-width: 768px) and (max-width: 1366px) and (orientation: landscape),
       screen and (min-width: 768px) and (max-width: 1400px) and (orientation: landscape) and (pointer: coarse) {
    .test-header {
        margin-bottom: 1.5rem;
    }

    .test-header .dashboard-logo,
    img.dashboard-logo,
    .dashboard-logo {
        max-width: 260px !important;
    }

    .question-card {
        padding: 1.2rem 1.5rem;
        margin-bottom: 1.25rem;
    }

    .answers li {
        padding: 0.75rem 1rem;
        margin-bottom: 0.55rem;
    }

    /* En horizontal en tablet, optimizar tarjetas para 3 columnas balanceadas sin verse gigantes */
    .menu-container {
        gap: 1.25rem;
        max-width: 1080px;
        margin-left: auto;
        margin-right: auto;
    }

    .menu-container .block-card,
    .block-card {
        flex: 0 1 calc(33.333% - 0.9rem);
        max-width: 320px;
        min-width: 250px;
    }
}

