/* ============================================
   RSL Loader Component
   Version: 2.0.0
   Description: Premium loading indicators with
   multiple variants, sizes, colors, and modes.
   Full ADA compliance with reduced motion support.
   ============================================ */

/* ──────────────────────────────────────────────
   CSS Custom Properties
   ────────────────────────────────────────────── */

:root {
    /* Loader Colors */
    --rsl-loader-primary: #667eea;
    --rsl-loader-success: #28a745;
    --rsl-loader-warning: #ffc107;
    --rsl-loader-danger: #dc3545;
    --rsl-loader-info: #17a2b8;
    --rsl-loader-light: #f8f9fa;
    --rsl-loader-dark: #343a40;

    /* Loader Sizing */
    --rsl-loader-size-sm: 24px;
    --rsl-loader-size-md: 40px;
    --rsl-loader-size-lg: 60px;
    --rsl-loader-size-xl: 80px;

    /* Loader Timing */
    --rsl-loader-speed: 1s;
    --rsl-loader-speed-slow: 1.5s;
    --rsl-loader-speed-fast: 0.6s;

    /* Backdrop */
    --rsl-loader-backdrop: rgba(0, 0, 0, 0.5);
    --rsl-loader-backdrop-blur: 2px;

    /* Border widths proportional to size */
    --rsl-loader-border-sm: 3px;
    --rsl-loader-border-md: 4px;
    --rsl-loader-border-lg: 5px;
    --rsl-loader-border-xl: 6px;
}

/* ──────────────────────────────────────────────
   Base Loader Container
   ────────────────────────────────────────────── */

.rsl-loader {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

/* Hidden state */
.rsl-loader[hidden],
.rsl-loader.rsl-loader-hidden {
    display: none !important;
}

/* ──────────────────────────────────────────────
   Loader Modes
   ────────────────────────────────────────────── */

/* Fullscreen Mode (covers entire viewport) */
.rsl-loader-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--rsl-loader-backdrop);
    backdrop-filter: blur(var(--rsl-loader-backdrop-blur));
    -webkit-backdrop-filter: blur(var(--rsl-loader-backdrop-blur));
    z-index: 9999;
}

/* Overlay Mode (covers parent element) */
.rsl-loader-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--rsl-loader-backdrop);
    backdrop-filter: blur(var(--rsl-loader-backdrop-blur));
    -webkit-backdrop-filter: blur(var(--rsl-loader-backdrop-blur));
    z-index: 100;
}

/* Parent needs relative positioning for overlay */
[data-rsl-loader-container] {
    position: relative;
}

/* Inline Mode (flows with content) */
.rsl-loader-inline {
    display: inline-flex;
    vertical-align: middle;
}

/* Button Mode (inside buttons) */
.rsl-loader-button {
    display: inline-flex;
    margin-right: 0.5rem;
}

/* Center Mode (centered in parent without overlay) */
.rsl-loader-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
}

/* ──────────────────────────────────────────────
   Spinner Animation Elements
   ────────────────────────────────────────────── */

/* Base Spinner (Ring) */
.rsl-loader-spinner {
    width: var(--rsl-loader-size-md);
    height: var(--rsl-loader-size-md);
    border: var(--rsl-loader-border-md) solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--rsl-loader-primary);
    border-radius: 50%;
    animation: rsl-spin var(--rsl-loader-speed) linear infinite;
}

/* Dual Ring Spinner */
.rsl-loader-dual {
    width: var(--rsl-loader-size-md);
    height: var(--rsl-loader-size-md);
    border: var(--rsl-loader-border-md) solid transparent;
    border-top-color: var(--rsl-loader-primary);
    border-bottom-color: var(--rsl-loader-primary);
    border-radius: 50%;
    animation: rsl-spin var(--rsl-loader-speed) linear infinite;
}

/* Dots Loader */
.rsl-loader-dots {
    display: flex;
    gap: 0.5rem;
}

.rsl-loader-dots .dot {
    width: calc(var(--rsl-loader-size-md) / 4);
    height: calc(var(--rsl-loader-size-md) / 4);
    background: var(--rsl-loader-primary);
    border-radius: 50%;
    animation: rsl-bounce var(--rsl-loader-speed) ease-in-out infinite;
}

