/* InnovaForma Course Template Styles - List View */

/* ── No Access page ─────────────────────────────────────────── */
.innovaforma-noaccess-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 2rem 1rem;
}

.noaccess-box {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,.08);
    padding: 3rem 2.5rem;
    max-width: 520px;
    width: 100%;
    text-align: center;
}

.noaccess-icon {
    font-size: 3.5rem;
    line-height: 1;
    margin-bottom: 1rem;
}

.noaccess-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: .75rem;
}

.noaccess-message {
    color: #4b5563;
    font-size: .97rem;
    margin-bottom: .5rem;
}

.noaccess-contact {
    color: #9ca3af;
    font-size: .875rem;
    margin-bottom: 1.75rem;
}

.noaccess-btn {
    display: inline-block;
    background: #2563eb;
    color: #fff !important;
    font-weight: 600;
    font-size: .95rem;
    padding: .65rem 1.75rem;
    border-radius: 8px;
    text-decoration: none;
    transition: background .2s;
}

.noaccess-btn:hover {
    background: #1d4ed8;
    color: #fff !important;
}

/* Admin dev notice */
.admin-dev-notice {
    position: absolute;
    top: 8px;
    left: 5%;
    z-index: 1000;
}

.admin-dev-notice-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: #bfdbfe;
    color: #1d4ed8;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: default;
    position: relative;
    font-style: normal;
    user-select: none;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.admin-dev-notice-icon:hover {
    opacity: 1;
}

.admin-dev-notice-tooltip {
    display: none;
    position: absolute;
    top: 24px;
    left: 0;
    right: auto;
    background: #1e3a5f;
    color: #e0f2fe;
    font-size: 0.75rem;
    line-height: 1.5;
    padding: 10px 14px;
    border-radius: 8px;
    width: 280px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    pointer-events: none;
    white-space: normal;
    font-style: normal;
    font-weight: normal;
}

.admin-dev-notice-tooltip a {
    color: #7dd3fc;
    word-break: break-all;
    pointer-events: auto;
}

.admin-dev-notice-icon:hover .admin-dev-notice-tooltip {
    display: block;
    pointer-events: auto;
}

.innovaforma-course-template {
    max-width: 100%;
    margin: 0;
    padding: 0;
    background: white;
}

/* Course Hero - imagen + nombre + progreso */
.course-hero {
    position: relative;
    width: 100%;
    background: #1f2937;
    margin-top: -24px;
    margin-left: -16px;
    margin-right: -16px;
    width: calc(100% + 32px);
}

.course-hero-image {
    width: 100%;
    height: 280px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: block;
}

.course-hero-image-placeholder {
    background: #1F4C78 /*linear-gradient(135deg, #5c66ad 0%, #3b4280 100%)*/;
}

.course-hero-info {
    padding: 24px 40px;
    background: white;
    border-bottom: 1px solid #e5e7eb;
}

.course-hero-info-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

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

/* End date inline */
.course-enddate-inline {
    flex-shrink: 0;
    text-align: right;
    font-size: 0.775rem;
    color: #6b7280;
    line-height: 1.6;
    padding-top: 4px;
}

.course-enddate-label {
    color: #6b7280;
    font-size: 0.775rem;
}

.course-enddate-label strong {
    font-size: 0.775rem;
    color: #374151;
    font-weight: 600;
}

.course-enddate-remaining {
    font-size: 0.775rem;
    color: #6b7280;
}

.course-enddate-expired {
    font-size: 0.775rem;
    color: #ef4444;
    font-weight: 600;
}

.course-hero-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 16px 0;
    line-height: 1.3;
}

/* Progress Header Sticky - oculto (reemplazado por inyección en navbar) */
.course-progress-header {
    display: none !important;
}

/* Progreso inyectado en navbar */
#nav-course-progress {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    flex: 1;
    min-width: 0;
    margin: 0 16px;
    animation: ncpFadeIn 0.25s ease;
    order: 0;
    align-self: center;
}

@keyframes ncpFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

nav.navbar.nav-compact #nav-course-progress {
    display: flex !important;
}

/* Activity pages: show progress bar but keep navbar menu items as-is (text + icon) */
nav.navbar.nav-activity-progress #nav-course-progress {
    display: flex !important;
    flex: 0 1 320px;   /* don't grow to fill all space; shrink if needed */
    min-width: 160px;
    max-width: 320px;
}

