/* ─── SCORM full-width section (outside rd-grid) ─── */
.rd-scorm-section {
    margin-bottom: 24px;
    overflow: hidden;
}

/* ─── SCORM Table of Contents ─── */
.scorm-toc { padding: 0; }
.scorm-toc-header { padding: 16px 20px 12px; border-bottom: 1px solid #e2e8f0; }
.scorm-toc-title { display: flex; align-items: center; gap: 8px; font-size: 1rem; font-weight: 600; color: #1e293b; margin: 0; }
.scorm-toc-count { font-size: 0.8rem; font-weight: 400; color: #94a3b8; margin-left: auto; }

.scorm-toc-chapters { max-height: 560px; overflow-y: auto; }
.scorm-chapter { border-bottom: 1px solid #e2e8f0; }
.scorm-chapter:last-child { border-bottom: none; }
.scorm-chapter-btn {
    display: flex; align-items: center; gap: 10px;
    width: 100%; padding: 14px 20px;
    border: none; background: #f8fafc; cursor: pointer;
    text-align: left; font-size: 0.95rem; font-weight: 600; color: #1e293b;
    transition: background 0.15s;
}
.scorm-chapter-btn:hover { background: #f0f4f8; }
.scorm-chapter-arrow {
    flex-shrink: 0; color: #94a3b8;
    transition: transform 0.25s ease;
}
.scorm-chapter.is-open .scorm-chapter-arrow { transform: rotate(90deg); }
.scorm-chapter-title { flex: 1; }
.scorm-chapter-count {
    font-size: 0.75rem; font-weight: 400; color: #94a3b8;
    background: #e2e8f0; border-radius: 10px; padding: 2px 10px;
}

.scorm-chapter .scorm-toc-list {
    list-style: none; margin: 0; padding: 0;
    max-height: 0; overflow: hidden;
    transition: max-height 0.3s ease;
}
.scorm-chapter.is-open .scorm-toc-list {
    max-height: 2000px;
}

.scorm-toc-item { border-bottom: 1px solid #f1f5f9; }
.scorm-toc-item:last-child { border-bottom: none; }
.scorm-toc-btn {
    display: flex; align-items: center; gap: 12px;
    width: 100%; padding: 12px 20px 12px 36px;
    border: none; background: none; cursor: pointer;
    text-align: left; font-size: 0.90rem; color: #334155;
    transition: background 0.15s, color 0.15s;
}
.scorm-toc-btn:hover { background: #f0f7ff; color: #1d4ed8; }
.scorm-toc-item.is-active .scorm-toc-btn { background: #eff6ff; color: #1d4ed8; font-weight: 600; }
.scorm-toc-num {
    display: flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; border-radius: 50%;
    background: #e2e8f0; color: #64748b;
    font-size: 0.75rem; font-weight: 700; flex-shrink: 0;
}
.scorm-toc-item.is-active .scorm-toc-num { background: #3b82f6; color: #fff; }
.scorm-toc-label { flex: 1; }

/* ─── SCORM Player ─── */
.scorm-player-toolbar {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 16px; background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    min-height: 48px;
}
.scorm-player-title {
    flex: 1; font-weight: 600; font-size: 0.92rem; color: #1e293b;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    min-width: 0;
}
.scorm-player-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.scorm-player-counter { font-size: 0.8rem; color: #94a3b8; padding: 0 8px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.scorm-nav-btn {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 6px 10px; border: 1px solid #e2e8f0; border-radius: 6px;
    background: #fff; color: #475569; font-size: 0.82rem;
    cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.scorm-nav-btn--icon { padding: 6px 8px; }
.scorm-nav-btn:hover { background: #f1f5f9; color: #1e293b; }
.scorm-nav-btn:disabled { opacity: 0.4; cursor: default; }
.scorm-fullscreen-btn { margin-left: 4px; }
.scorm-player-frame {
    position: relative; width: 100%;
    height: 0; padding-bottom: 62%; min-height: 540px;
    overflow: hidden;
}
.scorm-player-frame.is-fullscreen {
    position: fixed; top: 0; left: 0;
    width: 100vw; height: 100vh;
    padding-bottom: 0; min-height: 0;
    z-index: 9999; background: #fff;
}
.scorm-iframe {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%; border: none;
}

@media (max-width: 768px) {
    .rd-scorm-section { margin-bottom: 16px; }

    .scorm-player-frame { padding-bottom: 120%; min-height: 420px; }

    /* Toolbar: titlu pe rândul 2, acțiuni rămân sus */
    .scorm-player-toolbar {
        flex-wrap: wrap;
        padding: 8px 12px;
        gap: 6px;
    }
    .scorm-player-title {
        order: 10;
        width: 100%;
        font-size: 0.85rem;
        padding: 4px 0 2px;
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
        border-top: 1px solid #e2e8f0;
        margin-top: 2px;
    }
    .scorm-player-actions { margin-left: auto; }
    .scorm-nav-btn { padding: 5px 8px; font-size: 0.8rem; }
    .scorm-player-counter { padding: 0 4px; }

    .scorm-toc-chapters { max-height: none; }
    .scorm-chapter-btn { padding: 12px 14px; font-size: 0.9rem; }
    .scorm-toc-btn { padding: 10px 14px 10px 28px; font-size: 0.85rem; }
}

@media (max-width: 480px) {
    .scorm-player-frame { padding-bottom: 150%; min-height: 340px; }
    .scorm-chapter-count { display: none; }
}

/* ─── Audio Player ─── */
.oer-audio-player {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border-radius: 16px;
    padding: 24px;
    color: #f1f5f9;
    max-width: 100%;
    box-shadow: 0 10px 40px rgba(0,0,0,.25);
}
.oer-ap-top {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}
.oer-ap-cover {
    width: 72px; height: 72px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(255,255,255,.08);
}
.oer-ap-cover img {
    width: 100%; height: 100%; object-fit: cover;
}
.oer-ap-cover-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    color: #94a3b8;
}
.oer-ap-info { flex: 1; min-width: 0; }
.oer-ap-title {
    font-size: 1.05rem; font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.oer-ap-author { font-size: .85rem; color: #94a3b8; margin-top: 2px; }
.oer-ap-meta { font-size: .75rem; color: #64748b; margin-top: 4px; }
.oer-ap-progress-wrap {
    position: relative;
    height: 24px;
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-bottom: 4px;
}
.oer-ap-progress-bg {
    width: 100%; height: 6px;
    background: rgba(255,255,255,.12);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}
.oer-ap-progress-wrap:hover .oer-ap-progress-bg { height: 8px; }
.oer-ap-progress-fill {
    height: 100%; width: 0%;
    background: linear-gradient(90deg, #3b82f6, #6366f1);
    border-radius: 3px;
    transition: width .1s linear;
}
.oer-ap-progress-hover {
    position: absolute; top: 0; left: 0;
    height: 100%; width: 0%;
    background: rgba(255,255,255,.08);
    border-radius: 3px;
    pointer-events: none;
}
.oer-ap-progress-thumb {
    position: absolute;
    width: 14px; height: 14px;
    background: #fff;
    border-radius: 50%;
    left: 0%;
    top: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 1px 6px rgba(0,0,0,.35);
    opacity: 0;
    transition: opacity .15s;
}
.oer-ap-progress-wrap:hover .oer-ap-progress-thumb { opacity: 1; }
.oer-ap-time {
    display: flex;
    justify-content: space-between;
    font-size: .75rem;
    color: #94a3b8;
    margin-bottom: 16px;
    font-variant-numeric: tabular-nums;
}
.oer-ap-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}
.oer-ap-btn {
    background: none; border: none; color: #e2e8f0;
    cursor: pointer; padding: 8px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    position: relative;
    transition: background .15s, color .15s;
}
.oer-ap-btn:hover { background: rgba(255,255,255,.1); color: #fff; }
.oer-ap-btn-play {
    width: 56px; height: 56px;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    border-radius: 50%;
    color: #fff;
}
.oer-ap-btn-play:hover {
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    transform: scale(1.05);
}
.oer-ap-btn-sm { position: relative; }
.oer-ap-skip-label {
    position: absolute;
    font-size: 9px; font-weight: 700;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    color: inherit;
}
.oer-ap-speed {
    font-size: .8rem; font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(255,255,255,.1);
    cursor: pointer;
    user-select: none;
    transition: background .15s;
}
.oer-ap-speed:hover { background: rgba(255,255,255,.2); }
.oer-ap-volume-wrap {
    display: flex; align-items: center; gap: 4px;
    margin-left: auto;
}
.oer-ap-volume-slider {
    -webkit-appearance: none; appearance: none;
    width: 80px; height: 4px;
    background: rgba(255,255,255,.2);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}
.oer-ap-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px; height: 12px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
}
.oer-ap-volume-slider::-moz-range-thumb {
    width: 12px; height: 12px;
    background: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
}
.oer-audio-player.is-loading .oer-ap-btn-play {
    opacity: .6; pointer-events: none;
}
@media (max-width: 576px) {
    .oer-audio-player { padding: 16px; }
    .oer-ap-cover { width: 56px; height: 56px; }
    .oer-ap-volume-wrap { display: none; }
    .oer-ap-controls { gap: 8px; }
}
