@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #2EBDEF;
    --secondary: #1C9CD9;
    --dark: #274292;
    --light: #F0F9FF;
    --white: #FFFFFF;
    --gray: #6B7280;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    background: linear-gradient(135deg, #F0F9FF 0%, #E0F2FE 100%);
    min-height: 100vh;
    color: #1F2937;
}

/* ========== LOGIN ========== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--dark) 0%, var(--secondary) 100%);
    padding: 20px;
}

.login-card {
    background: var(--white);
    border-radius: 24px;
    padding: 48px 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 25px 50px -12px rgba(39, 66, 146, 0.25);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 4px;
}

.login-logo p {
    font-size: 14px;
    color: var(--gray);
    font-weight: 500;
}

.login-logo .brand-accent {
    color: var(--primary);
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: #1F2937;
    transition: all 0.3s ease;
    outline: none;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(46, 189, 239, 0.15);
}

.form-input::placeholder {
    color: #9CA3AF;
    font-weight: 400;
}

.btn-primary {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(46, 189, 239, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.alert {
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
}

.alert-error {
    background: #FEF2F2;
    color: var(--danger);
    border: 1px solid #FECACA;
}

.alert-success {
    background: #ECFDF5;
    color: var(--success);
    border: 1px solid #A7F3D0;
}

.login-footer {
    text-align: center;
    margin-top: 28px;
    font-size: 13px;
    color: var(--gray);
}

.login-footer a {
    color: var(--secondary);
    text-decoration: none;
    font-weight: 600;
}

/* ========== DASHBOARD LAYOUT ========== */
.student-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: linear-gradient(180deg, var(--dark) 0%, #1a3170 100%);
    color: var(--white);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 100;
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    scrollbar-width: thin;
    scrollbar-color: rgba(46, 189, 239, 0.35) transparent;
}

.sidebar::-webkit-scrollbar {
    width: 5px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(46, 189, 239, 0.5);
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb:hover,
.sidebar::-webkit-scrollbar-thumb:active {
    background: var(--primary);
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.sidebar-brand {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-brand span {
    color: var(--primary);
}

.brand-full {
    display: inline;
}

.brand-mini {
    display: none;
    font-size: 24px;
}

.sidebar-toggle {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255,255,255,0.1);
    color: var(--white);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.sidebar-toggle:hover {
    background: rgba(255,255,255,0.2);
}

.sidebar-user {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    transition: all 0.35s ease;
}

.sidebar-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
    overflow: hidden;
}

.sidebar-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-user-info {
    overflow: hidden;
    transition: opacity 0.25s ease, width 0.35s ease;
    white-space: nowrap;
}

.sidebar-user-name {
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 12px;
    opacity: 0.7;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 24px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    white-space: nowrap;
}

.nav-label {
    transition: opacity 0.25s ease, width 0.35s ease;
}

.nav-item:hover {
    background: rgba(255,255,255,0.08);
    color: var(--white);
}

.nav-item.active {
    background: rgba(46, 189, 239, 0.15);
    color: var(--primary);
    border-left-color: var(--primary);
}

.nav-item-disabled {
    cursor: not-allowed;
    opacity: 0.6;
    pointer-events: none;
}

.nav-item-disabled:hover {
    background: transparent;
}

.nav-badge {
    margin-left: auto;
    padding: 3px 10px;
    background: linear-gradient(135deg, #10B981, #059669);
    color: white;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.sidebar-collapsed .nav-badge {
    display: none;
}

.nav-icon {
    width: 24px;
    text-align: center;
    font-size: 18px;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    background: rgba(239, 68, 68, 0.15);
    color: #FCA5A5;
    border: none;
    border-radius: 10px;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.3);
}

.btn-theme-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.85);
    border: none;
    border-radius: 10px;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn-theme-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 32px;
    transition: margin-left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 0;
    overflow-x: hidden;
}

/* ========== SIDEBAR COLLAPSED ========== */
.sidebar-collapsed .sidebar {
    width: 70px;
}

.sidebar-collapsed .brand-full,
.sidebar-collapsed .sidebar-user-info,
.sidebar-collapsed .nav-label {
    opacity: 0;
    width: 0;
    pointer-events: none;
}

.sidebar-collapsed .brand-mini {
    display: inline;
}

.sidebar-collapsed .sidebar-header {
    padding: 20px 0;
    justify-content: center;
    gap: 0;
}

.sidebar-collapsed .sidebar-brand {
    display: none;
}

.sidebar-collapsed .sidebar-toggle {
    margin: 0 auto;
}

.sidebar-collapsed .sidebar-user {
    padding: 16px 0;
    justify-content: center;
    gap: 0;
}

.sidebar-collapsed .sidebar-avatar {
    margin: 0 auto;
}

.sidebar-collapsed .nav-item {
    padding: 14px 0;
    justify-content: center;
    gap: 0;
    border-left: none;
}

.sidebar-collapsed .nav-item.active {
    border-left: none;
}

.sidebar-collapsed .nav-icon {
    width: 24px;
    text-align: center;
    margin: 0 auto;
}

.sidebar-collapsed .sidebar-footer {
    padding: 16px 0;
}

.sidebar-collapsed .btn-logout {
    padding: 12px 0;
    justify-content: center;
    gap: 0;
}

.sidebar-collapsed .btn-theme-toggle {
    padding: 12px 0;
    justify-content: center;
    gap: 0;
}

.sidebar-collapsed .main-content {
    margin-left: 70px;
}

/* ========== SIDEBAR MOBILE ========== */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 99;
}

.mobile-hamburger {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 110;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(46, 189, 239, 0.35);
    transition: all 0.3s ease;
    align-items: center;
    justify-content: center;
}

.mobile-hamburger:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(46, 189, 239, 0.5);
}

@media (max-width: 768px) {
    .mobile-hamburger {
        display: flex;
    }

    .sidebar-mobile-open .mobile-hamburger {
        opacity: 0;
        pointer-events: none;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .main-content {
        margin-left: 0;
        padding: 20px;
        padding-top: 72px;
    }
    
    .sidebar-mobile-open .sidebar {
        transform: translateX(0);
    }
    
    .sidebar-mobile-open .sidebar-overlay {
        display: block;
    }
    
    .student-layout {
        flex-direction: column;
    }
}

.page-header {
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 6px;
}

.page-header p {
    font-size: 15px;
    color: var(--gray);
    font-weight: 500;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Dashboard content grid (courses + activity side by side) */
.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 24px;
    max-width: 100%;
}

.dashboard-grid > * {
    min-width: 0;
    overflow-wrap: break-word;
}

@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    background: var(--white);
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    border: 1px solid #E5E7EB;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.08);
}

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.stat-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.stat-icon.blue {
    background: #DBEAFE;
    color: var(--secondary);
}

.stat-icon.green {
    background: #D1FAE5;
    color: var(--success);
}

.stat-icon.orange {
    background: #FEF3C7;
    color: var(--warning);
}

.stat-icon.purple {
    background: #EDE9FE;
    color: #8B5CF6;
}

.stat-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--dark);
    line-height: 1;
}

.stat-subtitle {
    font-size: 13px;
    color: var(--gray);
    margin-top: 8px;
    font-weight: 500;
}

/* Acompañamiento Geard (Bloque 1 del Home) */
.accompaniment-card {
    margin-bottom: 32px;
}

.accompaniment-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.accompaniment-header-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--secondary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.accompaniment-header-text {
    flex: 1;
    min-width: 240px;
}

.accompaniment-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--dark);
}

.accompaniment-subtitle {
    font-size: 14px;
    color: var(--gray);
    margin-top: 4px;
}

.accompaniment-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #EFF6FF;
    color: var(--secondary);
    border-radius: 14px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
}

.accompaniment-badge i {
    font-size: 20px;
}

.accompaniment-badge small {
    font-weight: 500;
}

.accompaniment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0;
}

.accompaniment-item {
    text-align: center;
    padding: 8px 20px;
    border-left: 1px solid #E5E7EB;
}

.accompaniment-item:first-child {
    border-left: none;
}

@media (max-width: 900px) {
    .accompaniment-item {
        border-left: none;
        border-top: 1px solid #E5E7EB;
    }

    .accompaniment-item:first-child {
        border-top: none;
    }
}

.accompaniment-item-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin: 0 auto 14px;
}

.accompaniment-item-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 8px;
    line-height: 1.3;
}

.accompaniment-item-text {
    font-size: 13px;
    color: var(--gray);
    line-height: 1.5;
}

.accompaniment-item-link {
    display: inline-block;
    margin-top: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--secondary);
    text-decoration: none;
}

.accompaniment-item-link:hover {
    text-decoration: underline;
}

/* Mis cursos activos (tarjetas horizontales) */
.view-all-link {
    font-size: 14px;
    font-weight: 600;
    color: var(--secondary);
    text-decoration: none;
}

.view-all-link:hover {
    text-decoration: underline;
}

.active-courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

.active-course-card {
    border: 1px solid #E5E7EB;
    border-radius: 16px;
    padding: 16px;
    display: flex;
    gap: 16px;
    align-items: center;
    transition: all 0.3s ease;
}

.active-course-card:hover {
    box-shadow: 0 10px 20px -5px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.active-course-image {
    width: 84px;
    height: 84px;
    border-radius: 14px;
    flex-shrink: 0;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 28px;
}

.active-course-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.active-course-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.active-course-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--dark);
    line-height: 1.3;
}

.active-course-progress {
    display: flex;
    align-items: center;
    gap: 10px;
}

.active-course-progress .progress-bar {
    flex: 1;
    margin-top: 0;
}

.active-course-progress-pct {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray);
}

.btn-continue {
    align-self: flex-start;
    padding: 10px 22px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--white);
    border: none;
    border-radius: 10px;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.btn-continue:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(46, 189, 239, 0.3);
}

/* Widgets inferiores del Home (racha, logros, actividad) */
.dashboard-widgets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

