/**
 * ThunderLD Frontend Styles
 * 
 * CRITICAL: This file includes fixes for LearnDash button clickability
 * The SCORM container must NOT overlap or extend beyond its visible bounds
 *
 * @package ThunderLD
 * @since 1.0.0
 */

/* ========================================
   SCORM Container - ISOLATED STACKING CONTEXT
   Must not extend beyond its content or block sibling elements
   ======================================== */
.thunderld-container {
    position: relative;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin: 20px 0 40px 0; /* Added bottom margin to separate from buttons */
    
    /* LOW z-index - must be BELOW LearnDash elements */
    z-index: 1 !important;
    
    /* Create isolated stacking context */
    isolation: isolate;
    
    /* CRITICAL: Prevent content from extending beyond container */
    contain: layout paint;
    overflow: visible;
    
    /* Ensure proper display */
    display: block;
    clear: both;
}

/* Clearfix to prevent float issues */
.thunderld-container::after {
    content: "";
    display: table;
    clear: both;
}

/* Header */
.thunderld-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    background: #f7f7f7;
    border-bottom: 1px solid #ddd;
    flex-wrap: wrap;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.thunderld-title {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.thunderld-status-bar {
    display: flex;
    align-items: center;
    gap: 15px;
}

.thunderld-completion-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
    pointer-events: none; /* Status badge is not interactive */
}

.thunderld-completion-status[data-status="completed"],
.thunderld-completion-status[data-status="passed"] {
    background: #d4edda;
    color: #155724;
}

.thunderld-completion-status[data-status="incomplete"],
.thunderld-completion-status[data-status="in-progress"] {
    background: #fff3cd;
    color: #856404;
}

.thunderld-completion-status[data-status="not-started"],
.thunderld-completion-status[data-status="unknown"],
.thunderld-completion-status[data-status="not attempted"] {
    background: #e2e3e5;
    color: #383d41;
}

.thunderld-completion-status[data-status="failed"] {
    background: #f8d7da;
    color: #721c24;
}

.thunderld-score {
    font-size: 13px;
    color: #666;
    pointer-events: none; /* Score is not interactive */
}

.thunderld-controls {
    display: flex;
    gap: 5px;
}

/* ========================================
   Pause Button
   ======================================== */
.thunderld-btn-pause {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    padding: 0;
    background: #2196F3;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.thunderld-btn-pause:hover {
    background: #1976D2;
}

.thunderld-btn-pause .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    line-height: 20px;
}

/* Pause button active state (when paused) */
.thunderld-btn-pause.is-paused {
    background: #4CAF50;
}

.thunderld-btn-pause.is-paused:hover {
    background: #388E3C;
}

/* Pause fallback icon - hidden by default */
.thunderld-pause-fallback {
    display: none;
    font-size: 16px;
    font-family: Arial, sans-serif;
    line-height: 1;
}

/* Show fallback when dashicons fail */
.thunderld-btn-pause .dashicons.dashicons-controls-pause,
.thunderld-btn-pause .dashicons.dashicons-controls-play {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}

/* ========================================
   Pause Overlay
   ======================================== */
.thunderld-pause-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 100;
    cursor: pointer;
}

.thunderld-pause-overlay.is-visible {
    display: flex;
}

.thunderld-pause-overlay-icon {
    font-size: 64px;
    color: #fff;
    margin-bottom: 20px;
    animation: thunderld-pulse-icon 2s ease-in-out infinite;
}

