/**
 * WPDM Modal Dialog System
 * Enterprise-Grade Modal Dialogs for WordPress Download Manager
 * Version: 1.0.0
 */

/* ==========================================================================
   Dialog Wrapper
   ========================================================================== */

.wpdm-dialog-wrapper {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.wpdm-dialog-wrapper.wpdm-dialog-visible {
    opacity: 1;
    visibility: visible;
}

/* ==========================================================================
   Backdrop
   ========================================================================== */

.wpdm-dialog-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* ==========================================================================
   Dialog Container
   ========================================================================== */

.wpdm-dialog {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
    transform: scale(0.95) translateY(-10px);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.3s ease;
    overflow: hidden;
}

.wpdm-dialog-wrapper.wpdm-dialog-visible .wpdm-dialog {
    transform: scale(1) translateY(0);
}

/* Dialog Sizes */
.wpdm-dialog--sm { max-width: 320px; }
.wpdm-dialog--md { max-width: 420px; }
.wpdm-dialog--lg { max-width: 560px; }
.wpdm-dialog--xl { max-width: 720px; }

/* ==========================================================================
   Dialog Header
   ========================================================================== */

.wpdm-dialog__header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-bottom: 1px solid #e2e8f0;
    border-radius: 16px 16px 0 0;
}

.wpdm-dialog__icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.wpdm-dialog__icon svg {
    width: 22px;
    height: 22px;
}

/* Icon Variants */
.wpdm-dialog__icon--info {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #2563eb;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15), 0 0 0 1px rgba(37, 99, 235, 0.1);
}

.wpdm-dialog__icon--success {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    color: #059669;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.15), 0 0 0 1px rgba(5, 150, 105, 0.1);
}

.wpdm-dialog__icon--warning {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    color: #d97706;
    box-shadow: 0 2px 8px rgba(217, 119, 6, 0.15), 0 0 0 1px rgba(217, 119, 6, 0.1);
}

.wpdm-dialog__icon--danger {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: #dc2626;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.15), 0 0 0 1px rgba(220, 38, 38, 0.1);
}

.wpdm-dialog__icon--question {
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    color: #7c3aed;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.15), 0 0 0 1px rgba(124, 58, 237, 0.1);
}

/* Header Content */
.wpdm-dialog__header-content {
    flex: 1;
    min-width: 0;
    padding-right: 1.5rem;
}

.wpdm-dialog__title {
    margin: 0 !important;
    font-size: 1.0625rem !important;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.4;
    letter-spacing: -0.01em;
}

.wpdm-dialog__subtitle {
    margin: 0.25rem 0 0 !important;
    font-size: 0.8125rem;
    color: #64748b;
    line-height: 1.4;
}

/* ==========================================================================
   Close Button
   ========================================================================== */

.wpdm-dialog__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
}

.wpdm-dialog__close:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
    color: #334155;
    transform: scale(1.05);
}

.wpdm-dialog__close:active {
    transform: scale(0.95);
}

.wpdm-dialog__close svg {
    width: 16px;
    height: 16px;
    stroke-width: 2.5;
}

/* ==========================================================================
   Dialog Body
   ========================================================================== */

