* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    overflow-x: hidden;
    background: #f5f5f5;
}

/* Header - Copiado de campus.css */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 110px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 70px 0 50px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
    z-index: 1000;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 40px;
}

.logo .logo-full {
    height: 90px;
}

.logo .logo-icon {
    height: 60px;
}

.logo img {
    transition: opacity 0.3s ease;
}

.header.sidebar-collapsed .logo {
    margin-left: -40px;
}

.menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: 0.3s;
}

.menu-toggle svg {
    width: 36px;
    height: 36px;
    stroke: #0088cc;
    stroke-width: 2.5;
}

.menu-toggle:hover {
    background: #f0f5f8;
    border-radius: 6px;
}

.header-buttons {
    display: flex;
    gap: 25px;
    align-items: center;
}

/* Auth Buttons */
.auth-buttons {
    display: flex;
    gap: 20px;
    align-items: center;
}

.btn-login {
    background: #0088cc;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 28px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn-login:hover {
    background: #0077b3;
}

.btn-register {
    background: #6c757d;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 28px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn-register:hover {
    background: #5a6268;
}

/* Sidebar - Copiado de campus.css */
.sidebar {
    position: fixed;
    left: 0;
    top: 110px;
    width: 320px;
    height: calc(100vh - 110px);
    background: #f8f9fa;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 30px 0;
    z-index: 999;
    transition: width 0.3s ease;
    overflow: hidden;
}

.sidebar.collapsed {
    width: 80px;
}

.sidebar.collapsed .nav-item span {
    opacity: 0;
    width: 0;
}

.sidebar.collapsed .sidebar-footer {
    opacity: 0;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 18px 25px 18px 30px;
    color: #7a7a7a;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 16px;
    font-weight: 400;
    white-space: nowrap;
}

.nav-item span {
    transition: opacity 0.3s ease, width 0.3s ease;
}

.nav-indicator {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: transparent;
    transition: background 0.2s;
    border-radius: 0 2px 2px 0;
}

.nav-item:hover {
    background: #eff2f5;
}

.nav-item.active {
    color: #0088cc;
    background: #e8f4f8;
}

.nav-item.active .nav-indicator {
    background: #0088cc;
}

.icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    stroke-width: 2.2;
}

.sidebar-footer {
    padding: 0 25px;
    font-size: 10px;
    color: #b0b0b0;
    line-height: 1.6;
    transition: opacity 0.3s ease;
}

/* Divisor del sidebar */
.sidebar-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 20px 25px;
    transition: opacity 0.3s ease;
}

.sidebar.collapsed .sidebar-divider {
    opacity: 0;
}

/* Navegación secundaria */
.sidebar-nav-secondary {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: auto;
}

.nav-item-secondary {
    opacity: 0.85;
}

.nav-item-secondary:hover {
    opacity: 1;
    background: #e8f4f8;
}

.nav-item-secondary .icon {
    stroke-width: 2.5;
}

/* Main Content */
.main-content {
    margin-left: 320px;
    margin-top: 110px;
    min-height: calc(100vh - 110px);
    transition: margin-left 0.3s ease;
}

.main-content.expanded {
    margin-left: 80px;
}

/* Material Section */
.material-section {
    padding: 40px 60px;
    max-width: 1400px;
    margin: 0 auto;
}

.section-title {
    color: #2c3e50;
    font-size: 36px;
    font-weight: 600;
    margin-bottom: 40px;
    text-align: center;
}

/* Video de Introducción */
.video-container {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 50px;
}

.video-title {
    color: #0088cc;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
}

.video-container .plyr {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

.video-container video {
    width: 100%;
    max-width: 900px;
    border-radius: 12px;
    display: block;
    margin: 0 auto;
}

/* Quitar límites cuando el video está en pantalla completa */
.video-container .plyr--fullscreen-fallback,
.video-container .plyr:fullscreen,
.video-container .plyr:-webkit-full-screen {
    max-width: none !important;
    margin: 0 !important;
}

.video-container .plyr--fullscreen-fallback video,
.video-container .plyr:fullscreen video,
.video-container .plyr:-webkit-full-screen video {
    max-width: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
}

/* Cápsulas */
.capsulas-container {
    margin-top: 50px;
    margin-bottom: 50px;
    position: relative;
}

.capsulas-title {
    color: #2c3e50;
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 30px;
    text-align: center;
}

.capsulas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.capsula-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.capsula-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.capsula-number {
    width: 40px;
    height: 40px;
    background: #0088cc;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 15px;
}

.capsula-thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 15px;
    background: #000;
}

.capsula-thumbnail video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    transition: background 0.3s ease;
}

.capsula-card:hover .play-overlay {
    background: rgba(0, 0, 0, 0.5);
}

