/* ─── Código Abierto Latam — estilos globales ─── */

/* ── Sticky footer: el footer siempre al fondo ── */
html {
    height: 100%;
}
body.site-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #f8f9fa;
}
body.site-layout main {
    flex: 1 0 auto;
}
body.site-layout footer {
    flex-shrink: 0;
}

/* ── Links globales — sin azul browser ni subrayado por defecto ── */
a {
    color: #0d6efd;
    text-decoration: none;
    transition: color .15s, opacity .15s;
}
a:hover {
    color: #0a58ca;
    text-decoration: none;
}

/* Links de contenido (dentro de párrafos, textos corridos) */
.content-link,
.prose a {
    color: #0d6efd;
    text-decoration: underline;
    text-decoration-color: rgba(13,110,253,.35);
    text-underline-offset: 3px;
}
.content-link:hover,
.prose a:hover {
    color: #0a58ca;
    text-decoration-color: #0a58ca;
}

/* Links sobre fondo oscuro (footer, cards dark) */
.footer-link {
    color: #adb5bd;
    text-decoration: none;
    transition: color .15s;
}
.footer-link:hover,
.footer-link:focus {
    color: #ffffff;
}

/* Links sutiles (breadcrumbs, meta info, etiquetas pequeñas) */
.link-subtle {
    color: #6c757d;
    text-decoration: none;
}
.link-subtle:hover {
    color: #0d6efd;
}

/* Gradiente de texto del hero */
.text-gradient {
    background: linear-gradient(135deg, #0d6efd, #6f42c1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Tarjetas de cursos */
.course-card {
    transition: transform .18s ease, box-shadow .18s ease;
    border-radius: .75rem;
    overflow: hidden;
}
.course-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 .75rem 1.5rem rgba(0,0,0,.12) !important;
}
.course-cover-wrapper {
    position: relative;
    height: 180px;
    overflow: hidden;
    background: linear-gradient(135deg, #0d6efd22, #6f42c122);
}
.course-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.course-cover-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0d6efd, #6f42c1);
}

/* Categorías */
.category-card {
    transition: transform .15s ease, box-shadow .15s ease;
    border-radius: .75rem;
}
.category-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 .5rem 1rem rgba(0,0,0,.08) !important;
}

/* Hero */
.hero-section {
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
}

/* ─── METRIC CARDS (dashboard admin) ────────────────────── */

.metric-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #fff;
    border-radius: .75rem;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 2px 12px rgba(0,0,0,.07);
    border: 1px solid rgba(0,0,0,.06);
    transition: transform .18s, box-shadow .18s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.metric-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px;
    height: 100%;
    border-radius: 4px 0 0 4px;
}
.metric-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
}