.rsl-loader-dots .dot:nth-child(2) {
    animation-delay: 0.15s;
}

.rsl-loader-dots .dot:nth-child(3) {
    animation-delay: 0.3s;
}

/* Bars Loader (Equalizer style) */
.rsl-loader-bars {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: var(--rsl-loader-size-md);
}

.rsl-loader-bars .bar {
    width: calc(var(--rsl-loader-size-md) / 6);
    background: var(--rsl-loader-primary);
    border-radius: 2px;
    animation: rsl-bars var(--rsl-loader-speed) ease-in-out infinite;
}

.rsl-loader-bars .bar:nth-child(1) { animation-delay: 0s; height: 60%; }
.rsl-loader-bars .bar:nth-child(2) { animation-delay: 0.1s; height: 80%; }
.rsl-loader-bars .bar:nth-child(3) { animation-delay: 0.2s; height: 100%; }
.rsl-loader-bars .bar:nth-child(4) { animation-delay: 0.3s; height: 80%; }
.rsl-loader-bars .bar:nth-child(5) { animation-delay: 0.4s; height: 60%; }

/* Pulse Loader */
.rsl-loader-pulse {
    width: var(--rsl-loader-size-md);
    height: var(--rsl-loader-size-md);
    background: var(--rsl-loader-primary);
    border-radius: 50%;
    animation: rsl-pulse var(--rsl-loader-speed) ease-in-out infinite;
}

/* Ripple Loader */
.rsl-loader-ripple {
    position: relative;
    width: var(--rsl-loader-size-md);
    height: var(--rsl-loader-size-md);
}

.rsl-loader-ripple .ripple {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: var(--rsl-loader-border-md) solid var(--rsl-loader-primary);
    border-radius: 50%;
    animation: rsl-ripple var(--rsl-loader-speed-slow) ease-out infinite;
    opacity: 0;
}

.rsl-loader-ripple .ripple:nth-child(2) {
    animation-delay: 0.5s;
}

/* Square Loader */
.rsl-loader-square {
    width: var(--rsl-loader-size-md);
    height: var(--rsl-loader-size-md);
    background: var(--rsl-loader-primary);
    animation: rsl-square var(--rsl-loader-speed) ease-in-out infinite;
}

/* ──────────────────────────────────────────────
   Progress Indicators
   ────────────────────────────────────────────── */

/* Circular Progress */
.rsl-loader-progress-circle {
    width: var(--rsl-loader-size-md);
    height: var(--rsl-loader-size-md);
    position: relative;
}

.rsl-loader-progress-circle svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.rsl-loader-progress-circle .track {
    fill: none;
    stroke: rgba(255, 255, 255, 0.2);
    stroke-width: 4;
}

.rsl-loader-progress-circle .progress {
    fill: none;
    stroke: var(--rsl-loader-primary);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 126;
    stroke-dashoffset: 126;
    transition: stroke-dashoffset 0.3s ease;
}

.rsl-loader-progress-circle .value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.75rem;
    font-weight: 600;
    color: inherit;
}

/* Linear Progress Bar */
.rsl-loader-progress-bar {
    width: 200px;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
}

.rsl-loader-progress-bar .fill {
    height: 100%;
    background: var(--rsl-loader-primary);
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0%;
}

/* Indeterminate Progress Bar */
.rsl-loader-progress-bar.indeterminate .fill {
    width: 40%;
    animation: rsl-progress-indeterminate 1.5s ease-in-out infinite;
}

/* ──────────────────────────────────────────────
   Size Variants
   ────────────────────────────────────────────── */

/* Small */
.rsl-loader-sm .rsl-loader-spinner,
.rsl-loader-sm .rsl-loader-dual,
.rsl-loader-sm .rsl-loader-pulse,
.rsl-loader-sm .rsl-loader-ripple,
.rsl-loader-sm .rsl-loader-square,
.rsl-loader-sm .rsl-loader-progress-circle {
    width: var(--rsl-loader-size-sm);
    height: var(--rsl-loader-size-sm);
}