.play-overlay svg {
    width: 60px;
    height: 60px;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease;
}

.capsula-card:hover .play-overlay svg {
    transform: scale(1.1);
}

.capsula-card h3 {
    color: #2c3e50;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    min-height: 40px;
}

/* Overlay de bloqueo */
.locked-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    z-index: 10;
}

.locked-content {
    text-align: center;
    padding: 40px;
    max-width: 400px;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.locked-content svg {
    width: 80px;
    height: 80px;
    stroke: #0088cc;
    margin-bottom: 20px;
}

.locked-content h3 {
    color: #2c3e50;
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 15px;
}

.locked-content p {
    color: #7a7a7a;
    font-size: 16px;
    margin-bottom: 30px;
}

/* Mensaje para usuarios no logueados */
.login-required {
    background: white;
    border-radius: 16px;
    padding: 60px 40px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-top: 50px;
}

.login-required svg {
    width: 80px;
    height: 80px;
    stroke: #0088cc;
    margin-bottom: 20px;
}

.login-required h3 {
    color: #2c3e50;
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 15px;
}

.login-required p {
    color: #7a7a7a;
    font-size: 16px;
    margin-bottom: 30px;
}

.btn-login-required {
    background: #0088cc;
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 28px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn-login-required:hover {
    background: #0077b3;
}

/* User Dropdown - Copiado de campus.css */
.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background 0.2s;
    position: relative;
}

.user-info:hover {
    background: rgba(0, 0, 0, 0.05);
}

.user-avatar-default {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-avatar-default svg.avatar-placeholder {
    width: 24px;
    height: 24px;
    stroke: #9ca3af;
}

.user-avatar-default .avatar-img-small {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
}

.user-role {
    font-size: 12px;
    color: #6b7280;
}

.dropdown-arrow {
    width: 16px;
    height: 16px;
    stroke: #6b7280;
    transition: transform 0.3s;
}

.user-info:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    min-width: 240px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.user-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #4b5563;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    border-radius: 8px;
    margin: 4px 8px;
}

.dropdown-item:first-child {
    margin-top: 8px;
}

.dropdown-item:last-child {
    margin-bottom: 8px;
}

.dropdown-item:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.dropdown-item.logout {
    color: #ef4444;
}

.dropdown-item.logout:hover {
    background: #fef2f2;
    color: #dc2626;
}

.dropdown-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.dropdown-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 8px 12px;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0 !important;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 0 15px;
        height: 70px;
    }

    .header-left {
        gap: 15px;
    }

    .logo .logo-full {
        height: 50px;
    }

    .menu-toggle {
        width: 44px;
        height: 44px;
    }

    .menu-toggle svg {
        width: 28px;
        height: 28px;
    }

    .sidebar {
        top: 70px;
        height: calc(100vh - 70px);
        width: 280px;
    }

    .main-content {
        margin-top: 70px;
        min-height: calc(100vh - 70px);
    }

    .material-section {
        padding: 30px 20px;
    }

    .section-title {
        font-size: 28px;
    }

    .video-container {
        padding: 20px;
    }

    .video-title {
        font-size: 20px;
    }

    .capsulas-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .user-details {
        display: none;
    }

    .btn-login,
    .btn-register {
        padding: 12px 24px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 0 12px;
        height: 65px;
    }

    .logo .logo-full {
        height: 45px;
    }

    .menu-toggle {
        width: 40px;
        height: 40px;
    }

    .menu-toggle svg {
        width: 24px;
        height: 24px;
    }

    .sidebar {
        top: 65px;
        height: calc(100vh - 65px);
        width: 260px;
    }

    .main-content {
        margin-top: 65px;
        min-height: calc(100vh - 65px);
    }

    .material-section {
        padding: 20px 15px;
    }

    .section-title {
        font-size: 24px;
        margin-bottom: 30px;
    }

    .video-container {
        padding: 15px;
    }

    .video-title {
        font-size: 18px;
        margin-bottom: 15px;
    }

    .capsulas-title {
        font-size: 22px;
    }

    .capsula-card {
        padding: 20px;
    }

    .login-required {
        padding: 40px 20px;
    }

    .login-required svg {
        width: 60px;
        height: 60px;
    }

    .login-required h3 {
        font-size: 22px;
    }

    .btn-login,
    .btn-register {
        padding: 10px 18px;
        font-size: 13px;
    }

    .header-buttons {
        gap: 12px;
    }
}

/* Thumbnail de introducción */
.intro-thumbnail {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    aspect-ratio: 16/9;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    background: #000;
}

.intro-thumbnail video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Modal de Video */
.video-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.video-modal.active {
    opacity: 1;
    visibility: visible;
}

.video-modal-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.video-modal.active .video-modal-content {
    transform: scale(1);
}

