/**
 * PinkCode LearnDash Beautifier - Main Stylesheet
 * 
 * Enhances LearnDash LMS visual appearance with modern, beautiful styling
 * that matches College 2b branding (cyan/blue gradient theme).
 * 
 * @package PinkCodeLearnDashBeautifier
 * @version 1.0.0
 * @author Pink Code Queen - Lumina Ashley
 */

/* ==========================================================================
   1. NAVIGATION BUTTONS - COMPACT SINGLE ROW
   ========================================================================== */

/* Button container - single row, compact */
body .learndash-wrapper .ld-content-actions,
body div.learndash-wrapper div.ld-content-actions {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 8px !important;
    margin: 20px 0 !important;
    padding: 0 !important;
}

/* Individual button wrappers - inline, no stacking */
body .learndash-wrapper .ld-content-action,
body div.learndash-wrapper div.ld-content-action {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    min-height: initial !important;
    margin: 0 !important;
}

/* All buttons and forms - compact sizing */
body .learndash-wrapper .ld-content-action > a.ld-button,
body .learndash-wrapper .ld-content-action > form.sfwd-mark-complete,
body .learndash-wrapper .ld-content-action > a.ld-course-step-back,
body div.learndash-wrapper div.ld-content-action > a.ld-button {
    width: auto !important;
    max-width: fit-content !important;
}

/* ==========================================================================
   Base Design Tokens & Utilities
   ========================================================================== */