@keyframes thunderld-pulse-icon {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

.thunderld-pause-overlay-text {
    font-size: 28px;
    color: #fff;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.thunderld-pause-overlay-hint {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 15px;
}

/* Buttons */
.thunderld-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.thunderld-btn-fullscreen {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    padding: 0;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.thunderld-btn-fullscreen:hover {
    background: #135e96;
}

.thunderld-btn-fullscreen .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    line-height: 20px;
}

/* Fallback icon - hidden by default, shown only when dashicons fail */
.thunderld-btn-fallback-icon {
    display: none;
    font-size: 18px;
    font-family: Arial, sans-serif;
    line-height: 1;
    color: #fff;
}

/* Show fallback when dashicons aren't loaded (detected by font check) */
.thunderld-btn-fullscreen .dashicons.dashicons-fullscreen-alt {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}

/* Hide fallback by default */
.thunderld-btn-fullscreen .thunderld-btn-fallback-icon {
    display: none !important;
}

.thunderld-btn-launch {
    background: #2271b1;
    color: #fff;
}

.thunderld-btn-launch:hover {
    background: #135e96;
    color: #fff;
}

/* ========================================
   Frame Wrapper - STRICTLY CONTAINED
   The iframe must NOT extend outside this container
   ======================================== */
.thunderld-frame-wrapper {
    position: relative;
    background: #000;
    
    /* CRITICAL: Strict containment prevents iframe from affecting layout outside */
    overflow: hidden !important;
    contain: strict;
    
    /* Low z-index within container */
    z-index: 1 !important;
    
    /* Ensure proper box model */
    box-sizing: border-box;
    display: block;
}

.thunderld-frame {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    
    /* Keep iframe within bounds */
    position: relative;
    z-index: 1 !important;
}

/* ========================================
   CRITICAL: LEARNDASH BUTTON CLICKABILITY FIXES
   These rules ensure LearnDash navigation elements are ALWAYS clickable
   ======================================== */

/* Any element AFTER the SCORM container should be above it */
.thunderld-container ~ * {
    position: relative !important;
    z-index: 100 !important;
}

/* LearnDash Wrapper - ALWAYS above SCORM content */
.learndash-wrapper {
    position: relative !important;
    z-index: 1000 !important;
    pointer-events: auto !important;
}

/* Content actions container - very high z-index */
.ld-content-actions,
.learndash-wrapper .ld-content-actions,
.ld-focus-content .ld-content-actions {
    position: relative !important;
    z-index: 9000 !important;
    pointer-events: auto !important;
    display: block !important;
    visibility: visible !important;
}

/* ALL LearnDash interactive elements - highest z-index */
.learndash-wrapper a,
.learndash-wrapper button,
.learndash-wrapper input[type="submit"],
.learndash-wrapper input[type="button"],
.learndash-wrapper .ld-button,
.learndash-wrapper .ld-content-action,
.learndash-wrapper .ld-topic-list-item a,
.learndash-wrapper .ld-lesson-list-item a,
.learndash-wrapper .ld-table-list-item a,
.ld-content-action,
.ld-content-action a,
.ld-content-actions a,
.ld-content-actions button,
a[href*="back-to-course"],
a[href*="sfwd-course"],
a[href*="/course/"],
.ld-button,
.ld-button-mark-complete,
#learndash_mark_complete_button,
input[name="learndash_mark_complete"],
input[name="sfwd_mark_complete"],
#sfwd-mark-complete,
.learndash_mark_complete_button,
.ld-complete-button,
.ld-focus-header a,
.ld-focus-sidebar-trigger,
.ld-breadcrumbs a,
.ld-focus-content .ld-content-action,
.ld-focus-content .ld-content-action a,
.ld-focus-mode-wrapper a,
.ld-focus-mode-wrapper button,
[class*="learndash"] a,
[class*="learndash"] button,
[class*="ld-"] a,
[class*="ld-"] button {
    position: relative !important;
    z-index: 9999 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* Focus mode specific fixes */
.ld-focus .ld-focus-content {
    position: relative !important;
    z-index: 100 !important;
}

.ld-focus-content .learndash-wrapper {
    position: relative !important;
    z-index: 1000 !important;
}

.ld-focus-header {
    position: relative !important;
    z-index: 2000 !important;
    pointer-events: auto !important;
}

.ld-focus-header * {
    pointer-events: auto !important;
}

/* Mark Complete button - specific high-priority styles */
.ld-button.ld-button-mark-complete,
#learndash_mark_complete_button,
.learndash_mark_complete_button,
input[name="sfwd_mark_complete"],
input[name="learndash_mark_complete"] {
    position: relative !important;
    z-index: 9999 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* Auto-completed button styling */
.thunderld-auto-completed {
    background-color: #28a745 !important;
    border-color: #28a745 !important;
}

/* ========================================
   SCORM COMPLETION RESTRICTION STYLES
   Styles for disabled/enabled Mark Complete button
   ======================================== */

/* Restricted/Disabled Mark Complete button */
.thunderld-restricted,
.learndash_mark_complete_button.thunderld-restricted,
input[name="sfwd_mark_complete"].thunderld-restricted,
input[name="learndash_mark_complete"].thunderld-restricted,
.ld-button.thunderld-restricted {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: #fff !important;
    opacity: 0.7 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    position: relative !important;
}

.thunderld-restricted:hover {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
}

/* Lock icon styling */
.thunderld-lock-icon {
    margin-right: 5px;
    font-size: 14px;
}

/* SCORM completed - button enabled */
.thunderld-scorm-completed,
.learndash_mark_complete_button.thunderld-scorm-completed,
input[name="sfwd_mark_complete"].thunderld-scorm-completed,
input[name="learndash_mark_complete"].thunderld-scorm-completed,
.ld-button.thunderld-scorm-completed {
    background-color: #28a745 !important;
    border-color: #28a745 !important;
    color: #fff !important;
    opacity: 1 !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    transition: all 0.3s ease !important;
}

.thunderld-scorm-completed:hover {
    background-color: #218838 !important;
    border-color: #1e7e34 !important;
}

/* Check icon styling */
.thunderld-check-icon {
    margin-right: 5px;
    font-size: 14px;
    color: #fff;
}

/* Animation when button becomes enabled */
.thunderld-enabled-animation {
    animation: thunderld-pulse 1.5s ease-in-out infinite !important;
}

@keyframes thunderld-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}

/* Tooltip for restricted button */
.thunderld-restricted::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    pointer-events: none;
}

.thunderld-restricted:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Back to Course link specific */
a[href*="back-to-course"],
.ld-focus-header .ld-content-action a,
.learndash-wrapper a[href*="sfwd-course"] {
    position: relative !important;
    z-index: 9999 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
    display: inline-block !important;
}

/* ========================================
   Button Mode / Launch Card
   ======================================== */
.thunderld-button-mode {
    background: none;
    border: none;
}

.thunderld-launch-card {
    background: #f7f7f7;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 25px;
    text-align: center;
}

.thunderld-module-title {
    margin: 0 0 15px;
    font-size: 18px;
    color: #333;
}

.thunderld-launch-card .thunderld-status-bar {
    justify-content: center;
    margin-bottom: 20px;
}

.thunderld-launch-card .thunderld-btn-launch {
    font-size: 16px;
    padding: 12px 30px;
}

/* ========================================
   Lightbox
   ======================================== */
.thunderld-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.thunderld-lightbox {
    position: relative;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
}

.thunderld-lightbox-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    background: #333;
    color: #fff;
}