/* Variantes de color */
.metric-card--blue::before   { background: #0d6efd; }
.metric-card--green::before  { background: #198754; }
.metric-card--purple::before { background: #6f42c1; }
.metric-card--orange::before { background: #fd7e14; }

.metric-card__icon {
    width: 52px;
    height: 52px;
    border-radius: .6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.metric-card--blue   .metric-card__icon { background: #dbeafe; color: #0d6efd; }
.metric-card--green  .metric-card__icon { background: #d1fae5; color: #198754; }
.metric-card--purple .metric-card__icon { background: #ede9fe; color: #6f42c1; }
.metric-card--orange .metric-card__icon { background: #ffedd5; color: #fd7e14; }

.metric-card__body    { flex: 1; min-width: 0; }
.metric-card__value   { font-size: 1.6rem; font-weight: 700; color: #1a1d23; line-height: 1.1; }
.metric-card__label   { font-size: .78rem; color: #6c757d; margin-top: .2rem; font-weight: 500; }
.metric-card__arrow   { color: #ced4da; font-size: .9rem; transition: color .15s; }
.metric-card:hover .metric-card__arrow { color: #6c757d; }

/* Avatares circulares */
.avatar-circle {
    width: 38px; height: 38px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .8rem; font-weight: 700;
}
.avatar-circle--sm { width: 30px; height: 30px; font-size: .7rem; }
.bg-purple-subtle  { background: #ede9fe; }
.text-purple       { color: #6f42c1; }

/* Badges de estado */
.badge--active {
    background: #d1fae5; color: #065f46;
    border: 1px solid #a7f3d0;
    font-size: .7rem; padding: .25rem .55rem;
    border-radius: .35rem; font-weight: 600;
}
.badge--inactive {
    background: #fee2e2; color: #991b1b;
    border: 1px solid #fca5a5;
    font-size: .7rem; padding: .25rem .55rem;
    border-radius: .35rem; font-weight: 600;
}

/* Acciones rápidas */
.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .6rem;
    background: #fff;
    border-radius: .75rem;
    padding: 1.25rem 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    border: 1px solid rgba(0,0,0,.06);
    transition: transform .15s, box-shadow .15s;
    text-align: center;
    color: #1a1d23;
}
.quick-action:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,.1);
    color: #1a1d23;
}
.quick-action__icon {
    width: 48px; height: 48px;
    border-radius: .6rem;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
}
.quick-action__label {
    font-size: .8rem; font-weight: 600; line-height: 1.3;
}

/* ─── PANEL ADMIN / DOCENTE ─────────────────────────────── */

/* Layout raíz: sidebar fijo + contenido */
body.admin-layout {
    background: #f0f2f5;
    margin: 0;
    padding: 0;
}

.admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background: #1a1d23;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    scrollbar-width: thin;
    scrollbar-color: #333 transparent;
}
.admin-sidebar::-webkit-scrollbar { width: 4px; }
.admin-sidebar::-webkit-scrollbar-thumb { background: #333; border-radius: 2px; }

/* El contenido principal desplazado a la derecha de la sidebar */
.admin-main {
    margin-left: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Topbar */
.admin-topbar {
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    position: sticky;
    top: 0;
    z-index: 100;
    min-height: 56px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

/* Área de contenido con scroll */
.admin-content {
    flex: 1;
    padding: 1.5rem;
}

/* Cabecera de la sidebar */
.sidebar-header {
    border-bottom: 1px solid rgba(255,255,255,.06);
}

/* Info de usuario en sidebar */
.sidebar-user {
    border-bottom: 1px solid rgba(255,255,255,.06);
    padding-bottom: .75rem;
    margin-bottom: .25rem;
}

/* Etiquetas de sección */
.nav-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    color: #6c757d;
    text-transform: uppercase;
    padding: .5rem .75rem .25rem;
    display: block;
}

/* Links de navegación */
.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: .6rem;
    color: #adb5bd;
    border-radius: .4rem;
    padding: .5rem .75rem;
    font-size: .875rem;
    transition: background .12s, color .12s;
    white-space: nowrap;
    text-decoration: none;
}
.sidebar-nav .nav-link i {
    font-size: 1rem;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}
.sidebar-nav .nav-link:hover {
    background: rgba(255,255,255,.07);
    color: #fff;
}
.sidebar-nav .nav-link.active {
    background: rgba(13,110,253,.25);
    color: #74b9ff;
    font-weight: 600;
}

/* Tabla sticky header */
.table-sticky thead th {
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
}

/* Notificaciones badge */
.notification-badge {
    font-size: 10px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    line-height: 18px;
    border-radius: 9px;
}

/* Player de lecciones */
.lesson-player-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: .75rem;
    background: #000;
}
.lesson-player-wrapper iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: 0;
}

/* Progress bar animada */
@keyframes progressFill { from { width: 0; } }
.progress-bar { animation: progressFill .5s ease-out; }

/* ── Overlay para sidebar en móvil ── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 1039;
}
.sidebar-overlay.show { display: block; }

/* ── Responsive ── */
@media (max-width: 991.98px) {
    .admin-sidebar {
        left: -260px;
        transition: left .22s ease;
        box-shadow: none;
    }
    .admin-sidebar.sidebar-open {
        left: 0;
        box-shadow: 4px 0 20px rgba(0,0,0,.35);
    }
    .admin-main {
        margin-left: 0;
    }
}