/* Bloque 2: Mi proceso (ruta de acompañamiento) */
.journey-card {
    margin-bottom: 24px;
}

.journey-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
}

.journey-header-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.journey-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--dark);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.journey-subtitle {
    font-size: 13px;
    color: var(--gray);
    margin-top: 4px;
}

.journey-timeline {
    display: grid;
    grid-template-columns: repeat(var(--journey-steps, 8), 1fr);
    position: relative;
    padding-top: 28px;
    overflow-x: auto;
    gap: 8px;
}

.journey-timeline::before {
    content: '';
    position: absolute;
    top: 55px;
    left: calc(100% / (var(--journey-steps, 8) * 2));
    right: calc(100% / (var(--journey-steps, 8) * 2));
    height: 3px;
    background: #E5E7EB;
    border-radius: 2px;
}

.journey-step {
    text-align: center;
    position: relative;
    padding: 0 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 100px;
}

.journey-step-top {
    position: relative;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.journey-actual-badge {
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    background: #7C3AED;
    color: var(--white);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 10px;
    border-radius: 20px;
    z-index: 2;
    white-space: nowrap;
}

.journey-step-circle {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: #F3F4F6;
    color: #9CA3AF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    position: relative;
    z-index: 1;
    border: 3px solid #E5E7EB;
    flex-shrink: 0;
}

.journey-step-completed .journey-step-circle {
    background: #D1FAE5;
    color: var(--success);
    border-color: #A7F3D0;
}

.journey-step-current .journey-step-circle {
    background: linear-gradient(135deg, #8B5CF6, #7C3AED);
    color: var(--white);
    border-color: #C4B5FD;
    width: 68px;
    height: 68px;
    font-size: 24px;
}

.journey-step-check {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--success);
    color: var(--white);
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--white);
    z-index: 3;
}

.journey-step-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--dark);
    line-height: 1.35;
    margin-bottom: 4px;
    min-height: 32px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.journey-step-state {
    font-size: 11px;
    color: var(--gray);
    line-height: 1.35;
    min-height: 30px;
}

.journey-step-completed .journey-step-state {
    color: var(--success);
    font-weight: 600;
}

.journey-step-current .journey-step-state {
    color: #7C3AED;
    font-weight: 600;
}

/* Tarjeta de la etapa actual */
.journey-current-card {
    display: flex;
    gap: 32px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.journey-current-info {
    display: flex;
    gap: 16px;
    flex: 1;
    min-width: 260px;
}

.journey-current-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: #EDE9FE;
    color: #7C3AED;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.journey-current-title {
    font-size: 17px;
    font-weight: 800;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.journey-etapa-badge {
    background: #EDE9FE;
    color: #7C3AED;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: 20px;
}

.journey-current-text {
    font-size: 13px;
    color: var(--gray);
    line-height: 1.6;
    margin-top: 8px;
}

.journey-current-side {
    flex: 1;
    min-width: 260px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.journey-your-state {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 10px 16px;
}

.journey-your-state-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray);
}

.journey-state-pill {
    background: #D1FAE5;
    color: #065F46;
    font-size: 13px;
    font-weight: 700;
    padding: 5px 14px;
    border-radius: 20px;
}

.journey-question {
    font-size: 14px;
    font-weight: 700;
    color: var(--dark);
}

.journey-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.journey-option-btn {
    padding: 10px 20px;
    border-radius: 10px;
    border: 2px solid #E5E7EB;
    background: var(--white);
    color: var(--dark);
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.journey-option-btn:hover {
    border-color: var(--primary);
    color: var(--secondary);
}

.journey-option-btn.selected {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-color: transparent;
    color: var(--white);
}

.journey-save-feedback {
    font-size: 13px;
    font-weight: 600;
    color: var(--success);
}

.journey-help-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--secondary);
    text-decoration: none;
}

.journey-help-link:hover {
    text-decoration: underline;
}

/* Flujos especiales: OPEC y mensajes condicionales */
.journey-opec-form {
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--dark);
}

.journey-opec-row {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.journey-opec-input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid #E5E7EB;
    border-radius: 10px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    outline: none;
}

.journey-opec-input:focus {
    border-color: var(--primary);
}

.journey-opec-note {
    margin-top: 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--gray);
}

.journey-opec-locked {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 12px;
    padding: 10px 16px;
    font-size: 13px;
    color: #92400E;
}

.journey-opec-locked .journey-opec-note {
    margin-top: 0;
    flex-basis: 100%;
}

.journey-followup {
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    border-radius: 12px;
    padding: 14px 16px;
}

.journey-followup-message {
    font-size: 13px;
    color: var(--dark);
    line-height: 1.5;
    margin: 0 0 10px;
}

.journey-followup-message:last-child {
    margin-bottom: 0;
}

.journey-followup-link {
    margin-top: 4px;
}

@media (max-width: 768px) {
    .journey-timeline {
        display: flex;
        flex-direction: column;
        padding-top: 0;
        gap: 12px;
    }

    .journey-timeline::before {
        display: none;
    }

    .journey-step {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 14px;
        text-align: left;
        min-width: auto;
        max-width: none;
    }

    .journey-step-top {
        height: auto;
        align-items: center;
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .journey-actual-badge {
        position: static;
        transform: none;
        margin-right: 8px;
        order: 2;
    }

    .journey-step-name {
        min-height: auto;
        justify-content: flex-start;
    }

    .journey-step-state {
        min-height: auto;
    }
}

/* Content Cards */
.content-card {
    background: var(--white);
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    border: 1px solid #E5E7EB;
    margin-bottom: 24px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
}

.btn-sm {
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--white);
    border: none;
    border-radius: 10px;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.btn-sm:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(46, 189, 239, 0.3);
}

/* Course List */
.course-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.course-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: #F8FAFC;
    border-radius: 16px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    text-decoration: none;
    color: inherit;
}

.course-item:hover {
    border-color: var(--primary);
    background: #F0F9FF;
}

.course-image {
    width: 80px;
    height: 80px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    flex-shrink: 0;
}

.course-info {
    flex: 1;
    min-width: 0;
}

.course-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.course-meta {
    font-size: 13px;
    color: var(--gray);
    font-weight: 500;
}

.course-progress {
    width: 160px;
    flex-shrink: 0;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--dark);
}

.progress-bar {
    height: 8px;
    background: #E5E7EB;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 4px;
    transition: width 0.5s ease;
}

.course-status {
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.status-active {
    background: #DBEAFE;
    color: var(--secondary);
}

.status-completed {
    background: #D1FAE5;
    color: var(--success);
}

/* Activity List */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid #F3F4F6;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 2px;
}

.activity-time {
    font-size: 12px;
    color: var(--gray);
    font-weight: 500;
}

/* XP Badge */
.xp-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: linear-gradient(135deg, #FEF3C7, #FDE68A);
    color: #92400E;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
}

.level-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: linear-gradient(135deg, #DBEAFE, #BFDBFE);
    color: var(--dark);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
}

/* Profile Avatar */
.profile-avatar-wrapper {
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--primary);
    box-shadow: 0 4px 16px rgba(46,189,239,0.3);
}
.profile-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.profile-avatar-fallback {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: white;
    font-weight: 800;
}

/* Avatar Upload */
.avatar-input-hidden {
    display: none;
}
.avatar-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--white);
    border: 2px solid var(--primary);
    color: var(--primary);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.avatar-upload-btn:hover {
    background: var(--primary);
    color: white;
}
.avatar-save-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #10B981;
    border: none;
    color: white;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 8px;
}
.avatar-save-btn:hover {
    background: #059669;
}
.avatar-cancel-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #EF4444;
    border: none;
    color: white;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.avatar-cancel-btn:hover {
    background: #DC2626;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 48px 24px;
}

.empty-state-icon {
    font-size: 56px;
    margin-bottom: 16px;
}

.empty-state-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 8px;
}

.empty-state-text {
    font-size: 14px;
    color: var(--gray);
    font-weight: 500;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }
    .main-content {
        margin-left: 240px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    .main-content {
        margin-left: 0;
        padding: 20px;
        padding-top: 72px;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .course-item {
        flex-direction: column;
        align-items: flex-start;
    }
    .course-progress {
        width: 100%;
    }
}

/* ========== COURSES LIST ========== */
.tab-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    background: #E5E7EB;
    color: #6B7280;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
}

.tab-btn:hover:not(.active) {
    background: #D1D5DB;
}

.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.course-card {
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    border: 1px solid #E5E7EB;
    transition: all 0.3s ease;
}

.course-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.08);
}

.course-card-image {
    position: relative;
    height: 180px;
    background: linear-gradient(135deg, var(--dark), var(--secondary));
    overflow: hidden;
}

.course-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.course-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: rgba(255,255,255,0.9);
}

.course-card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 14px;
    background: var(--warning);
    color: white;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.course-card-body {
    padding: 24px;
}

.course-card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 8px;
    line-height: 1.3;
}

.course-card-instructor {
    font-size: 13px;
    color: var(--gray);
    font-weight: 500;
    margin-bottom: 16px;
}

.course-card-progress {
    margin-bottom: 20px;
}

.btn-course-action {
    display: block;
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-course-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(46, 189, 239, 0.3);
}

/* ========== COURSE DETAIL ========== */
.modules-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.module-card {
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    border: 1px solid #E5E7EB;
}

.module-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.module-header:hover {
    background: #F8FAFC;
}

.module-number {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.module-toggle-icon {
    transition: transform 0.3s ease;
    color: var(--gray);
}

.module-lessons {
    display: none;
    border-top: 1px solid #F3F4F6;
}

.lesson-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s ease;
    border-bottom: 1px solid #F3F4F6;
}

.lesson-row:last-child {
    border-bottom: none;
}

.lesson-row:hover {
    background: #F0F9FF;
}

.lesson-row.lesson-completed {
    opacity: 0.7;
}

.lesson-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #DBEAFE;
    color: var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.lesson-info {
    flex: 1;
    min-width: 0;
}

.lesson-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 2px;
}