.wpdm-dialog__body {
    padding: 1rem 1.5rem 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Content fade-in animation when loaded */
.wpdm-dialog__body--loaded {
    animation: wpdm-dialog-content-appear 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes wpdm-dialog-content-appear {
    0% {
        opacity: 0;
        transform: translateY(8px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.wpdm-dialog__message {
    margin: 0;
    font-size: 0.9375rem;
    color: #475569;
    line-height: 1.6;
}

/* ==========================================================================
   Dialog Input (for prompt)
   ========================================================================== */

.wpdm-dialog__input-wrapper {
    margin-top: 1rem;
}

.wpdm-dialog__input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    color: #0f172a;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    outline: none;
    transition: all 0.15s ease;
    box-sizing: border-box;
}

.wpdm-dialog__input:focus {
    background: #ffffff;
    border-color: var(--color-primary, #3b82f6);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.wpdm-dialog__input::placeholder {
    color: #94a3b8;
}

/* ==========================================================================
   Dialog Footer
   ========================================================================== */

.wpdm-dialog__footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem !important;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
}

/* Compact Footer (for alert) */
.wpdm-dialog__footer--compact {
    padding: 0 1.5rem 1.5rem;
    background: transparent;
    border-top: none;
}

/* ==========================================================================
   Dialog Buttons
   ========================================================================== */

.wpdm-dialog__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 100px;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.5;
    text-decoration: none;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.wpdm-dialog__btn:focus {
    outline: none;
}

/* Secondary Button */
.wpdm-dialog__btn--secondary {
    color: #475569;
    background: #ffffff;
    border: 1px solid #e2e8f0;
}

.wpdm-dialog__btn--secondary:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.wpdm-dialog__btn--secondary:focus {
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.2);
}

/* Primary Button */
.wpdm-dialog__btn--primary {
    color: #ffffff;
    background: linear-gradient(135deg, var(--color-primary, #3b82f6) 0%, #2563eb 100%);
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.wpdm-dialog__btn--primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.wpdm-dialog__btn--primary:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

.wpdm-dialog__btn--primary:active {
    transform: translateY(0);
}

/* Success Button */
.wpdm-dialog__btn--success {
    color: #ffffff;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 1px 3px rgba(5, 150, 105, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.wpdm-dialog__btn--success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Danger Button */
.wpdm-dialog__btn--danger {
    color: #ffffff;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 1px 3px rgba(220, 38, 38, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.wpdm-dialog__btn--danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Loading State */
.wpdm-dialog__btn--loading {
    pointer-events: none;
    opacity: 0.7;
}

.wpdm-dialog__btn--loading::before {
    content: "";
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: wpdm-dialog-spin 0.6s linear infinite;
}

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

/* ==========================================================================
   Dark Mode Styles
   ========================================================================== */

.wpdm-dialog-wrapper.dark-mode .wpdm-dialog,
.wpdm-dialog-wrapper.wpdm-dialog--dark .wpdm-dialog {
    background: #1e293b;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.wpdm-dialog-wrapper.dark-mode .wpdm-dialog__header,
.wpdm-dialog-wrapper.wpdm-dialog--dark .wpdm-dialog__header {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border-bottom-color: #334155;
}

.wpdm-dialog-wrapper.dark-mode .wpdm-dialog__title,
.wpdm-dialog-wrapper.wpdm-dialog--dark .wpdm-dialog__title {
    color: #f1f5f9;
}

.wpdm-dialog-wrapper.dark-mode .wpdm-dialog__subtitle,
.wpdm-dialog-wrapper.dark-mode .wpdm-dialog__message,
.wpdm-dialog-wrapper.wpdm-dialog--dark .wpdm-dialog__subtitle,
.wpdm-dialog-wrapper.wpdm-dialog--dark .wpdm-dialog__message {
    color: #94a3b8;
}

.wpdm-dialog-wrapper.dark-mode .wpdm-dialog__close,
.wpdm-dialog-wrapper.wpdm-dialog--dark .wpdm-dialog__close {
    background: #334155;
    border-color: #475569;
    color: #94a3b8;
}

.wpdm-dialog-wrapper.dark-mode .wpdm-dialog__close:hover,
.wpdm-dialog-wrapper.wpdm-dialog--dark .wpdm-dialog__close:hover {
    background: #475569;
    border-color: #64748b;
    color: #e2e8f0;
}

.wpdm-dialog-wrapper.dark-mode .wpdm-dialog__input,
.wpdm-dialog-wrapper.wpdm-dialog--dark .wpdm-dialog__input {
    background: #0f172a;
    border-color: #334155;
    color: #f1f5f9;
}

.wpdm-dialog-wrapper.dark-mode .wpdm-dialog__input:focus,
.wpdm-dialog-wrapper.wpdm-dialog--dark .wpdm-dialog__input:focus {
    background: #0f172a;
    border-color: #3b82f6;
}

.wpdm-dialog-wrapper.dark-mode .wpdm-dialog__input::placeholder,
.wpdm-dialog-wrapper.wpdm-dialog--dark .wpdm-dialog__input::placeholder {
    color: #64748b;
}

.wpdm-dialog-wrapper.dark-mode .wpdm-dialog__footer,
.wpdm-dialog-wrapper.wpdm-dialog--dark .wpdm-dialog__footer {
    background: #0f172a;
    border-top-color: #334155;
}

.wpdm-dialog-wrapper.dark-mode .wpdm-dialog__btn--secondary,
.wpdm-dialog-wrapper.wpdm-dialog--dark .wpdm-dialog__btn--secondary {
    background: #334155;
    border-color: #475569;
    color: #e2e8f0;
}

.wpdm-dialog-wrapper.dark-mode .wpdm-dialog__btn--secondary:hover,
.wpdm-dialog-wrapper.wpdm-dialog--dark .wpdm-dialog__btn--secondary:hover {
    background: #475569;
    border-color: #64748b;
}

/* Dark mode icon variants */
.wpdm-dialog-wrapper.dark-mode .wpdm-dialog__icon--info,
.wpdm-dialog-wrapper.wpdm-dialog--dark .wpdm-dialog__icon--info {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2), 0 0 0 1px rgba(59, 130, 246, 0.15);
}

.wpdm-dialog-wrapper.dark-mode .wpdm-dialog__icon--success,
.wpdm-dialog-wrapper.wpdm-dialog--dark .wpdm-dialog__icon--success {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2), 0 0 0 1px rgba(16, 185, 129, 0.15);
}

.wpdm-dialog-wrapper.dark-mode .wpdm-dialog__icon--warning,
.wpdm-dialog-wrapper.wpdm-dialog--dark .wpdm-dialog__icon--warning {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2), 0 0 0 1px rgba(245, 158, 11, 0.15);
}

.wpdm-dialog-wrapper.dark-mode .wpdm-dialog__icon--danger,
.wpdm-dialog-wrapper.wpdm-dialog--dark .wpdm-dialog__icon--danger {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2), 0 0 0 1px rgba(239, 68, 68, 0.15);
}

.wpdm-dialog-wrapper.dark-mode .wpdm-dialog__icon--question,
.wpdm-dialog-wrapper.wpdm-dialog--dark .wpdm-dialog__icon--question {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.2), 0 0 0 1px rgba(139, 92, 246, 0.15);
}

/* System preference dark mode */
@media (prefers-color-scheme: dark) {
    .wpdm-dialog-wrapper:not(.light-mode) .wpdm-dialog {
        background: #1e293b;
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
    }

    .wpdm-dialog-wrapper:not(.light-mode) .wpdm-dialog__header {
        background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
        border-bottom-color: #334155;
    }

    .wpdm-dialog-wrapper:not(.light-mode) .wpdm-dialog__title {
        color: #f1f5f9;
    }

    .wpdm-dialog-wrapper:not(.light-mode) .wpdm-dialog__subtitle,
    .wpdm-dialog-wrapper:not(.light-mode) .wpdm-dialog__message {
        color: #94a3b8;
    }

    .wpdm-dialog-wrapper:not(.light-mode) .wpdm-dialog__close {
        background: #334155;
        border-color: #475569;
        color: #94a3b8;
    }

    .wpdm-dialog-wrapper:not(.light-mode) .wpdm-dialog__close:hover {
        background: #475569;
        border-color: #64748b;
        color: #e2e8f0;
    }

    .wpdm-dialog-wrapper:not(.light-mode) .wpdm-dialog__input {
        background: #0f172a;
        border-color: #334155;
        color: #f1f5f9;
    }

    .wpdm-dialog-wrapper:not(.light-mode) .wpdm-dialog__input:focus {
        background: #0f172a;
        border-color: #3b82f6;
    }

    .wpdm-dialog-wrapper:not(.light-mode) .wpdm-dialog__input::placeholder {
        color: #64748b;
    }

    .wpdm-dialog-wrapper:not(.light-mode) .wpdm-dialog__footer {
        background: #0f172a;
        border-top-color: #334155;
    }

    .wpdm-dialog-wrapper:not(.light-mode) .wpdm-dialog__btn--secondary {
        background: #334155;
        border-color: #475569;
        color: #e2e8f0;
    }

    .wpdm-dialog-wrapper:not(.light-mode) .wpdm-dialog__btn--secondary:hover {
        background: #475569;
        border-color: #64748b;
    }

    .wpdm-dialog-wrapper:not(.light-mode) .wpdm-dialog__icon--info {
        background: rgba(59, 130, 246, 0.2);
        color: #60a5fa;
        box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2), 0 0 0 1px rgba(59, 130, 246, 0.15);
    }

    .wpdm-dialog-wrapper:not(.light-mode) .wpdm-dialog__icon--success {
        background: rgba(16, 185, 129, 0.2);
        color: #34d399;
        box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2), 0 0 0 1px rgba(16, 185, 129, 0.15);
    }

    .wpdm-dialog-wrapper:not(.light-mode) .wpdm-dialog__icon--warning {
        background: rgba(245, 158, 11, 0.2);
        color: #fbbf24;
        box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2), 0 0 0 1px rgba(245, 158, 11, 0.15);
    }

    .wpdm-dialog-wrapper:not(.light-mode) .wpdm-dialog__icon--danger {
        background: rgba(239, 68, 68, 0.2);
        color: #f87171;
        box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2), 0 0 0 1px rgba(239, 68, 68, 0.15);
    }

    .wpdm-dialog-wrapper:not(.light-mode) .wpdm-dialog__icon--question {
        background: rgba(139, 92, 246, 0.2);
        color: #a78bfa;
        box-shadow: 0 2px 8px rgba(139, 92, 246, 0.2), 0 0 0 1px rgba(139, 92, 246, 0.15);
    }
}