/* Logo swap: logo completo ↔ injected-logomini al hacer scroll */
nav.navbar .navbar-brand-logo.injected-logomini {
    display: none !important;
    height: calc(var(--navbar-height, 56px) - 16px);
    max-height: 40px;
    width: auto;
    object-fit: contain;
}
nav.navbar.nav-compact .navbar-brand-logo.logo,
nav.navbar.nav-compact .navbar-brand-logo.light-logo,
nav.navbar.nav-compact .navbar-brand-logo.dark-logo,
nav.navbar.nav-compact .navbar-brand-logo.icononly,
nav.navbar.nav-compact .navbar-brand-logo.iconsitename,
nav.navbar.nav-activity-progress .navbar-brand-logo.logo,
nav.navbar.nav-activity-progress .navbar-brand-logo.light-logo,
nav.navbar.nav-activity-progress .navbar-brand-logo.dark-logo,
nav.navbar.nav-activity-progress .navbar-brand-logo.icononly,
nav.navbar.nav-activity-progress .navbar-brand-logo.iconsitename {
    display: none !important;
}
nav.navbar.nav-compact .navbar-brand-logo.injected-logomini,
nav.navbar.nav-activity-progress .navbar-brand-logo.injected-logomini {
    display: block !important;
}

/* Fila superior: nombre + fecha en la misma línea */
.ncp-top {
    display: flex;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
    width: 100%;
}

.ncp-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
    line-height: 1.2;
}

.ncp-dates {
    flex-shrink: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    color: #6b7280;
    white-space: nowrap;
}

/* Divs internos (copiados del hero) → inline */
.ncp-dates > div {
    display: inline;
    font-size: inherit;
    color: inherit;
    font-weight: inherit;
}

.ncp-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

.ncp-label {
    font-size: 0.72rem;
    color: #6b7280;
    white-space: nowrap;
    flex-shrink: 0;
}

.ncp-bar {
    background: #e5e7eb;
    border-radius: 12px;
    height: 7px;
    overflow: hidden;
    flex: 1;
    min-width: 60px;
}

.ncp-fill {
    background: #1F4C78 /*linear-gradient(90deg, #5c66ad 0%, #7c85c3 100%)*/;
    height: 100%;
    border-radius: 12px;
}

.ncp-dates {
    flex-shrink: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    color: #6b7280;
    white-space: nowrap;
}

/* Divs internos (copiados del hero) → inline */
.ncp-dates > div {
    display: inline;
    font-size: inherit;
    color: inherit;
    font-weight: inherit;
}

.course-sticky-name {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 40%;
    flex-shrink: 0;
}

.progress-info {
    max-width: 100%;
    flex: 1;
}

.progress-label {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
    display: block;
    margin-bottom: 10px;
}

.progress-bar-container {
    background: #e5e7eb;
    border-radius: 12px;
    height: 10px;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
}

.progress-bar-fill {
    background: #1F4C78 /*linear-gradient(90deg, #5c66ad 0%, #7c85c3 100%)*/;
    height: 100%;
    border-radius: 12px;
    transition: width 0.6s ease;
}

/* Tabs Navigation */
.course-tabs {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 0 40px;
    display: none; /* Oculto por ahora */
    gap: 32px;
}

.tab-button {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 16px 4px;
    font-size: 0.938rem;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 400;
    position: relative;
}

.tab-button:hover {
    color: #374151;
}

.tab-button.active {
    color: #1f2937;
    border-bottom-color: var(--primary);
    font-weight: 500;
}

/* Course Sections */
.course-sections {
    background: white;
    padding: 0;
    margin-top: 0;
}

/* Sections Toolbar */
.sections-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
}

.toggle-all-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 0;
    transition: opacity 0.2s;
    padding-right: 15px;
}