.video-modal-close {
    position: absolute;
    top: -50px;
    right: 0;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    z-index: 10;
}

.video-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.video-modal-close svg {
    width: 24px;
    height: 24px;
    stroke: white;
}

.video-modal-content video {
    width: 100%;
    border-radius: 8px;
}

/* Responsive para modal */
@media (max-width: 768px) {
    .video-modal-content {
        width: 95%;
    }

    .video-modal-close {
        top: -45px;
        width: 36px;
        height: 36px;
    }

    .video-modal-close svg {
        width: 20px;
        height: 20px;
    }
}


/* Personalización de Plyr */
.plyr {
    --plyr-color-main: #0088cc;
    --plyr-video-background: transparent;
    --plyr-menu-background: rgba(255, 255, 255, 0.95);
    --plyr-menu-color: #2c3e50;
}

.plyr--video {
    border-radius: 12px;
    overflow: hidden;
}

.plyr--video .plyr__video-wrapper {
    background: transparent;
}

.plyr__video-wrapper video {
    object-fit: cover;
    width: 100%;
    height: 100%;
}

/* Estilos para Plyr en pantalla completa (fullscreen) */
.plyr--fullscreen-fallback,
.plyr:fullscreen,
.plyr:-webkit-full-screen,
.plyr:-moz-full-screen,
.plyr:-ms-fullscreen {
    max-width: none !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 0 !important;
}

.plyr--fullscreen-fallback video,
.plyr:fullscreen video,
.plyr:-webkit-full-screen video,
.plyr:-moz-full-screen video,
.plyr:-ms-fullscreen video {
    max-width: none !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    border-radius: 0 !important;
    background: #000;
}

.plyr--fullscreen-fallback .plyr__video-wrapper,
.plyr:fullscreen .plyr__video-wrapper,
.plyr:-webkit-full-screen .plyr__video-wrapper,
.plyr:-moz-full-screen .plyr__video-wrapper,
.plyr:-ms-fullscreen .plyr__video-wrapper {
    width: 100% !important;
    height: 100% !important;
    background: #000 !important;
}

.plyr__control--overlaid {
    background: rgba(0, 136, 204, 0.9);
}

.plyr__control--overlaid:hover {
    background: #0088cc;
}

.plyr__control:hover {
    background: rgba(0, 136, 204, 0.1);
}

.plyr__menu__container {
    border-radius: 8px;
}

.plyr__menu__container .plyr__control[role='menuitemradio'][aria-checked='true']::before {
    background: #0088cc;
}

/* Deshabilitar menú contextual */
.plyr video {
    pointer-events: none;
}

.plyr__controls {
    pointer-events: auto;
}

/* Responsive Plyr */
@media (max-width: 768px) {
    .plyr__control {
        padding: 8px;
    }
    
    .plyr__controls {
        padding: 10px;
    }
}

/* ===== Modal de Inicio de Sesión ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 50px 60px;
    max-width: 500px;
    width: 90%;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border: none;
    background: #e0e0e0;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.modal-close:hover {
    background: #d0d0d0;
}

.modal-close svg {
    width: 20px;
    height: 20px;
    stroke: #666;
}

.modal-header {
    text-align: center;
    margin-bottom: 35px;
}

.modal-header h2 {
    color: #2c3e50;
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 10px;
}

.modal-header p {
    color: #7a7a7a;
    font-size: 16px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-group label {
    color: #7a7a7a;
    font-size: 14px;
    font-weight: 500;
}

.form-group input {
    padding: 15px 20px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #0088cc;
}

.password-input {
    position: relative;
}

.password-input input {
    width: 100%;
    padding-right: 50px;
}

.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: #f0f0f0;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.toggle-password:hover {
    background: #e0e0e0;
}

.toggle-password svg {
    width: 18px;
    height: 18px;
    stroke: #666;
}

.btn-submit {
    background: #22c55e;
    color: white;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    margin-top: 10px;
}

.btn-submit:hover {
    background: #16a34a;
}

.modal-footer {
    text-align: center;
    margin-top: 20px;
}

.modal-footer p {
    color: #7a7a7a;
    font-size: 14px;
    margin-bottom: 10px;
}

.link-register {
    color: #2c3e50;
    font-weight: 600;
    text-decoration: none;
}

.link-register:hover {
    text-decoration: underline;
}

.link-forgot {
    color: #7a7a7a;
    font-size: 14px;
    text-decoration: none;
    font-weight: 600;
}

.link-forgot:hover {
    text-decoration: underline;
}

/* Responsive modal */
@media (max-width: 480px) {
    .modal-content {
        padding: 30px 25px;
    }

    .modal-header h2 {
        font-size: 24px;
    }
}
