/**
 * 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 (Priority 1 - Biggest Impact)
   ========================================================================== */

/* Button container */
.learndash-wrapper .ld-content-actions {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin: 32px 0;
    align-items: center;
}

/* Individual button wrappers */
.learndash-wrapper .ld-content-action {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 8px;
    min-height: 100%;
}

.learndash-wrapper .ld-content-action > a.ld-button,
.learndash-wrapper .ld-content-action > form.sfwd-mark-complete,
.learndash-wrapper .ld-content-action > a.ld-course-step-back {
    width: 100%;
}

/* ==========================================================================
   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 */
.learndash-wrapper .ld-button {
    background: var(--pcld-gradient-primary) !important;
    border: none !important;
    color: #ffffff !important;
    border-radius: var(--pcld-radius-sm);
    padding: 12px 20px !important;
    font-weight: 600;
    letter-spacing: 0.3px;
    line-height: 1.4;
    box-shadow: var(--pcld-shadow-soft);
    transition: var(--pcld-transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-transform: none;
    height: 46px;
    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: 768px) {
    /* Stack navigation buttons vertically on small screens */
    .learndash-wrapper .ld-content-actions {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .learndash-wrapper .ld-content-action {
        width: 100%;
    }

    .learndash-wrapper .ld-button,
    .learndash-wrapper .ld-course-step-back,
    .learndash-wrapper .learndash_mark_complete_button {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    /* Keep button size consistent on mobile */
    .learndash-wrapper .ld-button {
        padding: 10px 20px !important;
        font-size: 14px;
    }
    
    /* Breadcrumbs on tablet */
    .learndash-wrapper .ld-breadcrumbs {
        padding: 12px 16px;
    }
    
    .learndash-wrapper .ld-breadcrumbs-segments {
        font-size: 13px;
    }
    
    /* Adjust typography */
    .learndash-wrapper h1 {
        font-size: 1.75rem;
    }
    
    .learndash-wrapper h2 {
        font-size: 1.5rem;
    }
    
    .learndash-wrapper h3 {
        font-size: 1.25rem;
    }
    
    /* Tab content padding */
    .learndash-wrapper .ld-tabs-content {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    /* Extra small screens - keep compact size */
    .learndash-wrapper .ld-button {
        padding: 10px 18px !important;
        font-size: 14px;
        white-space: normal;
        min-height: 42px;
    }
    
    .learndash-wrapper h1 {
        font-size: 1.5rem;
    }
    
    .learndash-wrapper .ld-tab {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .learndash-wrapper .ld-tab-icon {
        font-size: 13px;
    }
    
    /* Breadcrumbs on mobile */
    .learndash-wrapper .ld-breadcrumbs {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px 14px;
    }
    
    .learndash-wrapper .ld-status.ld-status-progress {
        font-size: 12px;
        padding: 6px 12px;
    }
}

/* ==========================================================================
   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;
    }
}
