/* =========================================================================
   Custom LMS v3 — premium frontend styles
   Paleta: burgundy #70000e · cream #fffaee · dark #121212 · card #1A1A1A
   Typography: Playfair Display (headings) · Roboto (body)
   Only layout / hover / responsive concerns here. Visual tokens live inline
   in the templates so they render even if this stylesheet fails to load.
   ========================================================================= */

:root {
    --lms-burgundy:    #70000e;
    --lms-burgundy-2:  #8a1522;
    --lms-cream:       #fffaee;
    --lms-parchment:   #F4EFE7;
    --lms-dark:        #121212;
    --lms-dark-2:      #1A1A1A;
    --lms-navy:        #0F1B4D;
    --lms-vanilla:     #E6DABE;
    --lms-success:     #10b981;
    --lms-muted:       #aaaaaa;
    --lms-border:      rgba(255, 255, 255, 0.08);

    --lms-font-display: 'Playfair Display', Georgia, serif;
    --lms-font-body:    'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;

    --lms-radius-pill: 50px;
    --lms-radius-card: 16px;

    --lms-space-1: 8px;
    --lms-space-2: 16px;
    --lms-space-3: 24px;
    --lms-space-4: 32px;
    --lms-space-5: 48px;

    --lms-gray-2:      #c0bfc2;
    --lms-border-soft: #2a2a2a;
    --lms-card:        var(--lms-dark-2);
}

/* ---------- Course grid (course-single.php) ------------------------------- */

.lms-lesson-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media (min-width: 640px) {
    .lms-lesson-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .lms-lesson-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 28px;
    }
}

.lms-lesson-card {
    display: flex;
    flex-direction: column;
    background-color: #1A1A1A;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    border: 1px solid transparent;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.lms-lesson-card:hover,
.lms-lesson-card:focus-visible {
    transform: translateY(-4px) scale(1.015);
    border-color: #70000e;
    box-shadow: 0 14px 32px rgba(112, 0, 14, 0.35);
    outline: none;
}

.lms-lesson-card-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    background-color: #000;
    overflow: hidden;
}

.lms-lesson-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.lms-lesson-card:hover .lms-lesson-card-thumb img {
    transform: scale(1.06);
}

.lms-lesson-card-thumb-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #0a0a0a;
    color: #70000e;
}

.lms-lesson-card-thumb-fallback .dashicons {
    font-size: 56px;
    width: 56px;
    height: 56px;
}

.lms-lesson-card-duration {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.75);
    color: #fffaee;
    font-family: 'Roboto', sans-serif;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    letter-spacing: 0.02em;
}

.lms-lesson-card-completed {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 30px;
    height: 30px;
    background-color: #10b981;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

.lms-lesson-card-body {
    padding: 20px 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lms-lesson-card-number {
    font-family: 'Roboto', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #70000e;
}

.lms-lesson-card-title {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    color: #ffffff;
    margin: 0;
}

.lms-lesson-card-status {
    margin-top: 6px;
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    color: #888;
    letter-spacing: 0.02em;
}

.lms-lesson-card.is-completed .lms-lesson-card-status {
    color: #10b981;
    font-weight: 600;
}

/* ---------- Lesson page layout (lesson-player.php) ------------------------ */

.lms-lesson-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}

@media (min-width: 1024px) {
    .lms-lesson-layout {
        grid-template-columns: minmax(0, 1fr) 340px;
        gap: 40px;
        align-items: flex-start;
    }
}

.lms-lesson-main {
    min-width: 0;
}

/* ---------- Sidebar playlist --------------------------------------------- */

.lms-lesson-sidebar {
    background-color: #1A1A1A;
    border-radius: 12px;
    border: 1px solid #262626;
    overflow: hidden;
}

@media (min-width: 1024px) {
    .lms-lesson-sidebar {
        position: sticky;
        top: 24px;
        max-height: calc(100vh - 48px);
        display: flex;
        flex-direction: column;
    }
}

.lms-sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background-color: #1A1A1A;
    color: #fffaee;
    border: none;
    padding: 16px 20px;
    font-family: 'Roboto', sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.02em;
}

