/* ═══════════════════════════════════════
   Lesson Player — CSS v2.1
   ═══════════════════════════════════════ */

/* ── Steps Widget ── */
.lp-steps-widget {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,.08);
    font-family: inherit;
    direction: rtl;
}

.lp-widget-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
    color: #fff;
    font-weight: 700;
    font-size: 15px;
}

.lp-widget-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;opacity: .9;
}

.lp-steps-count {
    margin-right: auto;
    font-size: 11px;
    font-weight: 500;
    background: rgba(255,255,255,.18);
    padding: 3px 10px;
    border-radius: 20px;
}

.lp-steps-list {
    list-style: none;
    margin: 0;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.lp-step-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13.5px;
    color: #374151;
    transition: background .18s, color .18s, box-shadow .18s;
    position: relative;
}

.lp-step-item:hover {
    background: #f0f5ff;
    color: #1d4ed8;
}

.lp-step-item.active {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: #1d4ed8;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(37,99,235,.12);
}

.lp-step-num {
    min-width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .18s, color .18s;
}

.lp-step-item.active .lp-step-num {
    background: #2563eb;
    color: #fff;
}

.lp-step-label {
    flex: 1;
    line-height: 1.5;
}

.lp-step-badges {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.lp-badge {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lp-badge svg { width: 12px; height: 12px; }

.lp-badge-video { background: #dbeafe; color: #1d4ed8; }
.lp-badge-audio { background: #dcfce7; color: #16a34a; }
.lp-badge-text  { background: #fef9c3; color: #a16207; }

.lp-step-arrow {
    width: 14px;
    height: 14px;
    opacity: .35;
    flex-shrink: 0;transition: opacity .18s, transform .18s;
}
.lp-step-item.active .lp-step-arrow,
.lp-step-item:hover .lp-step-arrow {
    opacity: .7;
    transform: translateX(-2px);
}

/* ── Content Area ── */

.lp-content-area {
    width: 100%;
    font-family: inherit;
    direction: rtl;
    position: relative;
    background: #f8fafc;
    border-radius: 20px;
    padding: 0 0 8px;
    overflow: hidden;
}

.lp-content-header {
    padding: 0;
    margin-bottom: 0;
    border-bottom: none;
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
    padding: 24px 28px 20px;
}

.lp-content-header-inner {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.lp-content-step-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(255,255,255,.18);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,.25);
}

.lp-content-title {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    transition: opacity .25s;
    line-height: 1.4;
}

.lp-player-area {
    position: relative;
    padding: 24px 20px 16px;
}

/* ── Book Lessons Shortcode ── */
.lp-book-lessons {
    direction: rtl;
    font-family: inherit;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,.08);
}

.lp-book-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
    color: #fff;
}

.lp-book-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255,255,255,.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.lp-book-icon svg { width: 22px; height: 22px; }

.lp-book-label {
    display: block;
    font-size: 11px;
    opacity: .7;
    font-weight: 500;
    margin-bottom: 2px;
}
.lp-book-title {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
    color: #fff;
}
.lp-book-count {
    margin-right: auto;
    font-size: 11px;
    font-weight: 600;
    background: rgba(255,255,255,.18);
    padding: 4px 12px;
    border-radius: 20px;
    white-space: nowrap;
    border: 1px solid rgba(255,255,255,.2);
}

.lp-lessons-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 8px;
}

.lp-lesson-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 12px;
    text-decoration: none;
    color: #374151;
    transition: background .18s, box-shadow .18s, transform .18s;
    border: 1px solid transparent;
    margin-bottom: 4px;
}
.lp-lesson-card:last-child { margin-bottom: 0; }

.lp-lesson-card:hover {
    background: #f0f5ff;
    color: #1d4ed8;
    border-color: #dbeafe;
    transform: translateX(-3px);
    text-decoration: none;
}

.lp-lesson-current {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: #1d4ed8;
    font-weight: 600;
    border-color: #bfdbfe !important;
    box-shadow: 0 2px 12px rgba(37,99,235,.12);
}

.lp-lesson-num {
    min-width: 32px;
    height: 32px;
    border-radius: 10px;
    background: #e2e8f0;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.lp-lesson-current .lp-lesson-num {
    background: #2563eb;
    color: #fff;
}