.thunderld-lightbox-title {
    font-weight: 600;
    font-size: 14px;
}

.thunderld-lightbox-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.thunderld-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.thunderld-lightbox-content {
    flex: 1;
    overflow: hidden;
}

.thunderld-lightbox-content iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* ========================================
   Fullscreen - Proper Fullscreen API styles
   CRITICAL: Must override containment and position for true fullscreen
   
   NOTE: Selectors must be SEPARATE rules, not combined with commas.
   When browsers encounter an invalid selector in a comma-separated list,
   they discard the ENTIRE rule. Modern browsers no longer support
   :-moz-full-screen and :-ms-fullscreen, so combining them with
   :fullscreen causes the valid selector to be ignored.
   ======================================== */

/* Standard fullscreen (Chrome, Firefox, Edge) */
.thunderld-container:fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    background: #000 !important;
    border-radius: 0 !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
    contain: none !important;
    isolation: auto !important;
    overflow: hidden !important;
    z-index: 2147483647 !important;
}

/* Webkit fullscreen (Safari, older Chrome) */
.thunderld-container:-webkit-full-screen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    background: #000 !important;
    border-radius: 0 !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
    contain: none !important;
    isolation: auto !important;
    overflow: hidden !important;
    z-index: 2147483647 !important;
}

/* Header in fullscreen - Standard */
.thunderld-container:fullscreen .thunderld-header {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    background: rgba(26, 26, 26, 0.95) !important;
    border-bottom: 1px solid #333 !important;
    z-index: 2147483647 !important;
    box-sizing: border-box !important;
}