/* ==========================================================================
   AJAX Loading State
   ========================================================================== */

.wpdm-dialog__body--ajax {
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.wpdm-dialog__loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    padding: 2rem;
}

/* Modern dots spinner */
.wpdm-dialog__spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 40px;
}

.wpdm-dialog__spinner::before,
.wpdm-dialog__spinner::after,
.wpdm-dialog__spinner span {
    content: '';
    width: 10px;
    height: 10px;
    background: var(--color-primary, #3b82f6);
    border-radius: 50%;
    animation: wpdm-dialog-bounce 1.4s ease-in-out infinite both;
}

.wpdm-dialog__spinner::before {
    animation-delay: -0.32s;
}

.wpdm-dialog__spinner span {
    animation-delay: -0.16s;
}

@keyframes wpdm-dialog-bounce {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.4;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Loading text with shimmer effect */
.wpdm-dialog__loading-text {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
    position: relative;
    overflow: hidden;
}

.wpdm-dialog__loading-text::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
    animation: wpdm-dialog-shimmer 2s infinite;
}

@keyframes wpdm-dialog-shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Skeleton placeholder for content loading */
.wpdm-dialog__skeleton {
    width: 100%;
    padding: 1.5rem;
}

.wpdm-dialog__skeleton-line {
    height: 12px;
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    border-radius: 6px;
    margin-bottom: 0.75rem;
    animation: wpdm-dialog-skeleton 1.5s ease-in-out infinite;
}

.wpdm-dialog__skeleton-line:last-child {
    margin-bottom: 0;
    width: 60%;
}

.wpdm-dialog__skeleton-line--short {
    width: 40%;
}

.wpdm-dialog__skeleton-line--medium {
    width: 75%;
}

@keyframes wpdm-dialog-skeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ==========================================================================
   AJAX Error State
   ========================================================================== */

.wpdm-dialog__error {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    text-align: center;
}

.wpdm-dialog__error-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-radius: 50%;
    color: #dc2626;
}