:root {
    --pcld-color-blue-300: #7dd3fc;
    --pcld-color-blue-400: #38c6e8;
    --pcld-color-blue-500: #0891b2;
    --pcld-color-blue-600: #06829e;
    --pcld-color-blue-700: #047a93;
    --pcld-color-green-400: #34d399;
    --pcld-color-green-500: #10b981;
    --pcld-color-green-600: #059669;
    --pcld-color-emerald-700: #047857;
    --pcld-color-amber-500: #f59e0b;
    --pcld-color-amber-600: #d97706;
    --pcld-color-rose-500: #dc2626;
    --pcld-color-rose-600: #b91c1c;
    --pcld-color-slate-900: #0f172a;
    --pcld-color-slate-800: #1e293b;
    --pcld-color-slate-700: #334155;
    --pcld-color-slate-600: #475569;
    --pcld-color-slate-500: #64748b;
    --pcld-color-slate-400: #94a3b8;
    --pcld-color-slate-300: #cbd5e1;
    --pcld-surface-100: #f8fafc;
    --pcld-surface-200: #f1f5f9;
    --pcld-surface-300: #e2e8f0;
    --pcld-radius-sm: 8px;
    --pcld-radius-md: 12px;
    --pcld-radius-lg: 16px;
    --pcld-radius-xl: 24px;
    --pcld-shadow-soft: 0 4px 16px rgba(15, 118, 110, 0.12);
    --pcld-shadow-glow: 0 10px 30px rgba(8, 145, 178, 0.25);
    --pcld-shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.35);
    --pcld-transition: all 0.3s ease;
    --pcld-transition-fast: all 0.2s ease;
    --pcld-gradient-primary: linear-gradient(135deg, #0891b2 0%, #01cfdd 100%);
    --pcld-gradient-primary-dark: linear-gradient(135deg, #06829e 0%, #01b8c7 100%);
    --pcld-gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --pcld-gradient-success-dark: linear-gradient(135deg, #059669 0%, #047857 100%);
    --pcld-gradient-warning: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --pcld-gradient-danger: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

@media (prefers-color-scheme: dark) {
    :root {
        --pcld-surface-100: #1e293b;
        --pcld-surface-200: #162031;
        --pcld-surface-300: #101829;
        --pcld-shadow-soft: 0 18px 30px rgba(2, 6, 23, 0.55);
    }
}

.learndash-wrapper .pcld-surface {
    background: var(--pcld-surface-100);
    border-radius: var(--pcld-radius-lg);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

@media (prefers-color-scheme: dark) {
    .learndash-wrapper .pcld-surface {
        background: var(--pcld-surface-200);
        box-shadow: 0 12px 24px rgba(2, 6, 23, 0.4);
    }
}

.learndash-wrapper .pcld-elevated {
    box-shadow: var(--pcld-shadow-soft);
}

.learndash-wrapper a:focus-visible,
.learndash-wrapper button:focus-visible,
.learndash-wrapper [role="button"]:focus-visible,
.learndash-wrapper input:focus-visible,
.learndash-wrapper select:focus-visible,
.learndash-wrapper textarea:focus-visible {
    outline: 3px solid var(--pcld-color-blue-400);
    outline-offset: 2px;
}

.learndash-wrapper .pcld-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.4px;
}

.learndash-wrapper .pcld-animated {
    transition: var(--pcld-transition);
}

.learndash-wrapper .ld-modal {
    z-index: 100001;
}

@media (prefers-reduced-motion: reduce) {
    .learndash-wrapper .pcld-animated,
    .learndash-wrapper .pcld-animated::before,
    .learndash-wrapper .pcld-animated::after {
        animation: none !important;
        transition: none !important;
    }
}

@media (prefers-contrast: more) {
    .learndash-wrapper .pcld-contrast-outline {
        border: 2px solid currentColor;
    }
}

/* Button base styles - COMPACT */
body .learndash-wrapper .ld-button,
body div.learndash-wrapper a.ld-button {
    background: var(--pcld-gradient-primary) !important;
    border: none !important;
    color: #ffffff !important;
    border-radius: var(--pcld-radius-sm);
    padding: 8px 16px !important;
    font-weight: 600;
    font-size: 13px !important;
    letter-spacing: 0.2px;
    line-height: 1.3;
    box-shadow: var(--pcld-shadow-soft);
    transition: var(--pcld-transition-fast);
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-transform: none;
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
    white-space: nowrap;
}

.learndash-wrapper .ld-button:hover,
.learndash-wrapper .ld-button:focus-visible {
    background: var(--pcld-gradient-primary-dark) !important;
    box-shadow: 0 12px 32px rgba(8, 145, 178, 0.25);
    transform: translateY(-1px);
}

.learndash-wrapper .ld-button:active {
    transform: translateY(0);
}

/* "In Progress" badge */
.learndash-wrapper .ld-status.ld-status-progress {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    color: #ffffff !important;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Complete status badge */
.learndash-wrapper .ld-status.ld-status-complete {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    color: #ffffff !important;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Not started status badge */
.learndash-wrapper .ld-status.ld-status-incomplete {
    background: #e5e7eb !important;
    color: #64748b !important;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Course progress bar */
.learndash-wrapper .ld-progress {
    background: #e5e7eb;
    border-radius: 12px;
    height: 12px;
    overflow: hidden;
    margin: 16px 0;
}

.learndash-wrapper .ld-progress-bar {
    background: linear-gradient(90deg, #0891b2, #01cfdd);
    height: 100%;
    transition: width 0.5s ease;
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.3);
}

/* Progress percentage text */
.learndash-wrapper .ld-progress-percentage {
    font-weight: 600;
    color: #0891b2;
    font-size: 14px;
}

/* Status icons */
.learndash-wrapper .ld-status-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Complete status */
.learndash-wrapper .ld-status-complete,
.learndash-wrapper .ld-status-icon.ld-status-complete,
.learndash-wrapper .learndash-complete {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

.learndash-wrapper .ld-status-complete::before {
    content: "✓";
    color: white;
    font-weight: bold;
    font-size: 14px;
}

/* Incomplete status */
.learndash-wrapper .ld-status-incomplete,
.learndash-wrapper .ld-status-icon.ld-status-incomplete,
.learndash-wrapper .learndash-incomplete {
    background: #f3f4f6 !important;
    border: 2px solid #d1d5db;
}

/* In Progress status */
.learndash-wrapper .ld-status-in-progress {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
}

/* ==========================================================================
   4. TYPOGRAPHY (Priority 4 - Polish)
   ========================================================================== */

/* Main headings */
.learndash-wrapper h1,
.learndash-wrapper .ld-lesson-item-preview h3 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #1e293b;
    margin-bottom: 12px;
}

.learndash-wrapper h1 {
    font-size: 2.25rem;
    line-height: 1.2;
}

.learndash-wrapper h2 {
    font-size: 1.875rem;
    font-weight: 600;
    color: #334155;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.learndash-wrapper h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #475569;
}

.learndash-wrapper h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #64748b;
}

/* Lesson list item titles */
.learndash-wrapper .ld-item-title {
    font-size: 1rem;
    font-weight: 500;
    color: #334155;
    line-height: 1.5;
}

/* Meta information */
.learndash-wrapper .ld-item-details {
    font-size: 0.875rem;
    color: #64748b;
}

/* Body text */
.learndash-wrapper p {
    font-size: 1rem;
    line-height: 1.7;
    color: #475569;
}

/* ==========================================================================
   5. COURSE LIST (Priority 5 - Final Touches)
   ========================================================================== */

/* Course list container */
.learndash-wrapper .ld-item-list {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Section heading */
.learndash-wrapper .ld-section-heading h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 16px;
}

/* Individual lesson items */
.learndash-wrapper .ld-item-list-item {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
    background: #f8fafc;
}

.learndash-wrapper .ld-item-list-item:hover {
    background: #f1f5f9;
    transform: translateX(4px);
}

/* Active/current lesson */
.learndash-wrapper .ld-item-list-item.ld-is-current-lesson,
.learndash-wrapper .ld-item-list-item.learndash-current {
    background: linear-gradient(135deg, rgba(8, 145, 178, 0.1), rgba(1, 207, 221, 0.1));
    border-left: 4px solid #0891b2;
}

/* Lesson link */
.learndash-wrapper .ld-item-name {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none !important;
    color: #334155;
    font-weight: 500;
}

.learndash-wrapper .ld-item-name:hover {
    color: #0891b2 !important;
}

/* Lesson preview area */
.learndash-wrapper .ld-item-list-item-preview {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ==========================================================================
   6. RESPONSIVE DESIGN (Mobile & Tablet)
   ========================================================================== */

@media (max-width: 1024px) {
    /* Keep compact single row on tablet */
    body .learndash-wrapper .ld-content-actions,
    body div.learndash-wrapper div.ld-content-actions {
        gap: 6px !important;
        margin: 16px 0 !important;
    }

    body .learndash-wrapper .ld-content-action,
    body div.learndash-wrapper div.ld-content-action {
        min-height: initial !important;
    }

    body .learndash-wrapper .ld-button,
    body .learndash-wrapper .ld-course-step-back,
    body .learndash-wrapper .learndash_mark_complete_button {
        padding: 7px 12px !important;
        font-size: 12px !important;
        height: 34px !important;
        min-height: 34px !important;
        max-height: 34px !important;
    }

    .learndash-wrapper .ld-button .ld-text,
    .learndash-wrapper .ld-button .ld-icon,
    .learndash-wrapper .ld-content-action .ld-text {
        font-size: 12px !important;
    }
}

@media (max-width: 768px) {
    /* Keep single row on mobile, allow wrapping if needed */
    body .learndash-wrapper .ld-content-actions,
    body div.learndash-wrapper div.ld-content-actions {
        gap: 6px !important;
        margin: 14px 0 !important;
    }

    body .learndash-wrapper .ld-content-action,
    body div.learndash-wrapper div.ld-content-action {
        width: auto !important;
    }

    body .learndash-wrapper .ld-button,
    body .learndash-wrapper .ld-course-step-back,
    body .learndash-wrapper .learndash_mark_complete_button {
        padding: 6px 10px !important;
        font-size: 11px !important;
        height: 32px !important;
        min-height: 32px !important;
        max-height: 32px !important;
    }

    .learndash-wrapper .ld-button .ld-text,
    .learndash-wrapper .ld-button .ld-icon {
        font-size: 11px !important;
    }
}
        width: 100%;
        justify-content: center;
        text-align: center;
        padding: 7px 10px !important;
        font-size: 12px;
        height: 34px;
    }

    /* Breadcrumbs on tablet */
    .learndash-wrapper .ld-breadcrumbs {
        padding: 10px 14px;
    }

    .learndash-wrapper .ld-breadcrumbs-segments {
        font-size: 12px;
    }

    /* Slightly smaller headings so hero area is tighter */
    .learndash-wrapper h1 {
        font-size: 1.6rem;
    }

    .learndash-wrapper h2 {
        font-size: 1.4rem;
    }

    .learndash-wrapper h3 {
        font-size: 1.2rem;
    }

    /* Tab content padding */
    .learndash-wrapper .ld-tabs-content {
        padding: 14px;
    }
}

@media (max-width: 480px) {
    /* Extra small screens - very compact controls */
    .learndash-wrapper .ld-content-actions {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        margin: 14px 0 10px;
    }

    .learndash-wrapper .ld-button,
    .learndash-wrapper .ld-course-step-back,
    .learndash-wrapper .learndash_mark_complete_button {
        padding: 6px 8px !important;
        font-size: 11px;
        min-height: 30px;
        height: 30px;
    }

    .learndash-wrapper h1 {
        font-size: 1.4rem;
    }

    /* Tabs text smaller and more compact if any stray ld-tab rules apply */
    .learndash-wrapper .ld-tab {
        padding: 6px 10px;
        font-size: 11px;
    }

    .learndash-wrapper .ld-tab-icon {
        font-size: 12px;
    }

    /* Breadcrumbs on mobile */
    .learndash-wrapper .ld-breadcrumbs {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px 12px;
    }

    .learndash-wrapper .ld-status.ld-status-progress {
        font-size: 11px;
        padding: 4px 10px;
    }
}

/* ==========================================================================
   7. ACCESSIBILITY IMPROVEMENTS
   ========================================================================== */

/* Focus states for keyboard navigation */
.learndash-wrapper .ld-button:focus,
.learndash-wrapper .ld-tab:focus,
.learndash-wrapper .ld-item-name:focus {
    outline: 2px solid #0891b2;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .learndash-wrapper .ld-button {
        border: 2px solid white !important;
    }
    
    .learndash-wrapper .ld-tab.ld-active {
        border: 2px solid white;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .learndash-wrapper .ld-button,
    .learndash-wrapper .ld-tab,
    .learndash-wrapper .ld-item-list-item,
    .learndash-wrapper .ld-icon {
        transition: none !important;
    }
}

/* ============================================
   VIMEO PLAYER CONTROLS FIX
   ============================================ */
.ld-video {
    position: relative;
    width: 100%;
    margin: 0 0 30px 0 !important; /* Add margin to prevent overlap with next elements */
    padding: 0;
    overflow: visible !important; /* Ensure controls aren't clipped */
    z-index: 20 !important;
}

.ld-video .fluid-width-video-wrapper {
    width: 100% !important;
    position: relative;
    padding-top: 56.25%; /* 16:9 aspect ratio fallback */
    aspect-ratio: 16 / 9; /* Modern aspect ratio */
    overflow: visible !important; /* CRITICAL: Allow controls to overflow if needed */
    z-index: 20 !important;
}

.ld-video .fluid-width-video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    border-radius: var(--pcld-radius-md) var(--pcld-radius-md) 0 0;
    z-index: 100 !important; /* Ensure iframe is above any wrappers */
}

/* Ensure Vimeo player wrapper doesn't block interactions */
.ld-video .vp-video-wrapper,
.vp-video-wrapper {
    pointer-events: auto !important;
    overflow: visible !important;
}

/* Make sure iframe and its content are fully interactive */
.ld-video iframe,
.ld-video .fluid-width-video-wrapper iframe {
    pointer-events: auto !important;
}