.lp-lesson-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}
.lp-lesson-title {
    font-size: 14px;
    font-weight: 600;
    color: inherit;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lp-lesson-meta {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
}

.lp-lesson-badges {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.lp-lesson-arrow {
    width: 14px;
    height: 14px;
    opacity: .3;
    flex-shrink: 0;transition: opacity .18s, transform .18s;
}
.lp-lesson-card:hover .lp-lesson-arrow,
.lp-lesson-current .lp-lesson-arrow {
    opacity: .7;
    transform: translateX(-2px);
}

@media (max-width: 600px) {
    .lp-book-header  { padding: 16px 18px; gap: 12px; }
    .lp-lesson-card  { padding: 12px 14px; }
    .lp-content-header { padding: 18px 18px 16px; }
    .lp-player-area  { padding: 16px 14px; }
}

/* ── Step Content ── */
.lp-step-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ── Media Cards ── */
.lp-media-card {
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 8px 32px rgba(0,0,0,.08);
    transition: box-shadow .25s, transform .25s;
}
.lp-media-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,.08), 0 16px 48px rgba(0,0,0,.12);
    transform: translateY(-3px);
}

.lp-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
}

.lp-card-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;flex-shrink: 0;
}
.lp-card-icon-wrap svg { width: 20px; height: 20px; }

.lp-icon-video { background: #dbeafe; color: #1d4ed8; }
.lp-icon-audio { background: #dcfce7; color: #16a34a; }
.lp-icon-text  { background: #fef9c3; color: #a16207; }

.lp-card-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.lp-card-type {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    opacity: .55;
    color: #374151;
}
.lp-card-title {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
}

/* Video */
.lp-video-card .lp-card-header {
    border-bottom: 1px solid #f1f5f9;
}
.lp-video-wrap { background: #0f172a; }
.lp-video {
    width: 100%;
    display: block;
    max-height: 460px;
}

/* Audio */
.lp-audio-card .lp-card-header {
    border-bottom: 1px solid #f0fdf4;
}
.lp-audio-wrap {
    background: linear-gradient(160deg, #f0fdf4, #dcfce7);
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.lp-wave {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 40px;
}
.lp-wave span {
    display: block;
    width: 4px;
    border-radius: 4px;
    background: #16a34a;
    opacity: .7;
    animation: lp-wave 1.2s ease-in-out infinite;
}
.lp-wave span:nth-child(1) { height: 16px; animation-delay: 0s; }
.lp-wave span:nth-child(2) { height: 28px; animation-delay: .1s; }
.lp-wave span:nth-child(3) { height: 36px; animation-delay: .2s; }
.lp-wave span:nth-child(4) { height: 40px; animation-delay: .3s; }
.lp-wave span:nth-child(5) { height: 36px; animation-delay: .2s; }
.lp-wave span:nth-child(6) { height: 28px; animation-delay: .1s; }
.lp-wave span:nth-child(7) { height: 16px; animation-delay: 0s; }

@keyframes lp-wave {
    0%, 100% { transform: scaleY(1); }
    50%       { transform: scaleY(0.4); }
}

.lp-audio {
    width: 100%;
    border-radius: 10px;
    filter: hue-rotate(120deg);
}

/* Text */
.lp-text-card .lp-card-header {
    border-bottom: 1px solid #fef9c3;
}
.lp-text-content {
    padding: 24px;
    background: #fffef7;
    line-height: 2.1;
    font-size: 15px;
    color: #374151;
}

/* ── Loading Overlay ── */
.lp-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,.8);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.lp-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
}

.lp-loader-ring {
    width: 44px;
    height: 44px;
    border: 3px solid #e2e8f0;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: lp-spin .7s linear infinite;
}

@keyframes lp-spin { to { transform: rotate(360deg); } }

/* ── Responsive ── */
@media (max-width: 600px) {
    .lp-content-title { font-size: 18px; }
    .lp-card-header    { padding: 12px 16px; }
    .lp-text-content   { padding: 16px; }
    .lp-audio-wrap     { padding: 20px 16px; }
}