.rsl-loader-sm .rsl-loader-spinner,
.rsl-loader-sm .rsl-loader-dual {
    border-width: var(--rsl-loader-border-sm);
}

.rsl-loader-sm .rsl-loader-bars {
    height: var(--rsl-loader-size-sm);
}

.rsl-loader-sm .rsl-loader-dots .dot {
    width: calc(var(--rsl-loader-size-sm) / 4);
    height: calc(var(--rsl-loader-size-sm) / 4);
}

.rsl-loader-sm .rsl-loader-progress-bar {
    width: 120px;
    height: 4px;
}

/* Large */
.rsl-loader-lg .rsl-loader-spinner,
.rsl-loader-lg .rsl-loader-dual,
.rsl-loader-lg .rsl-loader-pulse,
.rsl-loader-lg .rsl-loader-ripple,
.rsl-loader-lg .rsl-loader-square,
.rsl-loader-lg .rsl-loader-progress-circle {
    width: var(--rsl-loader-size-lg);
    height: var(--rsl-loader-size-lg);
}

.rsl-loader-lg .rsl-loader-spinner,
.rsl-loader-lg .rsl-loader-dual {
    border-width: var(--rsl-loader-border-lg);
}

.rsl-loader-lg .rsl-loader-bars {
    height: var(--rsl-loader-size-lg);
}

.rsl-loader-lg .rsl-loader-dots .dot {
    width: calc(var(--rsl-loader-size-lg) / 4);
    height: calc(var(--rsl-loader-size-lg) / 4);
}

.rsl-loader-lg .rsl-loader-progress-bar {
    width: 280px;
    height: 8px;
}

.rsl-loader-lg .rsl-loader-progress-circle .value {
    font-size: 1rem;
}

/* Extra Large */
.rsl-loader-xl .rsl-loader-spinner,
.rsl-loader-xl .rsl-loader-dual,
.rsl-loader-xl .rsl-loader-pulse,
.rsl-loader-xl .rsl-loader-ripple,
.rsl-loader-xl .rsl-loader-square,
.rsl-loader-xl .rsl-loader-progress-circle {
    width: var(--rsl-loader-size-xl);
    height: var(--rsl-loader-size-xl);
}

.rsl-loader-xl .rsl-loader-spinner,
.rsl-loader-xl .rsl-loader-dual {
    border-width: var(--rsl-loader-border-xl);
}

.rsl-loader-xl .rsl-loader-bars {
    height: var(--rsl-loader-size-xl);
}

.rsl-loader-xl .rsl-loader-dots .dot {
    width: calc(var(--rsl-loader-size-xl) / 4);
    height: calc(var(--rsl-loader-size-xl) / 4);
}

.rsl-loader-xl .rsl-loader-progress-bar {
    width: 320px;
    height: 10px;
}

.rsl-loader-xl .rsl-loader-progress-circle .value {
    font-size: 1.25rem;
}

/* ──────────────────────────────────────────────
   Color Variants
   ────────────────────────────────────────────── */

/* Primary (default) */
.rsl-loader-primary .rsl-loader-spinner,
.rsl-loader-primary .rsl-loader-dual { border-top-color: var(--rsl-loader-primary); }
.rsl-loader-primary .rsl-loader-dual { border-bottom-color: var(--rsl-loader-primary); }
.rsl-loader-primary .rsl-loader-dots .dot,
.rsl-loader-primary .rsl-loader-bars .bar,
.rsl-loader-primary .rsl-loader-pulse,
.rsl-loader-primary .rsl-loader-square { background: var(--rsl-loader-primary); }
.rsl-loader-primary .rsl-loader-ripple .ripple { border-color: var(--rsl-loader-primary); }
.rsl-loader-primary .rsl-loader-progress-circle .progress,
.rsl-loader-primary .rsl-loader-progress-bar .fill { stroke: var(--rsl-loader-primary); background: var(--rsl-loader-primary); }

