/* ========================================
   SHARED COURSE COMPONENTS STYLES
   Used by both course-player and course-preview pages
   ======================================== */

/* ========================================
   MODERN VIDEO META BAR
   ======================================== */
.video-meta-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 16px;
}

.instructor-badge {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.instructor-badge:hover .instructor-name-text {
    color: #2563eb;
}

.instructor-photo {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    object-fit: cover;
    border: 2.5px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

.instructor-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3b82f6 0%, #0ea5e9 100%);
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
}

.instructor-text {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.instructor-role {
    font-size: 0.6875rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.instructor-name-text {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #0f172a;
}

.course-pills {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.course-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #64748b;
    transition: all 0.2s ease;
}

.course-pill::before {
    content: '•';
    margin-right: 0.125rem;
    color: #94a3b8;
}

.course-pill:first-child::before {
    display: none;
}

.course-pill i {
    font-size: 1rem;
    color: #2563eb;
}

.course-pill:hover {
    color: #2563eb;
}

.course-pill:hover i {
    color: #1d4ed8;
}

/* ========================================
   TRANSCRIPT TOGGLE BUTTON
   ======================================== */
.transcript-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid rgba(37, 99, 235, 0.3);
    border-radius: 8px;
    background: rgba(37, 99, 235, 0.08);
    color: #2563eb;
    font-size: 1.125rem;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    animation: ccPulseGlow 2.5s ease-in-out infinite;
}

.transcript-toggle:hover {
    background: rgba(37, 99, 235, 0.15);
    color: #1d4ed8;
    border-color: rgba(37, 99, 235, 0.5);
    transform: scale(1.1);
    animation: none;
    box-shadow: 0 0 12px rgba(37, 99, 235, 0.3);
}

.transcript-toggle--on {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
    animation: none;
    box-shadow: 0 0 14px rgba(37, 99, 235, 0.4);
}

.transcript-toggle--on:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 0 18px rgba(37, 99, 235, 0.5);
}

@keyframes ccPulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
    50%      { box-shadow: 0 0 10px 2px rgba(37, 99, 235, 0.25); }
}

html.dark-mode .transcript-toggle {
    background: rgba(96, 165, 250, 0.1);
    border-color: rgba(96, 165, 250, 0.25);
    color: #60a5fa;
}

html.dark-mode .transcript-toggle:hover {
    background: rgba(96, 165, 250, 0.2);
    color: #93bbfd;
    border-color: rgba(96, 165, 250, 0.45);
    box-shadow: 0 0 12px rgba(96, 165, 250, 0.3);
}

html.dark-mode .transcript-toggle--on {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
    box-shadow: 0 0 14px rgba(96, 165, 250, 0.4);
}

/* ========================================
   VIDEO SUBTITLE OVERLAY (on player)
   ======================================== */
.video-subtitle-wrapper {
    position: relative;
}

.video-subtitle-overlay {
    position: absolute;
    bottom: 48px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    max-width: 85%;
    text-align: center;
    pointer-events: none;
    animation: subtitleFadeIn 0.15s ease-out;
}

.video-subtitle-text {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 6px;
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.5;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

@keyframes subtitleFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@media (max-width: 768px) {
    .video-subtitle-overlay {
        bottom: 28px;
        max-width: 92%;
    }

    .video-subtitle-text {
        font-size: 0.8125rem;
        padding: 4px 10px;
    }
}

/* ========================================
   TRANSCRIPT PANEL (below meta bar)
   ======================================== */
.transcript-player-panel {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 1rem;
    animation: transcriptSlideDown 0.2s ease-out;
    position: relative;
}

.transcript-player-panel--expanded {
    max-height: none;
}

.transcript-expand-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-inline-start: 6px;
    white-space: nowrap;
    vertical-align: baseline;
}


html.dark-mode .transcript-player-panel {
    background: #1a1a1a;
    border-color: #334155;
}

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

@media (max-width: 768px) {
    .transcript-player-panel {
        max-height: 200px;
        padding: 0.75rem;
        border-radius: 8px;
    }
}

/* ========================================
   COURSE DETAILS CARD
   ======================================== */
.course-details-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.video-title-display {
    font-size: 1.75rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 1.5rem 0;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.description-block {
    margin-bottom: 1.75rem;
}

.desc-content {
    color: #475569;
    font-size: 1rem;
    line-height: 1.75;
    margin-bottom: 0.75rem;
}

.expand-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0;
    background: none;
    border: none;
    color: #2563eb;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s ease;
}

.expand-btn:hover {
    color: #1d4ed8;
}

.expand-btn i {
    font-size: 1rem;
    transition: transform 0.2s ease;
}

.expand-btn[aria-expanded="true"] i {
    transform: rotate(180deg);
}

/* ========================================
   LEARNING OUTCOMES SECTION
   ======================================== */
.learning-outcomes {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-radius: 12px;
    padding: 1.5rem;
}

.outcomes-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.outcomes-icon-wrapper {
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.outcomes-icon-wrapper i {
    font-size: 1.25rem;
    color: #0ea5e9;
}

.outcomes-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.outcomes-list {
    color: #475569;
    font-size: 0.9375rem;
    line-height: 1.75;
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

/* Display Utilities */
/* Removed .d-none to avoid conflict with Bootstrap */
.d-flex {
    display: flex !important;
}

/* Text Decoration */
.text-decoration-none {
    text-decoration: none !important;
}

/* Section Divider */
.section-divider {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 1.5rem 0;
}

/* Content Typography */
.content-text {
    color: #475569;
    font-size: 0.9375rem;
    line-height: 1.75;
}

.content-heading {
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 1rem 0;
}

/* ========================================
   MOBILE RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .video-meta-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1rem;
    }

    .instructor-badge {
        width: 100%;
    }

    .course-pills {
        width: 100%;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .course-pill {
        flex: 0 0 auto;
        min-width: auto;
        justify-content: flex-start;
        padding: 0.375rem 0.75rem;
        background: #f1f5f9;
        border-radius: 6px;
        font-size: 0.75rem;
    }

    .course-pill::before {
        display: none;
    }

    .course-details-card {
        padding: 1.5rem;
    }

    .video-title-display {
        font-size: 1.375rem;
    }
}

/* ========================================
   MARKDOWN CONTENT CLAMP
   Used to collapse long markdown sections
   with a max-height + fade-out mask
   ======================================== */
.markdown-clamp {
    max-height: 200px;
    overflow: hidden;
    position: relative;
}

.markdown-clamp::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    pointer-events: none;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    margin-top: 1em;
    margin-bottom: 0.5em;
    font-weight: 600;
    line-height: 1.3;
}

.markdown-content h1 { font-size: 1.5rem; }
.markdown-content h2 { font-size: 1.3rem; }
.markdown-content h3 { font-size: 1.15rem; }
.markdown-content h4 { font-size: 1.05rem; }

.markdown-content p {
    margin-bottom: 0.75rem;
    line-height: 1.7;
}

.markdown-content ul,
.markdown-content ol {
    margin-bottom: 0.75rem;
    padding-left: 1.5em;
}

[dir="rtl"] .markdown-content ul,
[dir="rtl"] .markdown-content ol {
    padding-left: 0;
    padding-right: 1.5em;
}

.markdown-content li {
    margin-bottom: 0.35em;
    line-height: 1.6;
}

.markdown-content strong {
    font-weight: 600;
}

.markdown-content code {
    background: rgba(0, 0, 0, 0.06);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    font-size: 0.9em;
}

.markdown-content a {
    color: #3b82f6;
    text-decoration: underline;
}

.markdown-content a:hover {
    color: #2563eb;
}