/* Header in fullscreen - Webkit */
.thunderld-container:-webkit-full-screen .thunderld-header {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    background: rgba(26, 26, 26, 0.95) !important;
    border-bottom: 1px solid #333 !important;
    z-index: 2147483647 !important;
    box-sizing: border-box !important;
}

/* Title in fullscreen - Standard */
.thunderld-container:fullscreen .thunderld-title {
    color: #fff !important;
}

/* Title in fullscreen - Webkit */
.thunderld-container:-webkit-full-screen .thunderld-title {
    color: #fff !important;
}

/* Completion status in fullscreen - Standard */
.thunderld-container:fullscreen .thunderld-completion-status {
    background: rgba(255, 243, 205, 0.9) !important;
}

/* Completion status in fullscreen - Webkit */
.thunderld-container:-webkit-full-screen .thunderld-completion-status {
    background: rgba(255, 243, 205, 0.9) !important;
}

/* Frame wrapper in fullscreen - Standard */
.thunderld-container:fullscreen .thunderld-frame-wrapper {
    position: absolute !important;
    top: 56px !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: calc(100vh - 56px) !important;
    max-width: 100vw !important;
    max-height: calc(100vh - 56px) !important;
    contain: none !important;
    overflow: hidden !important;
}

/* Frame wrapper in fullscreen - Webkit */
.thunderld-container:-webkit-full-screen .thunderld-frame-wrapper {
    position: absolute !important;
    top: 56px !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: calc(100vh - 56px) !important;
    max-width: 100vw !important;
    max-height: calc(100vh - 56px) !important;
    contain: none !important;
    overflow: hidden !important;
}

/* Iframe in fullscreen - Standard */
.thunderld-container:fullscreen .thunderld-frame {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
}

/* Iframe in fullscreen - Webkit */
.thunderld-container:-webkit-full-screen .thunderld-frame {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
}

/* Fullscreen button in fullscreen - Standard */
.thunderld-container:fullscreen .thunderld-btn-fullscreen {
    background: #444 !important;
    color: #fff !important;
}

/* Fullscreen button in fullscreen - Webkit */
.thunderld-container:-webkit-full-screen .thunderld-btn-fullscreen {
    background: #444 !important;
    color: #fff !important;
}

/* Fullscreen button hover in fullscreen - Standard */
.thunderld-container:fullscreen .thunderld-btn-fullscreen:hover {
    background: #555 !important;
}

/* Fullscreen button hover in fullscreen - Webkit */
.thunderld-container:-webkit-full-screen .thunderld-btn-fullscreen:hover {
    background: #555 !important;
}

/* Pause button in fullscreen - Standard */
.thunderld-container:fullscreen .thunderld-btn-pause {
    background: #2196F3 !important;
}

/* Pause button in fullscreen - Webkit */
.thunderld-container:-webkit-full-screen .thunderld-btn-pause {
    background: #2196F3 !important;
}

/* Pause button hover in fullscreen - Standard */
.thunderld-container:fullscreen .thunderld-btn-pause:hover {
    background: #1976D2 !important;
}

/* Pause button hover in fullscreen - Webkit */
.thunderld-container:-webkit-full-screen .thunderld-btn-pause:hover {
    background: #1976D2 !important;
}

/* Pause button paused state in fullscreen - Standard */
.thunderld-container:fullscreen .thunderld-btn-pause.is-paused {
    background: #4CAF50 !important;
}

/* Pause button paused state in fullscreen - Webkit */
.thunderld-container:-webkit-full-screen .thunderld-btn-pause.is-paused {
    background: #4CAF50 !important;
}

/* Pause overlay in fullscreen - Standard */
.thunderld-container:fullscreen .thunderld-pause-overlay {
    z-index: 2147483646 !important;
}

/* Pause overlay in fullscreen - Webkit */
.thunderld-container:-webkit-full-screen .thunderld-pause-overlay {
    z-index: 2147483646 !important;
}