/* Success */
.rsl-loader-success .rsl-loader-spinner,
.rsl-loader-success .rsl-loader-dual { border-top-color: var(--rsl-loader-success); }
.rsl-loader-success .rsl-loader-dual { border-bottom-color: var(--rsl-loader-success); }
.rsl-loader-success .rsl-loader-dots .dot,
.rsl-loader-success .rsl-loader-bars .bar,
.rsl-loader-success .rsl-loader-pulse,
.rsl-loader-success .rsl-loader-square { background: var(--rsl-loader-success); }
.rsl-loader-success .rsl-loader-ripple .ripple { border-color: var(--rsl-loader-success); }
.rsl-loader-success .rsl-loader-progress-circle .progress,
.rsl-loader-success .rsl-loader-progress-bar .fill { stroke: var(--rsl-loader-success); background: var(--rsl-loader-success); }

/* Warning */
.rsl-loader-warning .rsl-loader-spinner,
.rsl-loader-warning .rsl-loader-dual { border-top-color: var(--rsl-loader-warning); }
.rsl-loader-warning .rsl-loader-dual { border-bottom-color: var(--rsl-loader-warning); }
.rsl-loader-warning .rsl-loader-dots .dot,
.rsl-loader-warning .rsl-loader-bars .bar,
.rsl-loader-warning .rsl-loader-pulse,
.rsl-loader-warning .rsl-loader-square { background: var(--rsl-loader-warning); }
.rsl-loader-warning .rsl-loader-ripple .ripple { border-color: var(--rsl-loader-warning); }
.rsl-loader-warning .rsl-loader-progress-circle .progress,
.rsl-loader-warning .rsl-loader-progress-bar .fill { stroke: var(--rsl-loader-warning); background: var(--rsl-loader-warning); }

/* Danger */
.rsl-loader-danger .rsl-loader-spinner,
.rsl-loader-danger .rsl-loader-dual { border-top-color: var(--rsl-loader-danger); }
.rsl-loader-danger .rsl-loader-dual { border-bottom-color: var(--rsl-loader-danger); }
.rsl-loader-danger .rsl-loader-dots .dot,
.rsl-loader-danger .rsl-loader-bars .bar,
.rsl-loader-danger .rsl-loader-pulse,
.rsl-loader-danger .rsl-loader-square { background: var(--rsl-loader-danger); }
.rsl-loader-danger .rsl-loader-ripple .ripple { border-color: var(--rsl-loader-danger); }
.rsl-loader-danger .rsl-loader-progress-circle .progress,
.rsl-loader-danger .rsl-loader-progress-bar .fill { stroke: var(--rsl-loader-danger); background: var(--rsl-loader-danger); }

/* Info */
.rsl-loader-info .rsl-loader-spinner,
.rsl-loader-info .rsl-loader-dual { border-top-color: var(--rsl-loader-info); }
.rsl-loader-info .rsl-loader-dual { border-bottom-color: var(--rsl-loader-info); }
.rsl-loader-info .rsl-loader-dots .dot,
.rsl-loader-info .rsl-loader-bars .bar,
.rsl-loader-info .rsl-loader-pulse,
.rsl-loader-info .rsl-loader-square { background: var(--rsl-loader-info); }
.rsl-loader-info .rsl-loader-ripple .ripple { border-color: var(--rsl-loader-info); }
.rsl-loader-info .rsl-loader-progress-circle .progress,
.rsl-loader-info .rsl-loader-progress-bar .fill { stroke: var(--rsl-loader-info); background: var(--rsl-loader-info); }

/* Light */
.rsl-loader-light .rsl-loader-spinner,
.rsl-loader-light .rsl-loader-dual { border-top-color: var(--rsl-loader-light); }
.rsl-loader-light .rsl-loader-dual { border-bottom-color: var(--rsl-loader-light); }
.rsl-loader-light .rsl-loader-dots .dot,
.rsl-loader-light .rsl-loader-bars .bar,
.rsl-loader-light .rsl-loader-pulse,
.rsl-loader-light .rsl-loader-square { background: var(--rsl-loader-light); }
.rsl-loader-light .rsl-loader-ripple .ripple { border-color: var(--rsl-loader-light); }
.rsl-loader-light .rsl-loader-progress-circle .progress,
.rsl-loader-light .rsl-loader-progress-bar .fill { stroke: var(--rsl-loader-light); background: var(--rsl-loader-light); }