.lesson-meta {
    font-size: 12px;
    color: var(--gray);
    font-weight: 500;
}

.lesson-status {
    flex-shrink: 0;
}

.lesson-status-btn {
    flex-shrink: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, background 0.2s ease;
}

.lesson-status-btn:hover {
    transform: scale(1.15);
    background: rgba(46, 189, 239, 0.12);
}

.lesson-status-btn:disabled {
    cursor: wait;
}

.lesson-status-btn i {
    pointer-events: none;
}

/* ========== LESSON DETAIL ========== */
.lesson-layout {
    display: flex;
    gap: 24px;
    margin: -32px;
    min-height: calc(100vh - 64px);
    min-width: 0;
    overflow-x: hidden;
}

.lesson-sidebar {
    width: 300px;
    background: var(--white);
    border-right: 1px solid #E5E7EB;
    padding: 24px;
    overflow-y: auto;
    align-self: stretch;
}

.lesson-sidebar-back {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--secondary);
    text-decoration: none;
    margin-bottom: 16px;
}

.lesson-sidebar-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 12px;
    line-height: 1.3;
}

.lesson-sidebar-progress {
    margin-bottom: 20px;
}

.lesson-sidebar-modules {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.lesson-sidebar-module-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.lesson-sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-bottom: 4px;
}

.lesson-sidebar-item:hover {
    background: #F0F9FF;
}

.lesson-sidebar-item.active {
    background: linear-gradient(135deg, rgba(46,189,239,0.15), rgba(28,156,217,0.1));
    color: var(--dark);
    font-weight: 600;
}

.lesson-sidebar-item-icon {
    width: 24px;
    text-align: center;
    flex-shrink: 0;
    color: var(--secondary);
}

.lesson-sidebar-item-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lesson-sidebar-item-check {
    flex-shrink: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 2px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, background 0.2s ease;
}

.lesson-sidebar-item-check:hover {
    transform: scale(1.15);
    background: rgba(46, 189, 239, 0.12);
}

.lesson-sidebar-item-check:disabled {
    cursor: wait;
}

.lesson-sidebar-item-check i {
    pointer-events: none;
    font-size: 14px;
}

.lesson-main {
    flex: 1;
    padding: 32px;
    max-width: 900px;
    min-width: 0;
}

.lesson-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid #E5E7EB;
    gap: 16px;
    flex-wrap: wrap;
}

.lesson-content-area {
    margin-bottom: 32px;
}

.video-player-wrapper iframe,
.video-player-wrapper video {
    width: 100%;
    height: 500px;
    border-radius: 16px;
    border: none;
}

.pdf-viewer-wrapper iframe,
/* PDF & Slides Viewer (unificado) */
.pdf-viewer-wrapper {
    margin-bottom: 20px;
    min-width: 0;
    max-width: 100%;
}
.pdf-viewer {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 650px;
    border-radius: 16px;
    background: #1a1a1a;
    position: relative;
    overflow: hidden;
    max-width: 100%;
    min-width: 0;
}
.pdf-canvas-container {
    flex: 1;
    overflow: auto;
    display: block;
    text-align: center;
    padding: 20px;
    cursor: grab;
    scrollbar-width: thin;
    scrollbar-color: rgba(46,189,239,0.5) rgba(0,0,0,0.3);
    max-width: 100%;
    min-width: 0;
}
.pdf-canvas-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
.pdf-canvas-container::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.3);
    border-radius: 4px;
}
.pdf-canvas-container::-webkit-scrollbar-thumb {
    background: rgba(46,189,239,0.5);
    border-radius: 4px;
}
.pdf-canvas-container::-webkit-scrollbar-thumb:hover {
    background: rgba(46,189,239,0.8);
}
.pdf-canvas-container:active {
    cursor: grabbing;
}
.pdf-canvas {
    display: inline-block;
    vertical-align: top;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.pdf-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.9);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
    flex-wrap: wrap;
}
.pdf-control-group {
    display: flex;
    align-items: center;
    gap: 8px;
}
.pdf-control-sep {
    width: 1px;
    height: 24px;
    background: rgba(255,255,255,0.2);
}
.pdf-btn {
    background: rgba(255,255,255,0.12);
    border: none;
    color: white;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}
.pdf-btn:hover {
    background: rgba(255,255,255,0.25);
}
.pdf-btn:disabled {
    opacity: 0.25;
    cursor: not-allowed;
}
.pdf-page-info {
    color: white;
    font-size: 13px;
    font-weight: 600;
    min-width: 70px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.pdf-zoom-level {
    color: rgba(255,255,255,0.8);
    font-size: 12px;
    font-weight: 600;
    min-width: 44px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.pdf-page-timer {
    color: #FBBF24;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}
.pdf-page-timer.completed {
    color: #34D399;
}
.pdf-page-timer.locked {
    color: #F87171;
}

/* PDF Page Blocker Overlay */
.pdf-page-blocker {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 56px;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 16px;
}
.pdf-blocker-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    padding: 32px;
}
.pdf-blocker-content i {
    font-size: 40px;
    color: #F87171;
}
.pdf-blocker-timer {
    font-size: 32px;
    font-weight: 800;
    color: #FBBF24;
    font-variant-numeric: tabular-nums;
}

.lesson-alert {
    padding: 16px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    margin-top: 16px;
}

.lesson-alert-info {
    background: #DBEAFE;
    color: #1E40AF;
}

/* ========== QUIZ LAUNCHER ========== */
.quiz-launcher-card {
    background: var(--white);
    border-radius: 20px;
    padding: 0;
    box-shadow: 0 8px 24px rgba(46, 189, 239, 0.12);
    border: 2px solid rgba(46, 189, 239, 0.2);
    margin-bottom: 24px;
    overflow: hidden;
    animation: slideInUp 0.4s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.quiz-launcher-header {
    background: linear-gradient(135deg, #2EBDEF 0%, #1C9CD9 100%);
    padding: 28px 32px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.quiz-launcher-icon-wrap {
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    backdrop-filter: blur(10px);
}

.quiz-launcher-icon-wrap i {
    font-size: 32px;
    color: white;
}

.quiz-launcher-header-text {
    flex: 1;
}

.quiz-launcher-title {
    font-size: 22px;
    font-weight: 800;
    color: white;
    margin-bottom: 4px;
    letter-spacing: -0.3px;
}

.quiz-launcher-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.quiz-launcher-body {
    padding: 28px 32px;
}

.quiz-launcher-info-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-bottom: 24px;
    padding: 16px;
    background: #F0F9FF;
    border-radius: 12px;
}

.quiz-launcher-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
}

.quiz-launcher-info-item i {
    font-size: 18px;
    color: var(--primary);
}

.quiz-launcher-info-divider {
    width: 1px;
    height: 24px;
    background: #D1D5DB;
}

.quiz-launcher-atlas-notice {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    border: 1px solid #FCD34D;
    border-radius: 14px;
    padding: 18px 20px;
    margin-bottom: 24px;
}

.quiz-launcher-atlas-icon {
    flex-shrink: 0;
}

.atlas-notice-img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.quiz-launcher-atlas-text {
    flex: 1;
    font-size: 14px;
    color: #92400E;
    line-height: 1.5;
}

.quiz-launcher-atlas-text strong {
    display: block;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
    color: #78350F;
}

.quiz-launcher-atlas-text p {
    margin: 0;
    font-size: 13px;
    color: #92400E;
    font-weight: 500;
}

.quiz-launcher-btn {
    width: 100%;
    background: linear-gradient(135deg, #2EBDEF 0%, #1C9CD9 100%);
    color: white;
    border: none;
    border-radius: 14px;
    padding: 18px 32px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(46, 189, 239, 0.3);
}

.quiz-launcher-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(46, 189, 239, 0.4);
}

.quiz-launcher-btn:active {
    transform: translateY(0);
}

.quiz-launcher-btn i {
    font-size: 20px;
}

/* ========== QUIZ ========== */
.lesson-quiz-card {
    background: var(--white);
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    border: 1px solid #E5E7EB;
    margin-bottom: 24px;
}

.lesson-quiz-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #F3F4F6;
}

.lesson-quiz-header i {
    color: var(--warning);
    font-size: 20px;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quiz-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: #F8FAFC;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.quiz-option:hover {
    border-color: var(--primary);
    background: #F0F9FF;
}

.quiz-option input {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
}

.quiz-option-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--dark);
}

/* ========== CHAT IA PLACEHOLDER ========== */
.lesson-chat-card {
    background: var(--white);
    border-radius: 20px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    border: 1px solid #E5E7EB;
    overflow: hidden;
    margin-bottom: 24px;
}

.lesson-chat-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--dark), #1a3170);
    color: var(--white);
    font-size: 14px;
    font-weight: 700;
}

.lesson-chat-header i {
    color: var(--primary);
}

.lesson-chat-body {
    padding: 24px;
    min-height: 120px;
    max-height: 300px;
    overflow-y: auto;
}

.chat-message {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.chat-message-ai {
    align-items: flex-start;
}

.chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    flex-shrink: 0;
}

.chat-bubble {
    background: #F3F4F6;
    padding: 14px 18px;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
    color: #374151;
    max-width: 80%;
}

.lesson-chat-input {
    display: flex;
    gap: 8px;
    padding: 16px 24px;
    border-top: 1px solid #F3F4F6;
    background: #F8FAFC;
}

.lesson-chat-input input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    outline: none;
    background: white;
}

.lesson-chat-input input:disabled {
    background: #F3F4F6;
    color: #9CA3AF;
}

