/**
 * Layout de escritorio (PC) — no afecta celular (<1024px).
 * Debe cargarse DESPUÉS de StudentDashboard.css y pantallas.
 */

@media (min-width: 1024px) {
    :root {
        --vareso-desktop-max: 1120px;
        --vareso-desktop-gutter: 1.5rem;
        --vareso-scroll-end: calc(2rem + env(safe-area-inset-bottom, 0px));
        --vareso-scroll-end-fallback: calc(2rem + env(safe-area-inset-bottom, 0px));
    }

    /* —— Shell más contenido, tipografía un poco más chica —— */
    body {
        font-size: 15px !important;
    }

    .app-header {
        padding: 0.45rem 0 !important;
    }

    .app-header .container,
    nav .container,
    main.container {
        max-width: var(--vareso-desktop-max) !important;
        width: 100%;
        margin-left: auto;
        margin-right: auto;
        padding-left: var(--vareso-desktop-gutter) !important;
        padding-right: var(--vareso-desktop-gutter) !important;
    }

    main.container {
        padding-top: 0.85rem !important;
        padding-bottom: var(--vareso-scroll-end-fallback) !important;
        padding-bottom: var(--vareso-scroll-end) !important;
    }

    main,
    main.container {
        padding-bottom: var(--vareso-scroll-end-fallback) !important;
        padding-bottom: var(--vareso-scroll-end) !important;
    }

    nav .container {
        overflow-x: visible;
    }

    nav .flex {
        flex-wrap: wrap;
        min-width: 0;
        gap: 0.15rem 0.35rem;
    }

    nav button {
        padding: 0.55rem 1rem !important;
        font-size: 0.9rem !important;
    }

    .app-brand-title,
    .app-header h1 {
        font-size: 1.2rem !important;
    }

    .app-brand-mark {
        width: 34px !important;
        height: 34px !important;
    }

    .bg-white.rounded-lg {
        padding: 1rem !important;
    }

    .user-menu-container button span,
    .user-menu-container button .fa-chevron-down,
    .apps-menu > button span,
    .apps-menu > button .fa-chevron-down {
        display: inline !important;
    }

    /* —— Aula —— */
    .student-dashboard {
        max-width: var(--vareso-desktop-max) !important;
        padding: 18px 22px 28px !important;
        border-radius: 14px;
        min-height: calc(100vh - 10rem);
    }

    .dashboard-header {
        margin-bottom: 1rem !important;
    }

    .dashboard-title {
        font-size: 1.35rem !important;
    }

    .category-tabs {
        justify-content: flex-start !important;
        gap: 8px !important;
        margin-bottom: 1rem !important;
    }

    .category-tabs-hub .category-tab,
    .category-tabs-three .category-tab,
    .category-tab {
        flex: 0 1 auto !important;
        max-width: none !important;
        min-width: 140px;
        padding: 9px 18px !important;
        font-size: 0.9rem !important;
    }

    /* Grilla de Mis cursos (pisa el flex columna del CSS móvil) */
    .student-dashboard .mis-cursos-list {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 14px !important;
        flex-direction: unset !important;
    }

    .student-dashboard .mis-curso-card {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0 !important;
        min-height: 0 !important;
        height: auto !important;
    }

    .student-dashboard .mis-curso-cover {
        width: 100% !important;
        height: 120px !important;
        min-height: 120px !important;
        max-height: 120px !important;
        background-size: cover !important;
        background-position: center center !important;
        background-repeat: no-repeat !important;
        font-size: 1.75rem !important;
    }

    .student-dashboard .mis-curso-body {
        padding: 12px 14px 14px !important;
    }

    .student-dashboard .mis-curso-body h3 {
        font-size: 1rem !important;
    }

    .student-dashboard .mis-curso-body p,
    .student-dashboard .mis-curso-open {
        font-size: 0.8rem !important;
    }

    /* Biblioteca: más densa, thumbs sin “comerse” el ícono */
    .student-dashboard .materials-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 14px !important;
    }

    .student-dashboard .material-card {
        display: flex !important;
        flex-direction: column !important;
        min-height: 0 !important;
    }

    .student-dashboard .material-thumbnail {
        height: 112px !important;
        min-height: 112px !important;
        max-height: 112px !important;
        padding: 10px !important;
        box-sizing: border-box !important;
    }

    .student-dashboard .material-thumbnail img {
        width: 100% !important;
        height: 100% !important;
        max-height: 100% !important;
        object-fit: contain !important;
        object-position: center !important;
    }

    /* Fotos reales de materiales: cubrir sin deformar el área */
    .student-dashboard .material-card[data-type="video"] .material-thumbnail,
    .student-dashboard .material-card[data-type="imagen"] .material-thumbnail {
        padding: 0 !important;
    }

    .student-dashboard .material-card[data-type="video"] .material-thumbnail img,
    .student-dashboard .material-card[data-type="imagen"] .material-thumbnail img {
        object-fit: cover !important;
    }

    .student-dashboard .material-content {
        padding: 12px 14px 14px !important;
    }

    .student-dashboard .material-title {
        font-size: 0.95rem !important;
    }

    .student-dashboard .material-description {
        font-size: 0.8rem !important;
        -webkit-line-clamp: 2;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .student-dashboard .library-filters-sticky {
        margin-bottom: 0.85rem !important;
    }

    .student-dashboard .filters-toggle-btn {
        max-width: 220px;
        width: auto !important;
        justify-content: flex-start !important;
        padding: 8px 12px !important;
        font-size: 0.85rem !important;
    }

    .student-dashboard .library-filters-panel {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 10px 14px !important;
        padding: 12px 14px !important;
    }

    .student-dashboard .search-bar {
        max-width: 360px;
    }

    /* —— Tienda Cursos —— */
    .courses-store {
        max-width: var(--vareso-desktop-max) !important;
        padding: 0.75rem 0.25rem !important;
    }

    .courses-store h2 {
        font-size: 1.35rem !important;
    }

    .courses-store > .mb-6 {
        display: block !important;
        margin-bottom: 1rem !important;
    }

    .courses-store .flex.gap-2.mb-6 button {
        padding: 0.45rem 0.9rem !important;
        font-size: 0.85rem !important;
    }

    .courses-store .courses-store-catalog {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 1rem !important;
    }

    .courses-store .courses-store-catalog .h-40 {
        height: 7.5rem !important;
    }

    .courses-store .courses-store-catalog img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        object-position: center center !important;
    }

    .courses-store .courses-store-catalog h3 {
        font-size: 1.05rem !important;
    }

    .courses-store .courses-store-catalog .p-4 {
        padding: 0.85rem !important;
    }

    .courses-store .courses-store-mine {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.85rem !important;
    }

    .courses-store .courses-store-mine > p {
        grid-column: 1 / -1;
    }

    .courses-store .rounded-xl.border:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 22px rgba(11, 36, 71, 0.1);
    }

    /* —— Player / Tutor / Notas —— */
    .course-player {
        max-width: var(--vareso-desktop-max) !important;
        padding: 0.75rem 0.25rem !important;
    }

    .course-player h2 {
        font-size: 1.35rem !important;
    }

    .course-player .course-player-modules {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.85rem !important;
    }

    .course-player .course-player-modules > p {
        grid-column: 1 / -1;
    }

    .tutor-screen {
        max-width: var(--vareso-desktop-max) !important;
    }

    .notes-screen-container {
        max-width: var(--vareso-desktop-max);
        margin-left: auto;
        margin-right: auto;
    }
}

@media (min-width: 1280px) {
    :root {
        --vareso-desktop-max: 1240px;
    }

    .student-dashboard .mis-cursos-list {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    .student-dashboard .materials-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }

    .courses-store .courses-store-catalog {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    .courses-store .courses-store-mine {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    .course-player .course-player-modules {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}