.toggle-all-btn:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Section Accordion */
.section-accordion {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 16px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.section-header {
    width: 100%;
    background: white;
    border: none;
    padding: 18px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: background 0.2s;
    text-align: left;
}

.section-header:hover {
    background: #f9fafb;
}

.section-header .icons-collapse-expand {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    color: #1f2937 !important;
    background-color: #e9ecef !important;
    border: 1px solid transparent !important;
    border-radius: 50%;
    width: 36px;
    height: 34px;
    padding: 0;
    flex-shrink: 0;
    transition: border-color 0.2s ease;
}

.section-header .icons-collapse-expand i.icon,
.section-header .icons-collapse-expand .fa {
    color: #1f2937 !important;
}

.section-header:hover .icons-collapse-expand {
    border-color: #1f2937 !important;
}

.section-header .icons-collapse-expand:hover,
.section-header .icons-collapse-expand:focus {
    background-color: #f8f9fa !important;
    border-color: #1f2937 !important;
    box-shadow: none !important;
}

.icons-collapse-expand .collapsed-icon {
    display: none;
    align-items: center;
    justify-content: center;
}

.icons-collapse-expand.collapsed .collapsed-icon {
    display: flex;
}

.icons-collapse-expand .expanded-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.icons-collapse-expand.collapsed .expanded-icon {
    display: none;
}

.innovaforma-course-template .section-title {
    flex: 1;
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
    border-bottom: none !important;
    padding-bottom: 0;
}

/* Section Progress Badge */
.section-progress-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #e8f5e9;
    color: #2e7d32;
    font-size: 0.813rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 12px;
    min-width: 48px;
    flex-shrink: 0;
}

/* Section Content */
.section-content {
    display: none;
    padding: 20px 24px 24px 24px;
    background: white;
    border-top: 1px solid #f3f4f6;
}

.section-content.show {
    display: block;
}

.section-summary {
    color: #6b7280;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: #f9fafb;
    border-left: 3px solid var(--primary);
    border-radius: 4px;
    font-size: 0.875rem;
    line-height: 1.6;
}

.section-subtitle {
    font-size: 0.813rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

/* Activities List */
.activities-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.15s;
}

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

.activity-item:hover {
    background: #fafafa;
    margin: 0 -16px;
    padding-left: 16px;
    padding-right: 16px;
}

.activity-check {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.activity-check-placeholder {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.activity-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.activity-icon img {
    max-width: 24px;
    max-height: 24px;
}

.activity-link,
.activity-name {
    font-size: 0.938rem;
    color: var(--primary);
    font-weight: 400;
    text-decoration: none;
    flex: 1;
}

.activity-link:hover {
    text-decoration: underline;
}

/* Footer Sticky - Continuar donde lo dejaste (botón flotante) */
.course-continue-footer {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    background: transparent;
    padding: 0;
    box-shadow: none;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}

.continue-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: white;
    color: #1F4C78;
    border: 1px solid #1F4C78;
    padding: 12px 28px;
    font-size: 0.938rem;
    font-weight: 600;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: auto;
    box-shadow: 0 4px 16px rgba(92, 102, 173, 0.35);
}

.continue-btn:hover {
    background: #1F4C78;
    color: white;
}

.continue-btn i {
    font-size: 1.2rem;
}

/* Padding inferior para que el contenido no quede oculto por el botón flotante */
.innovaforma-course-template {
    padding-bottom: 40px;
}

/* Responsive */
@media (max-width: 768px) {
    .course-progress-header,
    .course-tabs,
    .section-header,
    .section-content {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .tab-button {
        padding: 12px 16px;
        font-size: 0.875rem;
    }
    
    .section-title {
        font-size: 1rem;
    }
    
    .section-action {
        display: none;
    }
    
    .activity-item {
        padding: 12px 15px;
    }
}

.btn-icon.icons-collapse-expand:hover {
    outline: none;
}

@media (max-width: 991.98px) {
    nav.navbar.nav-compact #nav-course-progress,
    nav.navbar.nav-activity-progress #nav-course-progress {
        position: fixed;
        top: var(--navbar-height, 56px);
        left: 0;
        right: 0;
        width: 100%;
        margin: 0;
        padding: 6px 16px 8px;
        background: #fff;
        border-bottom: 1px solid #e5e7eb;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
        z-index: 1019;
        gap: 4px;
    }

    /* Compensar el alto de la franja para que el primer módulo no quede tapado. */
    body:has(nav.navbar.nav-compact) #page,
    body:has(nav.navbar.nav-activity-progress) #page {
        padding-top: 56px;
    }
}