.lesson-chat-input button {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.lesson-chat-input button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========== RESPONSIVE LESSON ========== */
@media (max-width: 1024px) {
    .lesson-layout {
        flex-direction: column;
        margin: -20px;
    }
    .lesson-sidebar {
        width: 100%;
        height: auto;
        max-height: 300px;
        position: relative;
        border-right: none;
        border-bottom: 1px solid #E5E7EB;
    }
    .lesson-main {
        padding: 20px;
        max-width: 100%;
    }
    .video-player-wrapper iframe,
    .video-player-wrapper video {
        height: 300px;
    }
}

@media (max-width: 768px) {
    .courses-grid {
        grid-template-columns: 1fr;
    }
    .lesson-header {
        flex-direction: column;
    }
}

/* ========== LIVE CLASSES ========== */
.live-pulse {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #EF4444;
    margin-right: 8px;
    animation: pulse-live 1.5s infinite;
}

@keyframes pulse-live {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.live-class-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.live-class-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: #F8FAFC;
    border-radius: 16px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    flex-wrap: wrap;
}

.live-class-item:hover {
    border-color: var(--primary);
    background: #F0F9FF;
}

.live-class-live {
    background: #FEF2F2;
    border-color: #FECACA;
}

.live-class-live:hover {
    background: #FEE2E2;
    border-color: #EF4444;
}

.live-class-watched {
    background: #ECFDF5;
    border-color: #A7F3D0;
}

.live-class-watched:hover {
    background: #D1FAE5;
}

.live-class-status-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.status-upcoming {
    background: #DBEAFE;
    color: #1E40AF;
}

.status-finished {
    background: #F3F4F6;
    color: #374151;
}

.live-class-info {
    flex: 1;
    min-width: 0;
}

.live-class-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 6px;
}

.live-class-meta {
    font-size: 13px;
    color: var(--gray);
    font-weight: 500;
    margin-bottom: 4px;
}

.live-class-datetime {
    font-size: 13px;
    color: var(--dark);
    font-weight: 600;
    margin-bottom: 8px;
}

.live-class-courses {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.course-tag {
    padding: 4px 12px;
    background: #E0F2FE;
    color: var(--secondary);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.live-class-actions {
    flex-shrink: 0;
}

.btn-live {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-live-join {
    background: linear-gradient(135deg, #EF4444, #DC2626);
    color: white;
    animation: pulse-live-btn 2s infinite;
}

.btn-live-join:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
}

@keyframes pulse-live-btn {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

.btn-live-schedule {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.btn-live-schedule:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(46, 189, 239, 0.3);
}

.btn-live-replay {
    background: linear-gradient(135deg, #8B5CF6, #7C3AED);
    color: white;
}

.btn-live-replay:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.3);
}

.btn-live-disabled {
    background: #F3F4F6;
    color: #9CA3AF;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .live-class-item {
        flex-direction: column;
        align-items: flex-start;
    }
    .live-class-actions {
        width: 100%;
    }
    .btn-live {
        width: 100%;
        justify-content: center;
    }
}

/* ========== COURSE DETAIL 2-COLUMN LAYOUT ========== */
.course-detail-grid {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 24px;
    align-items: start;
}

.course-info-panel {
    position: sticky;
    top: 32px;
}

.course-hero-image {
    width: 100%;
    height: 220px;
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
}

.course-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.course-hero-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    color: rgba(255,255,255,0.9);
}

.course-modules-panel {
    min-width: 0;
}

/* Sin subrayado en links del curso */
.lesson-row,
.module-header {
    text-decoration: none;
    color: inherit;
}

@media (max-width: 1024px) {
    .course-detail-grid {
        grid-template-columns: 1fr;
    }
    .course-info-panel {
        position: static;
    }
}

/* ========== CHAT IA FLOTANTE ========== */
.chat-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(46, 189, 239, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    z-index: 9999;
}

.chat-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 28px rgba(46, 189, 239, 0.55);
}

.chat-fab:active {
    transform: scale(0.95);
}

@keyframes chat-pulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(46, 189, 239, 0.4); }
    50% { box-shadow: 0 4px 30px rgba(46, 189, 239, 0.7); }
}

.chat-fab {
    animation: chat-pulse 2.5s ease-in-out infinite;
}

.chat-fab:hover {
    animation: none;
}

/* Panel de Chat */
.chat-panel {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 380px;
    max-width: calc(100vw - 48px);
    height: 520px;
    max-height: calc(100vh - 48px);
    background: white;
    border-radius: 20px;
    box-shadow: 0 8px 40px rgba(39, 66, 146, 0.2), 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 10000;
    animation: chat-slide-up 0.25s ease-out;
}

@keyframes chat-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Header del Panel */
.chat-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: linear-gradient(135deg, var(--dark), var(--secondary));
    color: white;
    flex-shrink: 0;
}

.chat-panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 14px;
}

.chat-panel-title i {
    font-size: 18px;
}

.chat-panel-title span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 280px;
}

.chat-panel-close {
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background 0.2s;
    flex-shrink: 0;
}

.chat-panel-close:hover {
    background: rgba(255,255,255,0.3);
}

/* Mensajes */
.chat-panel-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #F8FAFC;
}

.chat-panel-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-panel-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-panel-messages::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 3px;
}

.chat-msg {
    display: flex;
    gap: 8px;
    max-width: 85%;
    animation: msg-fade-in 0.2s ease-out;
}

@keyframes msg-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-msg-user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-msg-ai {
    align-self: flex-start;
}

.chat-msg-ai-error {
    align-self: flex-start;
}

.chat-msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.chat-msg-ai-error .chat-msg-avatar {
    background: linear-gradient(135deg, #EF4444, #DC2626);
}

.chat-msg-bubble {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-msg-user .chat-msg-bubble {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-msg-ai .chat-msg-bubble {
    background: white;
    color: #1E293B;
    border: 1px solid #E2E8F0;
    border-bottom-left-radius: 4px;
}

.chat-msg-ai-error .chat-msg-bubble {
    background: #FEF2F2;
    color: #991B1B;
    border: 1px solid #FECACA;
    border-bottom-left-radius: 4px;
}

/* Indicador de escribiendo */
.chat-typing-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #94A3B8;
    margin-right: 4px;
    animation: typing-bounce 1.4s ease-in-out infinite;
}

.chat-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.chat-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
    margin-right: 0;
}

@keyframes typing-bounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
    40% { transform: translateY(-6px); opacity: 1; }
}

/* Área de Input */
.chat-panel-input-area {
    padding: 12px 14px;
    background: white;
    border-top: 1px solid #E2E8F0;
    flex-shrink: 0;
}

.chat-panel-input-area form {
    display: flex;
    gap: 8px;
}

.chat-panel-input-area input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 24px;
    font-size: 13px;
    font-family: 'Montserrat', sans-serif;
    outline: none;
    transition: border-color 0.2s;
}

.chat-panel-input-area input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(46, 189, 239, 0.1);
}

.chat-panel-input-area input:disabled {
    background: #F1F5F9;
    cursor: not-allowed;
}

.chat-panel-input-area button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: transform 0.15s, opacity 0.2s;
    flex-shrink: 0;
}

.chat-panel-input-area button:hover:not(:disabled) {
    transform: scale(1.05);
}

.chat-panel-input-area button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive Chat */
@media (max-width: 768px) {
    .chat-panel {
        width: calc(100vw - 16px);
        height: calc(100vh - 80px);
        bottom: 8px;
        right: 8px;
        border-radius: 16px;
    }

    .chat-fab {
        bottom: 16px;
        right: 16px;
        width: 52px;
        height: 52px;
        font-size: 20px;
    }

    .chat-panel-title span {
        max-width: 200px;
    }
}

/* ========== ATLAS — Mascota IA del Chat ========== */

.atlas-fab {
    padding: 0;
    overflow: hidden;
    background: linear-gradient(135deg, #1C3A5F 0%, #0F2744 100%);
    border: 3px solid rgba(46, 189, 239, 0.4);
}

.atlas-fab-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.atlas-header {
    background: linear-gradient(135deg, #1C3A5F 0%, #0F2744 100%) !important;
}

.atlas-header .chat-panel-title {
    gap: 12px;
}

.atlas-header-avatar-wrap {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(46, 189, 239, 0.5);
    box-shadow: 0 2px 12px rgba(46, 189, 239, 0.3);
    flex-shrink: 0;
    background: #0A1A2E;
}

.atlas-header-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.atlas-header-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.atlas-name {
    font-weight: 700;
    font-size: 15px;
    color: #fff;
    letter-spacing: 0.3px;
}

.atlas-sub {
    font-size: 11px;
    color: rgba(255,255,255,0.65);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

.atlas-avatar {
    background: transparent !important;
    width: 56px;
    height: 56px;
    border-radius: 12px;
    overflow: visible;
    border: none;
    padding: 0;
    flex-shrink: 0;
}

.atlas-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    transform: scale(1.4);
    object-position: center 15%;
}

.atlas-talking {
    animation: atlas-bounce 0.6s ease-in-out infinite;
    border-color: #2EBDEF;
    box-shadow: 0 0 12px rgba(46, 189, 239, 0.5);
}

@keyframes atlas-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.12); }
}

/* Efecto de ondas cuando Atlas está activo */
.atlas-fab::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(46, 189, 239, 0.3);
    animation: atlas-ring 2s ease-out infinite;
    pointer-events: none;
}

@keyframes atlas-ring {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(1.35); opacity: 0; }
}

/* ============================================================
   ACHIEVEMENTS / LOGROS
   ============================================================ */

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.achievement-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.achievement-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(39, 66, 146, 0.1);
}

.achievement-unlocked {
    border-color: #E5E7EB;
    background: white;
}

.achievement-unlocked::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.achievement-locked {
    background: #F9FAFB;
    border-color: #E5E7EB;
    opacity: 0.75;
}

.achievement-locked .achievement-name,
.achievement-locked .achievement-desc {
    color: #9CA3AF;
}

.achievement-icon-wrapper {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    position: relative;
}

.achievement-check {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 22px;
    height: 22px;
    background: #10B981;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: white;
    border: 2px solid white;
}

.achievement-info {
    flex: 1;
    min-width: 0;
}

.achievement-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 4px;
}

.achievement-desc {
    font-size: 13px;
    color: var(--gray);
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 10px;
}

.achievement-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.achievement-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    background: #EEF2FF;
    color: var(--primary);
}