.lms-sidebar-toggle:hover {
    background-color: #242424;
}

.lms-sidebar-toggle-icon {
    transition: transform 0.2s ease;
    display: inline-block;
}

.lms-sidebar-inner.is-open + .lms-sidebar-toggle .lms-sidebar-toggle-icon,
.lms-sidebar-toggle[aria-expanded="true"] .lms-sidebar-toggle-icon {
    transform: rotate(180deg);
}

.lms-sidebar-inner {
    display: none;
}

.lms-sidebar-inner.is-open {
    display: block;
}

@media (min-width: 1024px) {
    .lms-sidebar-toggle {
        display: none;
    }
    .lms-sidebar-inner {
        display: flex !important;
        flex-direction: column;
        overflow: hidden;
    }
}

.lms-sidebar-header {
    padding: 24px 22px 18px;
    border-bottom: 1px solid #262626;
}

.lms-sidebar-eyebrow {
    display: block;
    font-family: 'Roboto', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #70000e;
    margin-bottom: 6px;
}

.lms-sidebar-course-title {
    display: block;
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    line-height: 1.3;
    margin-bottom: 6px;
}

.lms-sidebar-course-title:hover {
    color: #70000e;
}

.lms-sidebar-count {
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    color: #888;
}

.lms-sidebar-lessons {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    flex: 1 1 auto;
}

.lms-sidebar-lessons::-webkit-scrollbar {
    width: 6px;
}

.lms-sidebar-lessons::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}

.lms-sidebar-item {
    border-bottom: 1px solid #222;
}

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

.lms-sidebar-item a {
    display: flex;
    gap: 14px;
    padding: 14px 18px;
    text-decoration: none;
    color: #cccccc;
    transition: background-color 0.2s ease;
}

.lms-sidebar-item a:hover {
    background-color: #242424;
    color: #ffffff;
}

.lms-sidebar-item.is-current a {
    background-color: rgba(112, 0, 14, 0.18);
    border-left: 3px solid #70000e;
    padding-left: 15px;
    color: #ffffff;
}

.lms-sidebar-item.is-done .lms-sidebar-title {
    color: #888;
}

.lms-sidebar-thumb {
    position: relative;
    flex: 0 0 82px;
    width: 82px;
    aspect-ratio: 16 / 9;
    background-color: #000;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
}

.lms-sidebar-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.lms-sidebar-thumb .dashicons {
    font-size: 22px;
    width: 22px;
    height: 22px;
}

.lms-sidebar-indicator {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.55);
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.lms-sidebar-item.is-current .lms-sidebar-indicator,
.lms-sidebar-item.is-done .lms-sidebar-indicator {
    opacity: 1;
}

.lms-sidebar-item.is-current .lms-sidebar-indicator {
    background-color: rgba(112, 0, 14, 0.75);
}

.lms-sidebar-item.is-done .lms-sidebar-indicator {
    background-color: rgba(16, 185, 129, 0.75);
}

.lms-sidebar-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    flex: 1 1 auto;
}

.lms-sidebar-number {
    font-family: 'Roboto', sans-serif;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.3px;
    text-transform: uppercase;
    color: #70000e;
}

.lms-sidebar-title {
    font-family: 'Playfair Display', serif;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    color: #ffffff;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.lms-sidebar-duration {
    font-family: 'Roboto', sans-serif;
    font-size: 12px;
    color: #888;
}

/* ---------- Reusable stats row (★ rating + 💬 comments) ------------------ */

.lms-stats-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin: 2px 0;
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    line-height: 1.2;
    color: #c0bfc2;
}

.lms-stats-row.is-compact {
    gap: 0;
    font-size: 12px;
}