/* Class added by JS when in fullscreen (for additional styling hooks) */
.thunderld-container.thunderld-in-fullscreen {
    /* Additional styles if needed */
}

/* Hide body overflow when in fullscreen - Standard */
body:has(.thunderld-container:fullscreen) {
    overflow: hidden !important;
}

/* Hide body overflow - JS fallback class (works in all browsers) */
body.thunderld-fullscreen-active {
    overflow: hidden !important;
}

/* CSS fallback fullscreen (for browsers that don't support Fullscreen API) */
.thunderld-container.thunderld-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 2147483647 !important;
    border-radius: 0 !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #000 !important;
    contain: none !important;
    isolation: auto !important;
    overflow: hidden !important;
}

.thunderld-container.thunderld-fullscreen .thunderld-header {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    background: rgba(26, 26, 26, 0.95) !important;
    border-bottom: 1px solid #333 !important;
    z-index: 2147483647 !important;
}

.thunderld-container.thunderld-fullscreen .thunderld-title {
    color: #fff !important;
}

.thunderld-container.thunderld-fullscreen .thunderld-frame-wrapper {
    position: absolute !important;
    top: 56px !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: calc(100vh - 56px) !important;
    contain: none !important;
}

.thunderld-container.thunderld-fullscreen .thunderld-frame {
    width: 100% !important;
    height: 100% !important;
}

.thunderld-container.thunderld-fullscreen .thunderld-btn-fullscreen {
    background: #444 !important;
    color: #fff !important;
}

.thunderld-container.thunderld-fullscreen .thunderld-btn-fullscreen:hover {
    background: #555 !important;
}

.thunderld-container.thunderld-fullscreen .thunderld-btn-pause {
    background: #2196F3 !important;
}

.thunderld-container.thunderld-fullscreen .thunderld-btn-pause.is-paused {
    background: #4CAF50 !important;
}

.thunderld-container.thunderld-fullscreen .thunderld-pause-overlay {
    z-index: 2147483646 !important;
}

/* ========================================
   Containment Classes (added by JS)
   ======================================== */
.thunderld-contained {
    position: relative;
    z-index: 1 !important;
    isolation: isolate;
    contain: layout paint;
}

.thunderld-frame-contained {
    position: relative;
    z-index: 1 !important;
    overflow: hidden !important;
    contain: strict;
}

.thunderld-ld-fixed {
    position: relative !important;
    z-index: 1000 !important;
}

/* ========================================
   Error & Loading States
   ======================================== */
.thunderld-error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #f5c6cb;
}

.thunderld-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 50px;
    color: #666;
}

.thunderld-loading::after {
    content: '';
    width: 30px;
    height: 30px;
    border: 3px solid #ddd;
    border-top-color: #2271b1;
    border-radius: 50%;
    animation: thunderld-spin 1s linear infinite;
    margin-left: 10px;
}

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

/* ========================================
   Notifications
   ======================================== */
.thunderld-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 350px;
    padding: 15px 40px 15px 20px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000000;
    animation: thunderld-slide-in 0.3s ease;
}

@keyframes thunderld-slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.thunderld-notification-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.thunderld-notification-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.thunderld-notification-info {
    background: #cce5ff;
    color: #004085;
    border: 1px solid #b8daff;
}

.thunderld-notification-message {
    font-size: 14px;
    line-height: 1.4;
}

.thunderld-notification-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.6;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: inherit;
}

.thunderld-notification-close:hover {
    opacity: 1;
}

/* ========================================
   Responsive
   ======================================== */
@media screen and (max-width: 768px) {
    .thunderld-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .thunderld-controls {
        align-self: flex-end;
    }

    .thunderld-lightbox {
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
    }

    .thunderld-lightbox-content {
        min-height: 60vh;
    }
}

/* ========================================
   DEBUG: Visual indicator for fixed elements
   Uncomment to see which elements are being fixed
   ======================================== */
/*
.thunderld-container {
    outline: 2px dashed red !important;
}

.learndash-wrapper {
    outline: 2px dashed green !important;
}

.ld-content-actions {
    outline: 2px dashed blue !important;
}
*/
