/* Estilos para el sistema LMS */

/* Modal de Login */
.lms-modal {
    display: flex;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.5s ease-out;
}

.lms-modal-content {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.lms-modal-content h2 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 2rem;
    text-align: center;
}

.lms-modal-content p {
    text-align: center;
    color: #7f8c8d;
    margin-bottom: 25px;
}

#loginForm {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#loginForm input {
    padding: 15px;
    font-size: 1rem;
    border: 2px solid #ecf0f1;
    border-radius: 6px;
    transition: border-color 0.3s;
}

#loginForm input:focus {
    outline: none;
    border-color: #e91e63;
}

#loginForm button {
    padding: 12px 18px;
    font-size: 1.05rem;
    background: linear-gradient(90deg, #ff5f7a 0%, #e91e63 100%);
    color: #fff;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 700;
    transition: transform 0.18s cubic-bezier(.2,.9,.3,1), box-shadow 0.18s;
    box-shadow: 0 6px 18px rgba(233,30,99,0.18);
}

#loginForm button:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 12px 28px rgba(233,30,99,0.18);
}

/* Botón de credenciales demo */
#useDemoBtn {
    padding: 12px 16px;
    font-size: 1rem;
    background: linear-gradient(90deg,#2ecc71 0%,#27ae60 100%);
    color: #fff;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 700;
    box-shadow: 0 6px 18px rgba(39,174,96,0.18);
    transition: transform 0.18s, box-shadow 0.18s;
}
#useDemoBtn:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(39,174,96,0.18); }

.login-note {
    font-size: 0.85rem !important;
    color: #95a5a6 !important;
    margin-top: 15px !important;
}

/* Botón de Logout */
.btn-logout {
    background: #e74c3c;
    color: #fff;
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
}

.btn-logout:hover {
    background: #c0392b;
    transform: scale(1.05);
}

/* Sección Mis Cursos */
#mis-cursos-section {
    margin-top: 100px;
    padding: 60px 0;
    min-height: calc(100vh - 300px);
}

.user-welcome {
    text-align: center;
    margin-bottom: 50px;
}

.user-welcome h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 10px;
}

.user-welcome h1 span {
    color: #e91e63;
}

.user-welcome p {
    font-size: 1.1rem;
    color: #7f8c8d;
}

/* Grid de Cursos LMS */
.lms-courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.lms-course-card {
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 22px rgba(23, 31, 47, 0.06);
    transition: transform 0.28s cubic-bezier(.2,.9,.3,1), box-shadow 0.28s;
    cursor: pointer;
}

.lms-course-card:hover {
    transform: translateY(-10px) scale(1.01);
    box-shadow: 0 20px 40px rgba(23,31,47,0.12);
}

.lms-course-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.lms-course-info {
    padding: 24px 26px 28px 26px;
}

.lms-course-info h3 {
    font-size: 1.6rem;
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: 600;
}

.lms-course-info .purchased-badge {
    margin-left: 0;
    display: inline-block;
    vertical-align: middle;
    margin-top: 8px;
}

.lms-course-info p {
    font-size: 1rem;
    color: #7f8c8d;
    margin-bottom: 20px;
    line-height: 1.6;
}

.course-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #ecf0f1;
}

.course-lessons {
    font-size: 0.9rem;
    color: #95a5a6;
}

.btn-access-course {
    background: linear-gradient(90deg,#7b4dff 0%,#b04bff 100%);
    color: #fff;
    padding: 10px 18px;
    border: none;
    border-radius: 999px;
    font-size: 0.98rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s, box-shadow 0.18s;
}

.btn-access-course:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 12px 28px rgba(123,77,255,0.14);
}

/* Modal del Visualizador de Curso */
.course-viewer {
    max-width: 95%;
    width: 1400px;
    max-height: 95vh;
    overflow-y: auto;
    padding: 30px;
}

.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    background: #e74c3c;
    color: #fff;
    border: none;
    font-size: 2rem;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close-btn:hover {
    background: #c0392b;
    transform: rotate(90deg);
}

.course-header {
    margin-bottom: 30px;
}

.course-header h2 {
    font-size: 2.2rem;
    color: #2c3e50;
    margin-bottom: 10px;
}

.course-header p {
    font-size: 1.1rem;
    color: #7f8c8d;
}

/* Layout de Contenido del Curso */
.course-content-wrapper {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
}

/* Sección de Video */
.video-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.video-container {
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 16/9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-placeholder {
    color: #fff;
    font-size: 1.2rem;
}

.video-container iframe,
.video-container video {
    width: 100%;
    height: 100%;
    border: none;
}

/* Código Anti-Piratería */
.antipiracy-code {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    border-radius: 8px;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.antipiracy-code p {
    margin-bottom: 10px;
}

.antipiracy-code p:first-child {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.code-display {
    background: rgba(255, 255, 255, 0.2);
    padding: 15px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: bold;
    text-align: center;
    letter-spacing: 2px;
    margin: 15px 0;
    border: 2px dashed rgba(255, 255, 255, 0.5);
}

.antipiracy-warning {
    font-size: 0.85rem;
    line-height: 1.5;
    margin-top: 15px;
    opacity: 0.95;
}

/* Barra lateral de Lecciones */
.lessons-sidebar {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    max-height: 700px;
    overflow-y: auto;
}

.lessons-sidebar h3 {
    font-size: 1.3rem;
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e91e63;
}

.lesson-item {
    background: #fff;
    padding: 15px;
    margin-bottom: 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    border-left: 4px solid transparent;
}

.lesson-item:hover {
    border-left-color: #e91e63;
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.lesson-item.active {
    border-left-color: #e91e63;
    background: #fce4ec;
}

.lesson-number {
    font-weight: 600;
    color: #e91e63;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.lesson-title {
    font-size: 1rem;
    color: #2c3e50;
    font-weight: 500;
}

.lesson-duration {
    font-size: 0.85rem;
    color: #95a5a6;
    margin-top: 5px;
}

.lesson-desc {
    font-size: 0.8rem;
    color: #95a5a6;
    margin-top: 6px;
    line-height: 1.4;
    font-style: italic;
}

/* Responsividad */
@media (max-width: 1024px) {
    .course-content-wrapper {
        grid-template-columns: 1fr;
    }
    
    .lessons-sidebar {
        max-height: 400px;
    }
    
    .course-viewer {
        width: 95%;
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .user-welcome h1 {
        font-size: 2rem;
    }
    
    .lms-courses-grid {
        grid-template-columns: 1fr;
    }
    
    .course-header h2 {
        font-size: 1.6rem;
    }
    
    .modal-close-btn {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
        font-size: 1.5rem;
    }
}

/* Scrollbar personalizado para la barra de lecciones */
.lessons-sidebar::-webkit-scrollbar {
    width: 8px;
}

.lessons-sidebar::-webkit-scrollbar-track {
    background: #ecf0f1;
    border-radius: 4px;
}

.lessons-sidebar::-webkit-scrollbar-thumb {
    background: #e91e63;
    border-radius: 4px;
}

.lessons-sidebar::-webkit-scrollbar-thumb:hover {
    background: #d81b60;
}