.lms-stat {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.lms-stat-icon {
    flex: 0 0 auto;
    display: block;
}

.lms-stat-rating .lms-stat-icon {
    color: #E6DABE;
}

.lms-stat-comments .lms-stat-icon {
    color: #c0bfc2;
}

.lms-stat-value {
    font-weight: 600;
    color: #c0bfc2;
}

.lms-stat-rating .lms-stat-value {
    color: #E6DABE;
}

.lms-stat-count {
    color: #888;
    font-weight: 400;
}

/* ---------- Rating widget (5-star) --------------------------------------- */

.lms-rating-widget {
    margin-top: 40px;
    padding: 24px 26px;
    background-color: #1A1A1A;
    border: 1px solid #262626;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: border-color 0.2s ease;
}

.lms-rating-widget.has-error {
    border-color: #b91c1c;
}

.lms-rating-widget.is-saving {
    opacity: 0.7;
    pointer-events: none;
}

.lms-rating-stars {
    display: inline-flex;
    gap: 6px;
}

.lms-star {
    background: transparent;
    border: none;
    padding: 2px;
    cursor: pointer;
    color: #4A2F1B;
    line-height: 0;
    transition: color 150ms ease, transform 150ms ease;
}

.lms-star svg {
    display: block;
    width: 28px;
    height: 28px;
}

@media (min-width: 640px) {
    .lms-star svg {
        width: 24px;
        height: 24px;
    }
}

.lms-star.is-filled {
    color: #E6DABE;
}

.lms-rating-widget:not(.is-readonly) .lms-star:hover,
.lms-rating-widget:not(.is-readonly) .lms-star:focus-visible {
    color: #E6DABE;
    transform: scale(1.1);
    outline: none;
}

.lms-rating-widget.is-readonly .lms-star {
    cursor: default;
    padding: 0;
}

.lms-rating-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    align-items: center;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    color: #c0bfc2;
}

.lms-rating-summary {
    color: #E6DABE;
    font-weight: 600;
}

.lms-rating-avg {
    font-size: 16px;
}

.lms-rating-count-wrap {
    color: #888;
    font-weight: 400;
    margin-left: 6px;
}

.lms-rating-user-state {
    color: #888;
    font-size: 13px;
}

/* ---------- Comments section --------------------------------------------- */

.lms-comments-section {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid #262626;
}

.lms-comments-title {
    font-family: 'Playfair Display', serif;
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 24px;
}

.lms-comments-gate {
    padding: 32px 28px;
    background-color: #1A1A1A;
    border: 1px solid #262626;
    border-radius: 10px;
    text-align: center;
    font-family: 'Roboto', sans-serif;
    color: #c0bfc2;
}

.lms-comments-gate p {
    margin: 0 0 18px;
    font-size: 15px;
    line-height: 1.6;
}

.lms-gate-cta {
    display: inline-block;
    background-color: #70000e;
    color: #fffaee;
    padding: 12px 28px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: opacity 0.2s ease;
}

.lms-gate-cta:hover {
    opacity: 0.85;
    color: #fffaee;
}

.lms-comment-list,
.lms-comment-replies {
    list-style: none;
    margin: 0;
    padding: 0;
}

.lms-comment-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.lms-comment-replies {
    margin: 16px 0 0 48px;
    padding-left: 18px;
    border-left: 2px solid #70000e;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.lms-comment {
    display: flex;
    gap: 14px;
    padding: 18px 20px;
    background-color: #1A1A1A;
    border: 1px solid #262626;
    border-radius: 10px;
}

.lms-comment.is-reply {
    background-color: #161616;
    padding: 14px 18px;
}

.lms-comment.is-instructor {
    border-color: rgba(230, 218, 190, 0.35);
}

.lms-comment-avatar-wrap {
    flex: 0 0 48px;
}

.lms-comment-avatar {
    border-radius: 50%;
    display: block;
    width: 48px;
    height: 48px;
    object-fit: cover;
}

.lms-comment-body {
    flex: 1 1 auto;
    min-width: 0;
}

.lms-comment-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 8px;
}