.achievement-badge.locked {
    background: #F3F4F6;
    color: #9CA3AF;
}

.achievement-date {
    font-size: 11px;
    color: var(--gray);
    font-weight: 600;
}

/* Mini achievement card (dashboard) */
.mini-achievement {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
}

.mini-achievement.unlocked {
    background: white;
    border-color: var(--primary);
}

.mini-achievement-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.mini-achievement-info {
    flex: 1;
    min-width: 0;
}

.mini-achievement-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--dark);
}

.mini-achievement-desc {
    font-size: 11px;
    color: var(--gray);
    font-weight: 500;
}

@media (max-width: 768px) {
    .achievements-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   PROGRESS PAGE / MI PROGRESO
   ============================================================ */

.progress-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.progress-stat-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    border-left: 4px solid transparent;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: transform 0.2s ease;
}

.progress-stat-card:hover {
    transform: translateY(-3px);
}

.progress-stat-card.blue   { border-left-color: #2EBDEF; }
.progress-stat-card.green  { border-left-color: #10B981; }
.progress-stat-card.orange { border-left-color: #F97316; }
.progress-stat-card.purple { border-left-color: #8B5CF6; }
.progress-stat-card.red    { border-left-color: #EF4444; }
.progress-stat-card.cyan   { border-left-color: #06B6D4; }

.progress-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 12px;
}

.progress-stat-card.blue   .progress-stat-icon { background: #E0F2FE; color: #0284C7; }
.progress-stat-card.green  .progress-stat-icon { background: #D1FAE5; color: #059669; }
.progress-stat-card.orange .progress-stat-icon { background: #FFEDD5; color: #EA580C; }
.progress-stat-card.purple .progress-stat-icon { background: #EDE9FE; color: #7C3AED; }
.progress-stat-card.red    .progress-stat-icon { background: #FEE2E2; color: #DC2626; }
.progress-stat-card.cyan   .progress-stat-icon { background: #CFFAFE; color: #0891B2; }

.progress-stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--dark);
    line-height: 1;
    margin-bottom: 4px;
}

.progress-stat-value span {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray);
    margin-left: 2px;
}

.progress-stat-label {
    font-size: 12px;
    color: var(--gray);
    font-weight: 600;
    margin-bottom: 10px;
}

.progress-stat-bar {
    height: 6px;
    background: #F3F4F6;
    border-radius: 3px;
    overflow: hidden;
}

.progress-stat-bar div {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.8s ease;
}

/* Module Progress List */
.modules-progress-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.module-progress-item {
    padding: 12px 16px;
    background: #F9FAFB;
    border-radius: 12px;
    border: 1px solid #E5E7EB;
}

.module-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.module-progress-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--dark);
}

.module-progress-pct {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
}

.module-progress-bar {
    height: 8px;
    background: #E5E7EB;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 4px;
}

.module-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 4px;
    transition: width 0.8s ease;
}

.module-progress-meta {
    font-size: 11px;
    color: var(--gray);
    font-weight: 500;
}

@media (max-width: 768px) {
    .progress-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================================
   QUIZZES PAGE
   ============================================================ */

.quiz-history-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 8px 0;
}

.quiz-history-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.quiz-history-card:hover {
    box-shadow: 0 8px 20px rgba(39, 66, 146, 0.08);
}

.quiz-history-card.quiz-passed {
    border-color: #D1FAE5;
}

.quiz-history-card.quiz-failed {
    border-color: #FEE2E2;
}

.quiz-history-main {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.quiz-history-status {
    flex-shrink: 0;
}

.quiz-status-badge {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
}

.quiz-status-badge.passed {
    background: #10B981;
}

.quiz-status-badge.failed {
    background: #EF4444;
}

.quiz-history-info {
    flex: 1;
    min-width: 0;
}

.quiz-history-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 4px;
}

.quiz-history-meta {
    font-size: 12px;
    color: var(--gray);
    font-weight: 500;
}

.quiz-history-score {
    text-align: center;
    flex-shrink: 0;
}

.quiz-score-value {
    font-size: 22px;
    font-weight: 800;
}

.quiz-score-value.score-passed {
    color: #10B981;
}

.quiz-score-value.score-failed {
    color: #EF4444;
}

.quiz-score-label {
    font-size: 11px;
    color: var(--gray);
    font-weight: 600;
}

.quiz-history-attempts {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid #F3F4F6;
}

.quiz-attempts-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--gray);
    min-width: 80px;
}

.quiz-attempts-bars {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 40px;
}

.quiz-attempt-bar {
    width: 20px;
    height: 100%;
    background: #F3F4F6;
    border-radius: 4px;
    position: relative;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}

.quiz-attempt-fill {
    width: 100%;
    border-radius: 4px;
    min-height: 4px;
    transition: height 0.4s ease;
}

.quiz-attempt-fill.fill-passed {
    background: #10B981;
}

.quiz-attempt-fill.fill-failed {
    background: #EF4444;
}

/* Pending Quizzes */
.pending-quiz-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 8px 0;
}

.pending-quiz-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: #F9FAFB;
    border-radius: 12px;
    border: 1px solid #E5E7EB;
    transition: all 0.2s ease;
}

.pending-quiz-card:hover {
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.pending-quiz-info {
    flex: 1;
    min-width: 0;
}

.pending-quiz-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 4px;
}

.pending-quiz-meta {
    font-size: 12px;
    color: var(--gray);
    font-weight: 500;
}

.pending-quiz-status {
    flex-shrink: 0;
}

.pending-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    background: #F3F4F6;
    color: #6B7280;
}

.retry-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    background: #FEF3C7;
    color: #92400E;
}

@media (max-width: 768px) {
    .quiz-history-main {
        flex-wrap: wrap;
    }
    .pending-quiz-card {
        flex-wrap: wrap;
    }
}

/* ============================================================
   DUOLINGO QUIZ MODE
   ============================================================ */

.duolingo-progress-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.duolingo-progress-bar {
    flex: 1;
    height: 16px;
    background: #E5E7EB;
    border-radius: 10px;
    overflow: hidden;
}

.duolingo-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10B981, #34D399);
    border-radius: 10px;
    transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    width: 0%;
}

.duolingo-progress-text {
    font-size: 14px;
    font-weight: 700;
    color: var(--dark);
    min-width: 60px;
    text-align: right;
}

/* Question Card */
.duolingo-question-card {
    background: white;
    border-radius: 20px;
    padding: 32px;
    border: 2px solid #E5E7EB;
    animation: duolingoFadeIn 0.4s ease;
}

.duolingo-question-meta {
    font-size: 12px;
    font-weight: 700;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.duolingo-question-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
    line-height: 1.5;
    margin-bottom: 24px;
}

/* Options */
.duolingo-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.duolingo-option-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #E5E7EB;
    border-radius: 14px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    font-size: 15px;
    color: var(--dark);
}

.duolingo-option-btn:hover {
    border-color: var(--primary);
    background: #F0F9FF;
    transform: translateY(-1px);
}

.duolingo-option-btn.selected {
    border-color: var(--primary);
    background: linear-gradient(135deg, #E0F2FE, #F0F9FF);
    box-shadow: 0 4px 12px rgba(46, 189, 239, 0.15);
}

.duolingo-option-btn.correct {
    border-color: #10B981;
    background: #D1FAE5;
    animation: duolingoBounce 0.5s ease;
}

.duolingo-option-btn.incorrect {
    border-color: #EF4444;
    background: #FEE2E2;
    animation: duolingoShake 0.5s ease;
}

.duolingo-option-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: #F3F4F6;
    font-size: 13px;
    font-weight: 800;
    color: var(--gray);
    flex-shrink: 0;
}

.duolingo-option-btn.selected .duolingo-option-letter {
    background: var(--primary);
    color: white;
}

.duolingo-option-btn.correct .duolingo-option-letter {
    background: #10B981;
    color: white;
}

.duolingo-option-btn.incorrect .duolingo-option-letter {
    background: #EF4444;
    color: white;
}

/* Matching Question */
.duolingo-matching {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.duolingo-matching-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 4px;
    border-radius: 14px;
    transition: background 0.2s ease;
}

.duolingo-matching-row:hover {
    background: #F9FAFB;
}

.duolingo-matching-left {
    flex: 1;
    padding: 14px 18px;
    background: linear-gradient(135deg, #E0F2FE, #F0F9FF);
    border: 2px solid #BAE6FD;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
    min-height: 48px;
    display: flex;
    align-items: center;
}

.duolingo-matching-select {
    flex: 1.2;
    padding: 12px 16px;
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    background: white;
    font-size: 14px;
    font-family: 'Montserrat', sans-serif;
    color: var(--dark);
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.duolingo-matching-select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(46, 189, 239, 0.15);
}

.duolingo-matching-select:hover {
    border-color: var(--primary);
    background-color: #F0F9FF;
}

.duolingo-matching-select.correct {
    border-color: #10B981;
    background-color: #D1FAE5;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2310B981' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
}

.duolingo-matching-select.incorrect {
    border-color: #EF4444;
    background-color: #FEE2E2;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23EF4444' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
}

.duolingo-matching-select:disabled {
    cursor: default;
    opacity: 0.85;
}

/* Check Button */
.duolingo-check-btn {
    width: 100%;
    padding: 16px 28px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 14px;
    justify-content: center;
}

.duolingo-check-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Reading Comprehension Quiz Styles */
.duolingo-reading {
    margin-bottom: 24px;
}

.reading-passage-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--dark);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.reading-passage-text {
    background: linear-gradient(135deg, #EBF5FF, #F0F9FF);
    border-left: 4px solid var(--primary);
    border-radius: 0 12px 12px 0;
    padding: 20px;
    font-size: 15px;
    line-height: 1.7;
    color: #1E293B;
    margin-bottom: 24px;
    max-height: 300px;
    overflow-y: auto;
}

.reading-sub-questions {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.reading-sub-q {
    background: #F8FAFC;
    border: 2px solid #E2E8F0;
    border-radius: 14px;
    padding: 16px 20px;
}

.reading-sub-q-label {
    font-size: 13px;
    font-weight: 800;
    color: var(--primary);
    text-transform: uppercase;
    margin-bottom: 6px;
}

.reading-sub-q-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--dark);
    line-height: 1.5;
    margin-bottom: 12px;
}