/* Dark */
.rsl-loader-dark .rsl-loader-spinner,
.rsl-loader-dark .rsl-loader-dual { border-top-color: var(--rsl-loader-dark); }
.rsl-loader-dark .rsl-loader-dual { border-bottom-color: var(--rsl-loader-dark); }
.rsl-loader-dark .rsl-loader-dots .dot,
.rsl-loader-dark .rsl-loader-bars .bar,
.rsl-loader-dark .rsl-loader-pulse,
.rsl-loader-dark .rsl-loader-square { background: var(--rsl-loader-dark); }
.rsl-loader-dark .rsl-loader-ripple .ripple { border-color: var(--rsl-loader-dark); }
.rsl-loader-dark .rsl-loader-progress-circle .progress,
.rsl-loader-dark .rsl-loader-progress-bar .fill { stroke: var(--rsl-loader-dark); background: var(--rsl-loader-dark); }

/* ──────────────────────────────────────────────
   Message Text
   ────────────────────────────────────────────── */

.rsl-loader-message {
    font-size: 0.95rem;
    font-weight: 500;
    color: inherit;
    text-align: center;
    max-width: 280px;
}

.rsl-loader-fullscreen .rsl-loader-message,
.rsl-loader-overlay .rsl-loader-message {
    color: #fff;
}

.rsl-loader-sm .rsl-loader-message {
    font-size: 0.8rem;
}

.rsl-loader-lg .rsl-loader-message {
    font-size: 1.1rem;
    max-width: 320px;
}

.rsl-loader-xl .rsl-loader-message {
    font-size: 1.25rem;
    max-width: 400px;
}

/* ──────────────────────────────────────────────
   Success & Error States
   ────────────────────────────────────────────── */

.rsl-loader-success-icon,
.rsl-loader-error-icon {
    width: var(--rsl-loader-size-md);
    height: var(--rsl-loader-size-md);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: rsl-scale-in 0.3s ease;
}

.rsl-loader-success-icon {
    background: var(--rsl-loader-success);
    color: #fff;
}

.rsl-loader-error-icon {
    background: var(--rsl-loader-danger);
    color: #fff;
}

.rsl-loader-success-icon svg,
.rsl-loader-error-icon svg {
    width: 60%;
    height: 60%;
}

.rsl-loader-sm .rsl-loader-success-icon,
.rsl-loader-sm .rsl-loader-error-icon {
    width: var(--rsl-loader-size-sm);
    height: var(--rsl-loader-size-sm);
}

.rsl-loader-lg .rsl-loader-success-icon,
.rsl-loader-lg .rsl-loader-error-icon {
    width: var(--rsl-loader-size-lg);
    height: var(--rsl-loader-size-lg);
}

.rsl-loader-xl .rsl-loader-success-icon,
.rsl-loader-xl .rsl-loader-error-icon {
    width: var(--rsl-loader-size-xl);
    height: var(--rsl-loader-size-xl);
}

/* ──────────────────────────────────────────────
   Dismissible / Cancel Button
   ────────────────────────────────────────────── */

.rsl-loader-dismiss {
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    color: #fff;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rsl-loader-dismiss:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.rsl-loader-dismiss:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* ──────────────────────────────────────────────
   Animations (Keyframes)
   ────────────────────────────────────────────── */

@keyframes rsl-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes rsl-bounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes rsl-bars {
    0%, 100% {
        transform: scaleY(0.4);
        opacity: 0.6;
    }
    50% {
        transform: scaleY(1);
        opacity: 1;
    }
}

@keyframes rsl-pulse {
    0% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    50% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
}

@keyframes rsl-ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

@keyframes rsl-square {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(90deg) scale(0.8); }
    50% { transform: rotate(180deg); }
    75% { transform: rotate(270deg) scale(0.8); }
    100% { transform: rotate(360deg); }
}

@keyframes rsl-progress-indeterminate {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(350%);
    }
}