.lms-comment-author {
    font-family: 'Playfair Display', serif;
    font-size: 16px;
    font-weight: 700;
    color: #fffaee;
}

.lms-comment-badge {
    display: inline-block;
    background-color: #E6DABE;
    color: #4A2F1B;
    font-family: 'Roboto', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 50px;
}

.lms-comment-date {
    font-family: 'Roboto', sans-serif;
    font-size: 12px;
    color: #c0bfc2;
}

.lms-comment-content {
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    line-height: 1.65;
    color: #fffaee;
}

.lms-comment-content p {
    margin: 0 0 10px;
}

.lms-comment-content p:last-child {
    margin-bottom: 0;
}

.lms-comment-footer {
    margin-top: 10px;
}

.comment-reply-link {
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #70000e;
    text-decoration: none;
    padding: 4px 0;
    background: none;
    border: none;
    cursor: pointer;
}

.comment-reply-link:hover {
    color: #a10014;
    text-decoration: underline;
}

.lms-comments-pagination {
    margin-top: 24px;
    display: flex;
    gap: 6px;
    justify-content: center;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
}

.lms-comments-pagination a,
.lms-comments-pagination span {
    min-width: 32px;
    padding: 6px 10px;
    border-radius: 6px;
    text-align: center;
    color: #c0bfc2;
    text-decoration: none;
    background-color: #1A1A1A;
    border: 1px solid #262626;
}

.lms-comments-pagination a:hover {
    color: #fffaee;
    border-color: #70000e;
}

.lms-comments-pagination .is-current {
    color: #fffaee;
    background-color: #70000e;
    border-color: #70000e;
    font-weight: 600;
}

/* ---------- Comment form ------------------------------------------------- */

.lms-comment-form-wrap {
    margin-top: 32px;
    padding: 24px 26px;
    background-color: #1A1A1A;
    border: 1px solid #262626;
    border-radius: 10px;
}

.lms-comment-form-title {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 16px;
}

#cancel-comment-reply-link {
    font-family: 'Roboto', sans-serif;
    font-size: 12px;
    color: #c0bfc2;
    margin-left: 12px;
    text-decoration: none;
}

#cancel-comment-reply-link:hover {
    color: #70000e;
}

.lms-comment-field textarea,
#respond textarea {
    width: 100%;
    background-color: #0f0f0f;
    border: 1px solid #4A2F1B;
    border-radius: 8px;
    padding: 12px 14px;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    color: #fffaee;
    resize: vertical;
    min-height: 120px;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.lms-comment-field textarea:focus,
#respond textarea:focus {
    outline: none;
    border-color: #70000e;
}

.form-submit {
    margin-top: 14px;
}

.lms-comment-submit,
#respond .submit {
    background-color: #70000e;
    color: #fffaee;
    border: 2px solid #70000e;
    padding: 12px 30px;
    border-radius: 50px;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.lms-comment-submit:hover,
#respond .submit:hover {
    opacity: 0.85;
}

/* ---------- Heart toggle (favorites) ------------------------------------ */

.lms-heart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    color: #fffaee;
    cursor: pointer;
    flex: 0 0 48px;
    transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, transform 0.15s ease;
}

.lms-heart:hover {
    border-color: #70000e;
    color: #70000e;
}

.lms-heart:focus-visible {
    outline: 2px solid #70000e;
    outline-offset: 2px;
}

.lms-heart svg {
    display: block;
    transition: fill 0.2s ease, stroke 0.2s ease;
}

.lms-heart.is-filled {
    color: #fffaee;
    background-color: #70000e;
    border-color: #70000e;
}

.lms-heart.is-filled svg path {
    fill: currentColor;
    stroke: currentColor;
}

.lms-heart.is-loading {
    pointer-events: none;
    opacity: 0.7;
}

.lms-heart.is-animating {
    animation: lms-heart-pulse 320ms ease;
}

@keyframes lms-heart-pulse {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.25); }
    70%  { transform: scale(0.95); }
    100% { transform: scale(1); }
}