.reading-sub-q-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.reading-sub-q-matching {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.reading-sub-btn {
    padding: 12px 16px !important;
    font-size: 14px !important;
}

.reading-feedback-list {
    margin: 12px 0;
    text-align: left;
}

.reading-feedback-item {
    padding: 6px 0;
    font-size: 13px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

.reading-feedback-item:last-child {
    border-bottom: none;
}

.reading-sub-q .correct-answer {
    border-color: #10B981 !important;
    background-color: #D1FAE5 !important;
}

.reading-sub-q .incorrect-answer {
    border-color: #EF4444 !important;
    background-color: #FEE2E2 !important;
}

/* Feedback Overlay */
.duolingo-feedback {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 40px 32px;
    border-radius: 20px;
    animation: duolingoSlideUp 0.4s ease;
}

.duolingo-feedback.feedback-correct {
    background: linear-gradient(135deg, #D1FAE5, #ECFDF5);
    border: 2px solid #10B981;
}

.duolingo-feedback.feedback-incorrect {
    background: linear-gradient(135deg, #FEE2E2, #FEF2F2);
    border: 2px solid #EF4444;
}

.duolingo-feedback-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.duolingo-feedback-title {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 12px;
}

.feedback-correct .duolingo-feedback-title {
    color: #065F46;
}

.feedback-incorrect .duolingo-feedback-title {
    color: #991B1B;
}

.duolingo-feedback-explanation {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 24px;
    max-width: 480px;
}

.feedback-correct .duolingo-feedback-explanation {
    color: #065F46;
}

.feedback-incorrect .duolingo-feedback-explanation {
    color: #7F1D1D;
}

.duolingo-next-btn {
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 14px;
}

/* Loader */
.duolingo-loader {
    display: none;
    flex-direction: column;
    align-items: center;
    padding: 48px 32px;
    text-align: center;
}

.duolingo-loader-spinner {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 16px;
}

.duolingo-loader-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray);
}

/* Result Screen */
.duolingo-result {
    display: none;
    text-align: center;
    padding: 40px 24px;
    animation: duolingoFadeIn 0.5s ease;
}

.duolingo-result-icon {
    font-size: 72px;
    margin-bottom: 16px;
}

.duolingo-result-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 8px;
}

.duolingo-result-score {
    font-size: 20px;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 12px;
}

.duolingo-result-message {
    font-size: 15px;
    color: var(--gray);
    margin-bottom: 24px;
    line-height: 1.6;
}

.duolingo-result-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Question Image */
.duolingo-question-image {
    display: block;
    max-width: 100%;
    max-height: 260px;
    border-radius: 12px;
    margin: 16px 0;
    border: 1px solid #E5E7EB;
    object-fit: contain;
}

/* Video Response */
.duolingo-video-response {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    background: #000;
}

/* Video Player */
.duolingo-video-player {
    width: 100%;
    max-height: 360px;
    border-radius: 12px;
    background: #000;
    margin: 12px 0;
}

/* Animations */
@keyframes duolingoFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes duolingoSlideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes duolingoBounce {
    0%, 100% { transform: scale(1); }
    30% { transform: scale(1.03); }
    50% { transform: scale(0.98); }
    70% { transform: scale(1.01); }
}

@keyframes duolingoShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* Responsive */
@media (max-width: 768px) {
    .duolingo-question-card {
        padding: 20px;
    }
    .duolingo-question-text {
        font-size: 16px;
    }
    .duolingo-option-btn {
        padding: 14px 16px;
        font-size: 14px;
    }
    .duolingo-matching-row {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }
    .duolingo-matching-left {
        min-height: auto;
        text-align: center;
    }
    .duolingo-matching-select {
        width: 100%;
    }
}

/* ============================================================
   BLOQUEAR DESCARGA NATIVA DE VIDEOS
   ============================================================ */
video::-webkit-media-controls-download-button {
    display: none !important;
}
video::-webkit-media-controls-enclosure {
    overflow: hidden;
}
video::-webkit-media-controls-panel {
    width: calc(100% + 30px);
}

/* ============================================================
   BOTONES DE DESCARGA DE LECCIONES
   ============================================================ */

.lesson-download-row {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.lesson-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--white);
    border-radius: 12px;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.lesson-download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(46, 189, 239, 0.35);
    color: var(--white);
}

.lesson-download-btn:active {
    transform: translateY(0);
}

.lesson-download-btn-external {
    background: #E5E7EB;
    color: #374151;
}