@keyframes rsl-scale-in {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes rsl-fade-in {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes rsl-fade-out {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

/* ──────────────────────────────────────────────
   Transition States
   ────────────────────────────────────────────── */

.rsl-loader-entering {
    animation: rsl-fade-in 0.2s ease forwards;
}

.rsl-loader-exiting {
    animation: rsl-fade-out 0.2s ease forwards;
}

/* ──────────────────────────────────────────────
   Dark Mode Support
   ────────────────────────────────────────────── */

[data-theme="dark"] .rsl-loader-fullscreen,
[data-theme="dark"] .rsl-loader-overlay {
    background: rgba(0, 0, 0, 0.75);
}

/* Dark mode track colors - use longhand properties to avoid overriding border-top-color */
[data-theme="dark"] .rsl-loader-spinner {
    border-right-color: rgba(255, 255, 255, 0.25);
    border-bottom-color: rgba(255, 255, 255, 0.25);
    border-left-color: rgba(255, 255, 255, 0.25);
}

/* Dual spinner: top and bottom are colored, left and right are track */
[data-theme="dark"] .rsl-loader-dual {
    border-right-color: rgba(255, 255, 255, 0.25);
    border-left-color: rgba(255, 255, 255, 0.25);
}

[data-theme="dark"] .rsl-loader-progress-circle .track,
[data-theme="dark"] .rsl-loader-progress-bar {
    background: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .rsl-loader-progress-circle .track {
    stroke: rgba(255, 255, 255, 0.15);
}

/* ──────────────────────────────────────────────
   Reduced Motion Support
   ────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .rsl-loader-spinner,
    .rsl-loader-dual,
    .rsl-loader-dots .dot,
    .rsl-loader-bars .bar,
    .rsl-loader-pulse,
    .rsl-loader-ripple .ripple,
    .rsl-loader-square,
    .rsl-loader-progress-bar.indeterminate .fill {
        animation: none !important;
    }

    /* Static indicator for reduced motion */
    .rsl-loader-spinner,
    .rsl-loader-dual {
        border-color: transparent;
        border-top-color: var(--rsl-loader-primary);
        border-right-color: var(--rsl-loader-primary);
    }

    .rsl-loader-dots .dot {
        opacity: 0.6;
    }

    .rsl-loader-dots .dot:nth-child(2) {
        opacity: 0.8;
    }

    .rsl-loader-dots .dot:nth-child(3) {
        opacity: 1;
    }

    .rsl-loader-pulse {
        opacity: 0.7;
    }

    .rsl-loader-ripple .ripple {
        opacity: 0.3;
    }

    .rsl-loader-ripple .ripple:nth-child(2) {
        opacity: 0.6;
        transform: scale(0.6);
    }

    .rsl-loader-entering,
    .rsl-loader-exiting {
        animation: none !important;
    }
}

/* ──────────────────────────────────────────────
   High Contrast Mode Support
   ────────────────────────────────────────────── */

@media (forced-colors: active) {
    .rsl-loader-spinner,
    .rsl-loader-dual,
    .rsl-loader-dots .dot,
    .rsl-loader-bars .bar,
    .rsl-loader-pulse,
    .rsl-loader-square {
        forced-color-adjust: none;
        border-color: CanvasText;
        background: CanvasText;
    }

    .rsl-loader-spinner,
    .rsl-loader-dual {
        border-color: transparent;
        border-top-color: Highlight;
    }

    .rsl-loader-ripple .ripple {
        border-color: Highlight;
    }

    .rsl-loader-fullscreen,
    .rsl-loader-overlay {
        background: Canvas;
    }

    .rsl-loader-message {
        color: CanvasText;
    }

    .rsl-loader-dismiss {
        border-color: ButtonBorder;
        background: ButtonFace;
        color: ButtonText;
    }
}

/* ──────────────────────────────────────────────
   Print Styles
   ────────────────────────────────────────────── */

@media print {
    .rsl-loader,
    .rsl-loader-fullscreen,
    .rsl-loader-overlay {
        display: none !important;
    }
}

/* ──────────────────────────────────────────────
   Responsive Adjustments
   ────────────────────────────────────────────── */

@media (max-width: 480px) {
    .rsl-loader-progress-bar {
        width: 160px;
    }

    .rsl-loader-lg .rsl-loader-progress-bar {
        width: 200px;
    }

    .rsl-loader-xl .rsl-loader-progress-bar {
        width: 240px;
    }

    .rsl-loader-message {
        max-width: 200px;
        font-size: 0.875rem;
    }
}