.wpdm-dialog__error-icon svg {
    width: 28px;
    height: 28px;
}

.wpdm-dialog__error-message {
    margin: 0;
    font-size: 0.9375rem;
    color: #64748b;
    line-height: 1.5;
}

.wpdm-dialog__retry {
    margin-top: 0.5rem;
}

/* ==========================================================================
   Hidden Footer
   ========================================================================== */

.wpdm-dialog__footer--hidden {
    display: none !important;
}

/* Footer appear animation */
.wpdm-dialog__footer:not(.wpdm-dialog__footer--hidden) {
    animation: wpdm-dialog-footer-appear 0.25s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes wpdm-dialog-footer-appear {
    0% {
        opacity: 0;
        transform: translateY(8px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Dark Mode - AJAX States
   ========================================================================== */

.wpdm-dialog-wrapper.dark-mode .wpdm-dialog__body--ajax,
.wpdm-dialog-wrapper.wpdm-dialog--dark .wpdm-dialog__body--ajax {
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
}

.wpdm-dialog-wrapper.dark-mode .wpdm-dialog__spinner::before,
.wpdm-dialog-wrapper.dark-mode .wpdm-dialog__spinner::after,
.wpdm-dialog-wrapper.dark-mode .wpdm-dialog__spinner span,
.wpdm-dialog-wrapper.wpdm-dialog--dark .wpdm-dialog__spinner::before,
.wpdm-dialog-wrapper.wpdm-dialog--dark .wpdm-dialog__spinner::after,
.wpdm-dialog-wrapper.wpdm-dialog--dark .wpdm-dialog__spinner span {
    background: #60a5fa;
}

.wpdm-dialog-wrapper.dark-mode .wpdm-dialog__loading-text,
.wpdm-dialog-wrapper.wpdm-dialog--dark .wpdm-dialog__loading-text {
    color: #94a3b8;
}

.wpdm-dialog-wrapper.dark-mode .wpdm-dialog__loading-text::after,
.wpdm-dialog-wrapper.wpdm-dialog--dark .wpdm-dialog__loading-text::after {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}

.wpdm-dialog-wrapper.dark-mode .wpdm-dialog__skeleton-line,
.wpdm-dialog-wrapper.wpdm-dialog--dark .wpdm-dialog__skeleton-line {
    background: linear-gradient(90deg, #334155 25%, #475569 50%, #334155 75%);
    background-size: 200% 100%;
}

.wpdm-dialog-wrapper.dark-mode .wpdm-dialog__error-icon,
.wpdm-dialog-wrapper.wpdm-dialog--dark .wpdm-dialog__error-icon {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.wpdm-dialog-wrapper.dark-mode .wpdm-dialog__error-message,
.wpdm-dialog-wrapper.wpdm-dialog--dark .wpdm-dialog__error-message {
    color: #94a3b8;
}

@media (prefers-color-scheme: dark) {
    .wpdm-dialog-wrapper:not(.light-mode) .wpdm-dialog__body--ajax {
        background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    }

    .wpdm-dialog-wrapper:not(.light-mode) .wpdm-dialog__spinner::before,
    .wpdm-dialog-wrapper:not(.light-mode) .wpdm-dialog__spinner::after,
    .wpdm-dialog-wrapper:not(.light-mode) .wpdm-dialog__spinner span {
        background: #60a5fa;
    }

    .wpdm-dialog-wrapper:not(.light-mode) .wpdm-dialog__loading-text {
        color: #94a3b8;
    }

    .wpdm-dialog-wrapper:not(.light-mode) .wpdm-dialog__loading-text::after {
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    }

    .wpdm-dialog-wrapper:not(.light-mode) .wpdm-dialog__skeleton-line {
        background: linear-gradient(90deg, #334155 25%, #475569 50%, #334155 75%);
        background-size: 200% 100%;
    }

    .wpdm-dialog-wrapper:not(.light-mode) .wpdm-dialog__error-icon {
        background: rgba(239, 68, 68, 0.15);
        color: #f87171;
    }

    .wpdm-dialog-wrapper:not(.light-mode) .wpdm-dialog__error-message {
        color: #94a3b8;
    }
}

/* ==========================================================================
   Mobile Responsive
   ========================================================================== */

@media (max-width: 480px) {
    .wpdm-dialog-wrapper {
        padding: 0.5rem;
        align-items: flex-end;
    }

    .wpdm-dialog {
        max-width: 100% !important;
        border-radius: 16px 16px 0 0;
        margin-bottom: 0;
    }

    .wpdm-dialog__footer {
        flex-direction: column;
    }

    .wpdm-dialog__btn {
        width: 100%;
    }
}