.lesson-download-btn-external:hover {
    background: #D1D5DB;
    color: #374151;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ============================================================
   TIMER DE LECTURA PARA LECCIONES DE TEXTO
   ============================================================ */

.text-timer-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.text-timer-display {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: rgba(39, 66, 146, 0.06);
    border: 1px solid rgba(39, 66, 146, 0.12);
    border-radius: 10px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #274292;
    white-space: nowrap;
}

.text-timer-display i {
    font-size: 14px;
    color: #2EBDEF;
}

.text-timer-row .btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================================
   ANTI-COPY PROTECTION - Evita selección de texto y copia
   ============================================================ */

/* Tier 1: Quiz - preguntas, opciones, feedback, resultados */
.duolingo-container,
.duolingo-question-card,
.duolingo-question-text,
.duolingo-question-meta,
.duolingo-options,
.duolingo-option-btn,
.duolingo-option-letter,
.duolingo-option-text,
.duolingo-matching,
.duolingo-matching-left,
.duolingo-matching-select,
.duolingo-check-btn,
.duolingo-feedback,
.duolingo-feedback-title,
.duolingo-feedback-explanation,
.duolingo-result,
.duolingo-result-title,
.duolingo-result-score,
.duolingo-result-message,
.duolingo-loader,
.duolingo-next-btn,
.lesson-quiz-card,
.lesson-quiz-header,
.duolingo-question-image,
.duolingo-video-player {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Tier 2: Contenido educativo (texto, PDF, slides, chat IA) */
.text-content-wrapper,
.text-content-wrapper *,
.pdf-viewer-wrapper,
.pdf-viewer,
.pdf-canvas-container,
.pdf-controls,
.pdf-page-info,
.pdf-zoom-level,
.pdf-page-timer,
.chat-panel-messages,
.chat-msg-bubble,
.chat-panel-header,
.atlas-header-text {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Tier 3: Títulos, descripciones y metadatos de cursos */
.course-hero-image,
.course-detail-grid h1,
.course-detail-grid p,
.course-detail-grid .content-card,
.modules-list .lesson-title,
.modules-list .lesson-meta,
.lesson-header,
.lesson-header h1,
.lesson-alert,
.lesson-alert-info {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* ========== MODO OSCURO ========== */
/* Automático: sigue al sistema operativo, salvo que el usuario elija "claro". */
@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) body {
        background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
        color: #e2e8f0;
    }

    html:not([data-theme="light"]) .main-content {
        color: #e2e8f0;
    }

    html:not([data-theme="light"]) .page-header h1 { color: #f8fafc; }
    html:not([data-theme="light"]) .page-header p { color: #94a3b8; }

    html:not([data-theme="light"]) .tab-btn {
        background: #334155;
        color: #cbd5e1;
    }
    html:not([data-theme="light"]) .tab-btn:hover:not(.active) {
        background: #475569;
    }

    html:not([data-theme="light"]) .course-card {
        background: #1e293b;
        border-color: #334155;
    }
    html:not([data-theme="light"]) .course-card:hover {
        box-shadow: 0 20px 25px -5px rgba(0,0,0,0.3);
    }
    html:not([data-theme="light"]) .course-card-title { color: #f8fafc; }
    html:not([data-theme="light"]) .course-card-instructor { color: #94a3b8; }
    html:not([data-theme="light"]) .course-card-body { color: #e2e8f0; }

    html:not([data-theme="light"]) .empty-state-title { color: #f8fafc; }
    html:not([data-theme="light"]) .empty-state-text { color: #94a3b8; }

    html:not([data-theme="light"]) .alert-error {
        background: #450a0a;
        color: #fca5a5;
        border-color: #7f1d1d;
    }
    html:not([data-theme="light"]) .alert-success {
        background: #064e3b;
        color: #6ee7b7;
        border-color: #059669;
    }

    /* Layout general: cards, stats, widgets */
    html:not([data-theme="light"]) .stat-card,
    html:not([data-theme="light"]) .card,
    html:not([data-theme="light"]) .dashboard-card,
    html:not([data-theme="light"]) .achievement-card,
    html:not([data-theme="light"]) .activity-card,
    html:not([data-theme="light"]) .widget-card,
    html:not([data-theme="light"]) .content-card,
    html:not([data-theme="light"]) .module-card,
    html:not([data-theme="light"]) .lesson-card {
        background: #1e293b;
        border-color: #334155;
        color: #e2e8f0;
    }

    html:not([data-theme="light"]) .stat-number { color: #f8fafc; }
    html:not([data-theme="light"]) .stat-label { color: #94a3b8; }

    html:not([data-theme="light"]) .form-input {
        background: #0f172a;
        border-color: #334155;
        color: #f8fafc;
    }
    html:not([data-theme="light"]) .form-input:focus {
        background: #0f172a;
        box-shadow: 0 0 0 4px rgba(46, 189, 239, 0.25);
    }

    html:not([data-theme="light"]) .progress-bar {
        background: #334155;
    }

    html:not([data-theme="light"]) .course-card-progress .progress-label span {
        color: #94a3b8;
    }

    /* Textos y bordes comunes */
    html:not([data-theme="light"]) h1, html:not([data-theme="light"]) h2, html:not([data-theme="light"]) h3, html:not([data-theme="light"]) h4, html:not([data-theme="light"]) h5, html:not([data-theme="light"]) h6 { color: #f8fafc; }
    html:not([data-theme="light"]) p { color: #cbd5e1; }

    /* Tablas */
    html:not([data-theme="light"]) table th { background: #0f172a; color: #94a3b8; }
    html:not([data-theme="light"]) table td { border-color: #334155; color: #e2e8f0; }
    html:not([data-theme="light"]) table tr:hover td { background: #0f172a; }

    /* Login */
    html:not([data-theme="light"]) .login-page { background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%); }
    html:not([data-theme="light"]) .login-card { background: #1e293b; }
    html:not([data-theme="light"]) .login-logo h1 { color: #f8fafc; }
    html:not([data-theme="light"]) .login-logo p { color: #94a3b8; }

    /* Sidebar: ya es oscuro, solo ajustes sutiles */
    html:not([data-theme="light"]) .sidebar {
        background: linear-gradient(180deg, #0f172a 0%, #1e3a8a 100%);
    }
    html:not([data-theme="light"]) .nav-item { color: rgba(255,255,255,0.75); }
    html:not([data-theme="light"]) .nav-item:hover { background: rgba(255,255,255,0.1); color: #fff; }

    /* Badges y chips */
    html:not([data-theme="light"]) .badge-info { background: #172554; color: #93c5fd; }
    html:not([data-theme="light"]) .badge-success { background: #064e3b; color: #6ee7b7; }
    html:not([data-theme="light"]) .badge-warning { background: #451a03; color: #fcd34d; }
    html:not([data-theme="light"]) .badge-danger { background: #450a0a; color: #fca5a5; }

    /* Ruta de acompañamiento */
    html:not([data-theme="light"]) .journey-title { color: #f8fafc; }
    html:not([data-theme="light"]) .journey-subtitle { color: #94a3b8; }
    html:not([data-theme="light"]) .journey-timeline::before { background: #334155; }
    html:not([data-theme="light"]) .journey-step-circle { background: #1e293b; border-color: #334155; color: #94a3b8; }
    html:not([data-theme="light"]) .journey-step-name { color: #f8fafc; }
    html:not([data-theme="light"]) .journey-step-state { color: #94a3b8; }
    html:not([data-theme="light"]) .journey-step-completed .journey-step-circle { background: #064e3b; border-color: #059669; color: #6ee7b7; }
    html:not([data-theme="light"]) .journey-step-completed .journey-step-state { color: #6ee7b7; }
    html:not([data-theme="light"]) .journey-step-current .journey-step-circle { background: linear-gradient(135deg, #8B5CF6, #7C3AED); border-color: #C4B5FD; color: #fff; }
    html:not([data-theme="light"]) .journey-step-current .journey-step-state { color: #c4b5fd; }
    html:not([data-theme="light"]) .journey-step-check { border-color: #1e293b; }
    html:not([data-theme="light"]) .journey-current-title { color: #f8fafc; }
    html:not([data-theme="light"]) .journey-current-text { color: #cbd5e1; }
    html:not([data-theme="light"]) .journey-your-state-label { color: #94a3b8; }
    html:not([data-theme="light"]) .journey-state-pill { background: #0f172a; color: #e2e8f0; }
    html:not([data-theme="light"]) .journey-question { color: #f8fafc; }
    html:not([data-theme="light"]) .journey-option-btn { background: #1e2937; border-color: #334155; color: #e2e8f0; }
    html:not([data-theme="light"]) .journey-option-btn:hover { border-color: var(--primary); }
    html:not([data-theme="light"]) .journey-option-btn.selected { background: #064e3b; border-color: #059669; color: #6ee7b7; }
    html:not([data-theme="light"]) .journey-opec-input { background: #0f172a; border-color: #334155; color: #f8fafc; }
    html:not([data-theme="light"]) .journey-opec-note { color: #94a3b8; }
    html:not([data-theme="light"]) .journey-opec-locked { background: #0f172a; color: #e2e8f0; }
    html:not([data-theme="light"]) .journey-followup-message { color: #cbd5e1; }
    html:not([data-theme="light"]) .journey-help-link { background: #0f172a; color: #93c5fd; }
    html:not([data-theme="light"]) .journey-help-link:hover { background: #172554; }
}

/* Manual: el usuario eligió "oscuro" con el botón del sidebar. */
html[data-theme="dark"] body {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #e2e8f0;
}

html[data-theme="dark"] .main-content {
    color: #e2e8f0;
}

html[data-theme="dark"] .page-header h1 { color: #f8fafc; }
html[data-theme="dark"] .page-header p { color: #94a3b8; }

html[data-theme="dark"] .tab-btn {
    background: #334155;
    color: #cbd5e1;
}
html[data-theme="dark"] .tab-btn:hover:not(.active) {
    background: #475569;
}

html[data-theme="dark"] .course-card {
    background: #1e293b;
    border-color: #334155;
}
html[data-theme="dark"] .course-card:hover {
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.3);
}
html[data-theme="dark"] .course-card-title { color: #f8fafc; }
html[data-theme="dark"] .course-card-instructor { color: #94a3b8; }
html[data-theme="dark"] .course-card-body { color: #e2e8f0; }

html[data-theme="dark"] .empty-state-title { color: #f8fafc; }
html[data-theme="dark"] .empty-state-text { color: #94a3b8; }

html[data-theme="dark"] .alert-error {
    background: #450a0a;
    color: #fca5a5;
    border-color: #7f1d1d;
}
html[data-theme="dark"] .alert-success {
    background: #064e3b;
    color: #6ee7b7;
    border-color: #059669;
}

/* Layout general: cards, stats, widgets */
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .card,
html[data-theme="dark"] .dashboard-card,
html[data-theme="dark"] .achievement-card,
html[data-theme="dark"] .activity-card,
html[data-theme="dark"] .widget-card,
html[data-theme="dark"] .content-card,
html[data-theme="dark"] .module-card,
html[data-theme="dark"] .lesson-card {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

html[data-theme="dark"] .stat-number { color: #f8fafc; }
html[data-theme="dark"] .stat-label { color: #94a3b8; }

html[data-theme="dark"] .form-input {
    background: #0f172a;
    border-color: #334155;
    color: #f8fafc;
}
html[data-theme="dark"] .form-input:focus {
    background: #0f172a;
    box-shadow: 0 0 0 4px rgba(46, 189, 239, 0.25);
}

html[data-theme="dark"] .progress-bar {
    background: #334155;
}

html[data-theme="dark"] .course-card-progress .progress-label span {
    color: #94a3b8;
}

/* Textos y bordes comunes */
html[data-theme="dark"] h1, html[data-theme="dark"] h2, html[data-theme="dark"] h3, html[data-theme="dark"] h4, html[data-theme="dark"] h5, html[data-theme="dark"] h6 { color: #f8fafc; }
html[data-theme="dark"] p { color: #cbd5e1; }

/* Tablas */
html[data-theme="dark"] table th { background: #0f172a; color: #94a3b8; }
html[data-theme="dark"] table td { border-color: #334155; color: #e2e8f0; }
html[data-theme="dark"] table tr:hover td { background: #0f172a; }

/* Login */
html[data-theme="dark"] .login-page { background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%); }
html[data-theme="dark"] .login-card { background: #1e293b; }
html[data-theme="dark"] .login-logo h1 { color: #f8fafc; }
html[data-theme="dark"] .login-logo p { color: #94a3b8; }

/* Sidebar: ya es oscuro, solo ajustes sutiles */
html[data-theme="dark"] .sidebar {
    background: linear-gradient(180deg, #0f172a 0%, #1e3a8a 100%);
}
html[data-theme="dark"] .nav-item { color: rgba(255,255,255,0.75); }
html[data-theme="dark"] .nav-item:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* Badges y chips */
html[data-theme="dark"] .badge-info { background: #172554; color: #93c5fd; }
html[data-theme="dark"] .badge-success { background: #064e3b; color: #6ee7b7; }
html[data-theme="dark"] .badge-warning { background: #451a03; color: #fcd34d; }
html[data-theme="dark"] .badge-danger { background: #450a0a; color: #fca5a5; }

/* Ruta de acompañamiento */
html[data-theme="dark"] .journey-title { color: #f8fafc; }
html[data-theme="dark"] .journey-subtitle { color: #94a3b8; }
html[data-theme="dark"] .journey-timeline::before { background: #334155; }
html[data-theme="dark"] .journey-step-circle { background: #1e293b; border-color: #334155; color: #94a3b8; }
html[data-theme="dark"] .journey-step-name { color: #f8fafc; }
html[data-theme="dark"] .journey-step-state { color: #94a3b8; }
html[data-theme="dark"] .journey-step-completed .journey-step-circle { background: #064e3b; border-color: #059669; color: #6ee7b7; }
html[data-theme="dark"] .journey-step-completed .journey-step-state { color: #6ee7b7; }
html[data-theme="dark"] .journey-step-current .journey-step-circle { background: linear-gradient(135deg, #8B5CF6, #7C3AED); border-color: #C4B5FD; color: #fff; }
html[data-theme="dark"] .journey-step-current .journey-step-state { color: #c4b5fd; }
html[data-theme="dark"] .journey-step-check { border-color: #1e293b; }
html[data-theme="dark"] .journey-current-title { color: #f8fafc; }
html[data-theme="dark"] .journey-current-text { color: #cbd5e1; }
html[data-theme="dark"] .journey-your-state-label { color: #94a3b8; }
html[data-theme="dark"] .journey-state-pill { background: #0f172a; color: #e2e8f0; }
html[data-theme="dark"] .journey-question { color: #f8fafc; }
html[data-theme="dark"] .journey-option-btn { background: #1e2937; border-color: #334155; color: #e2e8f0; }
html[data-theme="dark"] .journey-option-btn:hover { border-color: var(--primary); }
html[data-theme="dark"] .journey-option-btn.selected { background: #064e3b; border-color: #059669; color: #6ee7b7; }
html[data-theme="dark"] .journey-opec-input { background: #0f172a; border-color: #334155; color: #f8fafc; }
html[data-theme="dark"] .journey-opec-note { color: #94a3b8; }
html[data-theme="dark"] .journey-opec-locked { background: #0f172a; color: #e2e8f0; }
html[data-theme="dark"] .journey-followup-message { color: #cbd5e1; }
html[data-theme="dark"] .journey-help-link { background: #0f172a; color: #93c5fd; }
html[data-theme="dark"] .journey-help-link:hover { background: #172554; }

/* Mejoras responsive para Mis Cursos */
@media (max-width: 480px) {
    .page-header h1 { font-size: 22px; }
    .page-header p { font-size: 13px; }
    .tab-btn { padding: 10px 16px; font-size: 13px; }
    .courses-grid { grid-template-columns: 1fr; gap: 16px; }
    .course-card-body { padding: 18px; }
    .course-card-image { height: 150px; }
}


/* ========== MODAL DE SELECCIÓN DE OPEC ========== */
.opec-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.opec-modal {
    position: relative;
    background: var(--white);
    border-radius: 20px;
    padding: 32px 28px 24px;
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(39, 66, 146, 0.35);
    text-align: center;
}

.opec-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: none;
    border: none;
    color: var(--gray);
    font-size: 18px;
    cursor: pointer;
    padding: 6px;
    transition: color 0.2s ease;
}
.opec-modal-close:hover { color: var(--dark); }

.opec-modal-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 26px;
}

.opec-modal-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 8px;
}

.opec-modal-text {
    font-size: 14px;
    color: var(--gray);
    margin-bottom: 18px;
    line-height: 1.5;
}

.opec-modal-search {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #1F2937;
    outline: none;
    transition: all 0.3s ease;
    margin-bottom: 12px;
}
.opec-modal-search:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(46, 189, 239, 0.15);
}

.opec-modal-list {
    overflow-y: auto;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.opec-modal-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    background: #F8FAFC;
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    font-family: 'Montserrat', sans-serif;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
}
.opec-modal-item:hover:not(:disabled) {
    border-color: var(--primary);
    background: var(--light);
}
.opec-modal-item:disabled { opacity: 0.6; cursor: wait; }

.opec-modal-item-code {
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--white);
    font-size: 13px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 8px;
}

.opec-modal-item-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.opec-modal-item-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
}
.opec-modal-item-inst {
    font-size: 12px;
    color: var(--gray);
}

.opec-modal-empty {
    padding: 24px 12px;
    color: var(--gray);
    font-size: 14px;
}

.opec-modal-feedback {
    font-size: 14px;
    font-weight: 600;
    color: var(--success);
    margin-bottom: 10px;
}

.opec-modal-skip {
    background: none;
    border: none;
    color: var(--gray);
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s ease;
}
.opec-modal-skip:hover { color: var(--dark); }

/* Modo oscuro del modal (automático y manual) */
@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) .opec-modal { background: #1e293b; }
    html:not([data-theme="light"]) .opec-modal-title { color: #f8fafc; }
    html:not([data-theme="light"]) .opec-modal-text { color: #94a3b8; }
    html:not([data-theme="light"]) .opec-modal-close { color: #94a3b8; }
    html:not([data-theme="light"]) .opec-modal-close:hover { color: #f8fafc; }
    html:not([data-theme="light"]) .opec-modal-search { background: #0f172a; border-color: #334155; color: #f8fafc; }
    html:not([data-theme="light"]) .opec-modal-item { background: #0f172a; border-color: #334155; }
    html:not([data-theme="light"]) .opec-modal-item:hover:not(:disabled) { border-color: var(--primary); background: #1e2937; }
    html:not([data-theme="light"]) .opec-modal-item-name { color: #f8fafc; }
    html:not([data-theme="light"]) .opec-modal-item-inst { color: #94a3b8; }
    html:not([data-theme="light"]) .opec-modal-empty { color: #94a3b8; }
    html:not([data-theme="light"]) .opec-modal-skip { color: #94a3b8; }
    html:not([data-theme="light"]) .opec-modal-skip:hover { color: #f8fafc; }
}
html[data-theme="dark"] .opec-modal { background: #1e293b; }
html[data-theme="dark"] .opec-modal-title { color: #f8fafc; }
html[data-theme="dark"] .opec-modal-text { color: #94a3b8; }
html[data-theme="dark"] .opec-modal-close { color: #94a3b8; }
html[data-theme="dark"] .opec-modal-close:hover { color: #f8fafc; }
html[data-theme="dark"] .opec-modal-search { background: #0f172a; border-color: #334155; color: #f8fafc; }
html[data-theme="dark"] .opec-modal-item { background: #0f172a; border-color: #334155; }
html[data-theme="dark"] .opec-modal-item:hover:not(:disabled) { border-color: var(--primary); background: #1e2937; }
html[data-theme="dark"] .opec-modal-item-name { color: #f8fafc; }
html[data-theme="dark"] .opec-modal-item-inst { color: #94a3b8; }
html[data-theme="dark"] .opec-modal-empty { color: #94a3b8; }
html[data-theme="dark"] .opec-modal-skip { color: #94a3b8; }
html[data-theme="dark"] .opec-modal-skip:hover { color: #f8fafc; }

/* Quiz/simulacro resultado: evita desbordes por texto largo o imágenes */
.quiz-result-card {
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
}
.quiz-result-card * {
    overflow-wrap: anywhere;
    word-break: break-word;
}
.quiz-result-card img,
.quiz-result-card video,
.quiz-result-card table {
    max-width: 100%;
    height: auto;
}


/* ========== A155: pill "Curso personalizado para OPEC xxx" ==========
   Se muestra en las tarjetas de curso (lista de cursos y dashboard)
   cuando la inscripcion tiene OPEC asignada. */
.opec-course-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 6px;
    padding: 3px 12px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #fff;
    background: linear-gradient(135deg, var(--dark) 0%, var(--secondary) 100%);
    border-radius: 100px;
    white-space: normal;  /* A156: el texto completo debe verse; sin nowrap/ellipsis que lo cortaban */
    width: fit-content;   /* A157: que abrace el contenido; en contenedores flex-column se estiraba al 100% */
    max-width: 100%;
}
.opec-course-pill .fas {
    font-size: 9px;
}

/* ===== A169: Clases en vivo — tarjetas con imagen ===== */
.lc-section-live {
    border: 2px solid #EF4444;
    background: linear-gradient(135deg, #FFF7F7, #FEF2F2);
}

.lc-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.lc-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 20px 16px 16px;
    background: #fff;
    border-radius: 18px;
    border: 1.5px solid #E5E7EB;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    flex-wrap: wrap;
}

.lc-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
    box-shadow: 0 12px 28px -10px rgba(46, 189, 239, 0.25);
}

.lc-card.lc-is-live {
    border-color: #FECACA;
    background: linear-gradient(135deg, #fff, #FFF5F5);
}

.lc-card.lc-is-live:hover {
    border-color: #EF4444;
    box-shadow: 0 12px 28px -10px rgba(239, 68, 68, 0.3);
}

.lc-card.lc-watched {
    background: linear-gradient(135deg, #fff, #F2FBF6);
    border-color: #BBEAD0;
}

.lc-thumb {
    position: relative;
    width: 132px;
    height: 92px;
    flex: 0 0 132px;
    border-radius: 14px;
    overflow: hidden;
    background: #EEF2F7;
}

.lc-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.lc-thumb-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.lc-thumb-fallback.lc-fallback-live {
    background: linear-gradient(135deg, #F87171, #DC2626);
}

.lc-thumb-fallback.lc-fallback-finished {
    background: linear-gradient(135deg, #A78BFA, #7C3AED);
}

.lc-chip {
    position: absolute;
    left: 8px;
    bottom: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

.lc-chip-live {
    background: rgba(220, 38, 38, 0.92);
    color: #fff;
}

.lc-chip-live .live-pulse {
    width: 8px;
    height: 8px;
    margin-right: 0;
    background: #fff;
}

.lc-chip-upcoming {
    background: rgba(30, 64, 175, 0.92);
    color: #fff;
}

.lc-chip-finished {
    background: rgba(55, 65, 81, 0.92);
    color: #fff;
}

.lc-body {
    flex: 1;
    min-width: 220px;
}

.lc-title {
    font-size: 16.5px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 6px;
    line-height: 1.3;
}

.lc-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    font-size: 12.5px;
    color: var(--gray);
    font-weight: 500;
    margin-bottom: 4px;
}

.lc-meta i {
    color: var(--primary);
    margin-right: 4px;
}

.lc-datetime {
    font-size: 13px;
    color: var(--dark);
    font-weight: 600;
    margin-bottom: 4px;
}

.lc-desc {
    font-size: 0.85rem;
    color: var(--gray);
    line-height: 1.5;
    margin-top: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.lc-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

.btn-live-resource {
    background: #fff;
    color: var(--primary);
    border: 1.5px solid var(--primary);
    padding: 9px 18px;
}

.btn-live-resource:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(46, 189, 239, 0.3);
}

@media (max-width: 768px) {
    .lc-card {
        flex-direction: column;
        align-items: stretch;
        padding: 14px;
    }
    .lc-thumb {
        width: 100%;
        height: 160px;
        flex: none;
    }
    .lc-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .lc-actions .btn-live {
        flex: 1;
        justify-content: center;
    }
}

/* ===== A172: marca de agua en las stat-cards del dashboard ===== */
.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-watermark {
    position: absolute;
    right: -14px;
    bottom: -18px;
    font-size: 96px;
    opacity: 0.08;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.stat-card:hover .stat-watermark {
    opacity: 0.13;
    transform: scale(1.08) rotate(-6deg);
}

.watermark-blue { color: #1283B5; }
.watermark-green { color: #0B7A55; }
.watermark-orange { color: #B46A02; }
.watermark-purple { color: #6D3BD1; }
