/**
 * AjaxUploader v5.0
 * (c) RichScripts
 */

/* ── CSS Custom Properties ── */
:root {
    --au-primary: #4f46e5;
    --au-primary-hover: #4338ca;
    --au-primary-light: #eef2ff;
    --au-success: #16a34a;
    --au-success-light: #f0fdf4;
    --au-danger: #dc2626;
    --au-danger-light: #fef2f2;
    --au-warning: #d97706;
    --au-gray-50: #f9fafb;
    --au-gray-100: #f3f4f6;
    --au-gray-200: #e5e7eb;
    --au-gray-300: #d1d5db;
    --au-gray-400: #9ca3af;
    --au-gray-500: #6b7280;
    --au-gray-600: #4b5563;
    --au-gray-700: #374151;
    --au-gray-800: #1f2937;
    --au-gray-900: #111827;
    --au-font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --au-font-size: 0.875rem;
    --au-border-radius: 0.5rem;
    --au-border-radius-sm: 0.375rem;
    --au-transition: 150ms ease;
    --au-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --au-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --au-thumb-size: 64px;
    /* Drop-zone glyph. Override with any url()/none to rebrand the empty state. */
    --au-dropzone-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 13v8'/%3E%3Cpath d='m8 17 4-4 4 4'/%3E%3Cpath d='M20 16.7A5 5 0 0 0 18 7h-1.3A8 8 0 1 0 4 14.9'/%3E%3C/svg%3E");
}

/* ── Base ── */
.au-uploader,
.au-dropzone-standalone,
.au-attachments {
    font-family: var(--au-font-family);
    font-size: var(--au-font-size);
    color: var(--au-gray-800);
    line-height: 1.5;
}

/* ── Select Button ── */
.au-button-area,
.au-attachments-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.au-select-btn,
.au-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    background: var(--au-primary);
    color: white;
    border: none;
    border-radius: var(--au-border-radius-sm);
    font-size: var(--au-font-size);
    font-weight: 500;
    cursor: pointer;
    transition: background var(--au-transition), box-shadow var(--au-transition), transform var(--au-transition);
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.au-select-btn:focus-visible,
.au-upload-btn:focus-visible {
    outline: 2px solid var(--au-primary);
    outline-offset: 2px;
}

.au-upload-btn {
    background: var(--au-success);
}

.au-select-btn:hover,
.au-upload-btn:hover {
    background: var(--au-primary-hover);
    box-shadow: var(--au-shadow-md);
    transform: translateY(-1px);
}

.au-upload-btn:hover {
    background: #15803d;
}

.au-select-btn:active,
.au-upload-btn:active {
    transform: translateY(0);
}

/* ── Drop Zone ── */
.au-dropzone,
.au-dropzone-standalone .au-dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    min-height: 176px;
    padding: 2rem;
    margin-top: 1rem;
    border: 2px dashed var(--au-gray-300);
    border-radius: calc(var(--au-border-radius) * 1.5);
    background: radial-gradient(130% 130% at 50% 0%, #fff 0%, var(--au-gray-50) 70%);
    color: var(--au-gray-500);
    text-align: center;
    cursor: pointer;
    transition: border-color var(--au-transition), background var(--au-transition), color var(--au-transition), box-shadow var(--au-transition), transform var(--au-transition);
}

/* Upload glyph for drop zones whose markup carries no .au-dropzone-icon element
   (the Tag Helper renders text only). Drawn as a mask so it inherits the zone's
   colour and tints automatically on hover/drag. Browsers without :has() simply
   skip the rule and get the previous text-only zone. */
.au-dropzone:not(:has(.au-dropzone-icon))::before,
.au-dropzone-standalone .au-dropzone-content:not(:has(.au-dropzone-icon))::before {
    content: "";
    width: 42px;
    height: 42px;
    background-color: currentColor;
    opacity: 0.5;
    -webkit-mask: var(--au-dropzone-glyph) center / contain no-repeat;
            mask: var(--au-dropzone-glyph) center / contain no-repeat;
    transition: opacity var(--au-transition), transform var(--au-transition);
}
.au-dropzone:hover::before,
.au-dropzone-standalone .au-dropzone-content:hover::before {
    opacity: 0.95;
    transform: translateY(-2px);
}

.au-dropzone:hover,
.au-dropzone-standalone .au-dropzone-content:hover {
    border-color: var(--au-primary);
    background: var(--au-primary-light);
    color: var(--au-primary);
    box-shadow: 0 12px 28px -18px var(--au-primary);
    transform: translateY(-1px);
}

.au-drag-over,
.au-drag-over .au-dropzone-content {
    border-color: var(--au-primary) !important;
    background: var(--au-primary-light) !important;
    color: var(--au-primary) !important;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}

.au-dropzone-icon { opacity: 0.6; }
.au-dropzone-text { font-size: 0.9375rem; font-weight: 600; letter-spacing: -0.01em; }

/* ── Inline Image Thumbnails (paste/drop preview) ── */
.au-preview-area {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0;
}

.au-thumb {
    position: relative;
    width: var(--au-thumb-size);
    height: var(--au-thumb-size);
    border-radius: var(--au-border-radius-sm);
    overflow: hidden;
    border: 2px solid var(--au-gray-200);
    background: var(--au-gray-100);
    flex-shrink: 0;
    transition: border-color var(--au-transition), box-shadow var(--au-transition);
    animation: au-thumb-appear 200ms ease;
}

@keyframes au-thumb-appear {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.au-thumb:hover {
    border-color: var(--au-primary);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.15);
}

.au-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.au-thumb-close {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    padding: 0;
    border: none;
    border-radius: 9999px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--au-transition), background var(--au-transition);
    z-index: 2;
}

.au-thumb:hover .au-thumb-close {
    opacity: 1;
}

.au-thumb-close:hover {
    background: var(--au-danger);
}

/* Thumbnail overlay states */
.au-thumb-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.au-thumb-overlay--uploading {
    background: rgba(0, 0, 0, 0.4);
}

.au-thumb-overlay--done {
    background: rgba(22, 163, 74, 0.5);
    animation: au-overlay-flash 600ms ease;
}

.au-thumb-overlay--error {
    background: rgba(220, 38, 38, 0.5);
}

@keyframes au-overlay-flash {
    0% { background: rgba(22, 163, 74, 0.8); }
    100% { background: rgba(22, 163, 74, 0.5); }
}

.au-thumb-progress-ring {
    width: 28px;
    height: 28px;
}

.au-thumb-progress-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.au-thumb-progress-ring circle:last-child {
    transition: stroke-dasharray 200ms ease;
}

/* ── Progress Bar ── */
.au-progress {
    margin-top: 1rem;
    padding: 0.75rem;
    background: var(--au-gray-50);
    border-radius: var(--au-border-radius-sm);
    border: 1px solid var(--au-gray-200);
}

.au-progress-bar {
    height: 0.5rem;
    background: var(--au-gray-200);
    border-radius: 9999px;
    overflow: hidden;
}

.au-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--au-primary), #7c3aed);
    border-radius: 9999px;
    transition: width 200ms ease;
    width: 0;
}

.au-progress-text {
    margin-top: 0.375rem;
    font-size: 0.8125rem;
    color: var(--au-gray-500);
    font-variant-numeric: tabular-nums;
}

/* ── Queue ── */
.au-queue {
    margin-top: 0.75rem;
}

.au-queue-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
    background: white;
    border: 1px solid var(--au-gray-200);
    border-radius: var(--au-border-radius-sm);
    margin-bottom: 0.375rem;
    transition: background var(--au-transition), border-color var(--au-transition);
    animation: au-queue-slide-in 200ms ease;
}

@keyframes au-queue-slide-in {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.au-queue-item:hover {
    background: var(--au-gray-50);
    border-color: var(--au-gray-300);
}

.au-queue-item--completed { border-left: 3px solid var(--au-success); }
.au-queue-item--failed { border-left: 3px solid var(--au-danger); background: var(--au-danger-light); }
.au-queue-item--uploading { border-left: 3px solid var(--au-primary); background: var(--au-primary-light); }
.au-queue-item--cancelled { opacity: 0.5; }

.au-file-icon {
    flex-shrink: 0;
    font-size: 1rem;
}

.au-status-icon {
    flex-shrink: 0;
    width: 1.25rem;
    text-align: center;
    font-weight: bold;
}

.au-status-ok { color: var(--au-success); }
.au-status-error { color: var(--au-danger); }
.au-status-uploading { color: var(--au-primary); animation: au-spin 1s linear infinite; }
.au-status-cancelled { color: var(--au-gray-400); }
.au-status-pending { color: var(--au-gray-400); }

@keyframes au-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.au-queue-name {
    flex: 1;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.au-queue-size {
    flex-shrink: 0;
    color: var(--au-gray-500);
    font-size: 0.8125rem;
}

.au-queue-progress {
    flex: 0 0 100px;
    height: 0.375rem;
    background: rgba(79, 70, 229, 0.2);
    border-radius: 9999px;
    overflow: hidden;
}

.au-queue-progress-fill {
    height: 100%;
    background: var(--au-primary);
    border-radius: 9999px;
    transition: width 200ms ease;
}

.au-queue-percent {
    flex-shrink: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--au-primary);
    min-width: 2.5rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.au-queue-error {
    flex-shrink: 0;
    color: var(--au-danger);
    font-size: 0.8125rem;
}

.au-queue-cancel,
.au-queue-remove {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    border: none;
    border-radius: 9999px;
    background: transparent;
    color: var(--au-gray-400);
    font-size: 1rem;
    cursor: pointer;
    transition: background var(--au-transition), color var(--au-transition);
}

.au-queue-cancel:hover { background: var(--au-danger-light); color: var(--au-danger); }
.au-queue-remove:hover { background: var(--au-gray-100); color: var(--au-gray-600); }

/* ── Attachments ── */
.au-attachments {
    border: 1px solid var(--au-gray-200);
    border-radius: var(--au-border-radius);
    overflow: hidden;
}

.au-attachments-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--au-gray-50);
    border-bottom: 1px solid var(--au-gray-200);
}

.au-attachments-count {
    color: var(--au-gray-500);
    font-size: 0.8125rem;
}

.au-attachments-list { padding: 0; }

.au-attachment-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--au-gray-100);
    transition: background var(--au-transition);
}

.au-attachment-item:last-child { border-bottom: none; }
.au-attachment-item:hover { background: var(--au-gray-50); }

.au-attachment-icon { flex-shrink: 0; font-size: 1rem; }

.au-attachment-thumb {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    object-fit: cover;
    border: 1px solid var(--au-gray-200);
}

.au-attachment-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.au-attachment-size {
    flex-shrink: 0;
    color: var(--au-gray-500);
    font-size: 0.8125rem;
}

.au-attachment-progress {
    flex-shrink: 0;
    color: var(--au-primary);
    font-weight: 600;
    font-size: 0.8125rem;
    font-variant-numeric: tabular-nums;
}

.au-attachment-remove {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    border: none;
    border-radius: 9999px;
    background: transparent;
    color: var(--au-gray-400);
    cursor: pointer;
    transition: background var(--au-transition), color var(--au-transition);
}

.au-attachment-remove:hover {
    background: var(--au-danger-light);
    color: var(--au-danger);
}

/* ── Paused / Processing / Disabled States ── */
.au-queue-item--paused { border-left: 3px solid var(--au-warning); background: rgba(217, 119, 6, 0.05); }
.au-queue-item--processing { border-left: 3px solid var(--au-primary); background: var(--au-primary-light); }
.au-status-paused { color: var(--au-warning); }
.au-status-processing { color: var(--au-primary); animation: au-pulse 1.5s ease infinite; }

@keyframes au-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.au-disabled {
    opacity: 0.5;
    pointer-events: none;
    user-select: none;
}

.au-queue-retry,
.au-queue-pause,
.au-queue-resume {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    border: none;
    border-radius: 9999px;
    background: transparent;
    color: var(--au-gray-400);
    font-size: 1rem;
    cursor: pointer;
    transition: background var(--au-transition), color var(--au-transition);
}

.au-queue-retry:hover { background: var(--au-primary-light); color: var(--au-primary); }
.au-queue-pause:hover { background: rgba(217, 119, 6, 0.1); color: var(--au-warning); }
.au-queue-resume:hover { background: var(--au-success-light); color: var(--au-success); }

/* ── Thumbnail paused overlay ── */
.au-thumb-overlay--paused {
    background: rgba(217, 119, 6, 0.5);
}

/* ── Toast Notifications ── */
.au-toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
    max-width: 360px;
}

.au-toast {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem 1rem;
    border-radius: var(--au-border-radius);
    background: white;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12), 0 4px 10px rgba(0, 0, 0, 0.08);
    font-family: var(--au-font-family);
    font-size: var(--au-font-size);
    color: var(--au-gray-800);
    pointer-events: auto;
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 300ms ease, transform 300ms ease;
    border-left: 4px solid var(--au-gray-300);
}

.au-toast--visible {
    opacity: 1;
    transform: translateX(0);
}

.au-toast--leaving {
    opacity: 0;
    transform: translateX(100%);
}

.au-toast--success { border-left-color: var(--au-success); }
.au-toast--error { border-left-color: var(--au-danger); }
.au-toast--warning { border-left-color: var(--au-warning); }
.au-toast--info { border-left-color: var(--au-primary); }

.au-toast-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

.au-toast--success .au-toast-icon { color: var(--au-success); }
.au-toast--error .au-toast-icon { color: var(--au-danger); }
.au-toast--warning .au-toast-icon { color: var(--au-warning); }
.au-toast--info .au-toast-icon { color: var(--au-primary); }

.au-toast-message {
    flex: 1;
    line-height: 1.4;
}

.au-toast-close {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--au-gray-400);
    font-size: 1rem;
    cursor: pointer;
    border-radius: 9999px;
    transition: background var(--au-transition), color var(--au-transition);
}

.au-toast-close:hover {
    background: var(--au-gray-100);
    color: var(--au-gray-600);
}

/* ── Lightbox ── */
.au-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100001;
    align-items: center;
    justify-content: center;
}

.au-lightbox--visible {
    display: flex;
}

.au-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    animation: au-fade-in 200ms ease;
}

@keyframes au-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.au-lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: au-lightbox-zoom 200ms ease;
}

@keyframes au-lightbox-zoom {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.au-lightbox-img {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: var(--au-border-radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.au-lightbox-caption {
    margin-top: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    font-family: var(--au-font-family);
    font-size: var(--au-font-size);
    text-align: center;
}

.au-lightbox-close {
    position: absolute;
    top: -2rem;
    right: -1rem;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 1.25rem;
    border-radius: 9999px;
    cursor: pointer;
    transition: background var(--au-transition);
}

.au-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ── Confirm Dialog ── */
.au-confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 100002;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    animation: au-fade-in 150ms ease;
}

.au-confirm-dialog {
    background: white;
    border-radius: var(--au-border-radius);
    padding: 1.5rem;
    min-width: 300px;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    font-family: var(--au-font-family);
    animation: au-lightbox-zoom 150ms ease;
}

.au-confirm-message {
    margin: 0 0 1.25rem 0;
    font-size: 0.9375rem;
    color: var(--au-gray-800);
    line-height: 1.5;
}

.au-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.au-confirm-btn {
    padding: 0.4rem 1rem;
    border: 1px solid var(--au-gray-300);
    border-radius: var(--au-border-radius-sm);
    font-size: var(--au-font-size);
    font-weight: 500;
    cursor: pointer;
    transition: background var(--au-transition), border-color var(--au-transition);
}

.au-confirm-btn--cancel {
    background: white;
    color: var(--au-gray-600);
}

.au-confirm-btn--cancel:hover {
    background: var(--au-gray-50);
    border-color: var(--au-gray-400);
}

.au-confirm-btn--ok {
    background: var(--au-primary);
    color: white;
    border-color: var(--au-primary);
}

.au-confirm-btn--ok:hover {
    background: var(--au-primary-hover);
    border-color: var(--au-primary-hover);
}

/* ── Full Page Drop Overlay ── */
.au-fullpage-drop-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(79, 70, 229, 0.08);
    backdrop-filter: blur(2px);
    align-items: center;
    justify-content: center;
}

.au-fullpage-drop-overlay--visible {
    display: flex;
}

.au-fullpage-drop-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 3rem 4rem;
    background: white;
    border: 3px dashed var(--au-primary);
    border-radius: 1rem;
    color: var(--au-primary);
    font-family: var(--au-font-family);
    font-size: 1.125rem;
    font-weight: 600;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    animation: au-lightbox-zoom 200ms ease;
}

/* ── Attachment uploading state ── */
.au-attachment-item--uploading {
    background: var(--au-primary-light);
}

/* ── Dark Mode ── */
.au-dark,
.au-uploader.au-dark,
.au-dropzone-standalone.au-dark,
.au-attachments.au-dark {
    --au-gray-50: #1a1a2e;
    --au-gray-100: #16213e;
    --au-gray-200: #2a2a4a;
    --au-gray-300: #3a3a5a;
    --au-gray-400: #6a6a8a;
    --au-gray-500: #9a9aba;
    --au-gray-600: #c0c0d0;
    --au-gray-700: #d0d0e0;
    --au-gray-800: #e8e8f0;
    --au-gray-900: #f5f5ff;
    --au-primary-light: rgba(79, 70, 229, 0.15);
    --au-success-light: rgba(22, 163, 74, 0.15);
    --au-danger-light: rgba(220, 38, 38, 0.15);
}

.au-dark .au-queue-item,
.au-dark .au-thumb {
    background: var(--au-gray-100);
}

.au-dark .au-toast {
    background: var(--au-gray-100);
    color: var(--au-gray-800);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.au-dark .au-confirm-dialog {
    background: var(--au-gray-100);
    color: var(--au-gray-800);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.au-dark .au-confirm-btn--cancel {
    background: var(--au-gray-50);
    color: var(--au-gray-600);
    border-color: var(--au-gray-300);
}

.au-dark .au-fullpage-drop-content {
    background: var(--au-gray-100);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

/* ── Responsive ── */
@media (max-width: 480px) {
    .au-queue-progress { display: none; }
    .au-queue-item { flex-wrap: wrap; }
    .au-thumb { --au-thumb-size: 48px; }
}

/* ── Reduced motion (a11y) ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .au-uploader *,
    .au-lightbox,
    .au-confirm-overlay,
    .au-fullpage-drop-overlay {
        animation: none !important;
        transition: none !important;
    }
    .au-thumb-progress-ring circle { transition: none !important; }
}

/* ═══════════════════════════════════════════════════════════════════
   Drop-zone style variants (opt-in)
   ───────────────────────────────────────────────────────────────────
   Add one of these next to the drop zone to change its look without
   forking the stylesheet:

     <upload-dropzone class="au-dropzone--tile">
     AjaxUploader.create('#x', { dropZoneMode: true })  ->  add the class
                                                          to the container

   Each variant is written twice: once for the inline zone the
   <core-upload> helper renders (.au-dropzone) and once for the
   standalone zone (.au-dropzone-standalone > .au-dropzone-content).
   They inherit the same --au-* tokens, so theming still applies.
   ═══════════════════════════════════════════════════════════════════ */

/* tile - solid card, no dash. Reads as a surface rather than a target. */
.au-dropzone--tile.au-dropzone,
.au-dropzone--tile .au-dropzone-content {
    border: 1px solid var(--au-gray-200);
    border-radius: calc(var(--au-border-radius) * 1.75);
    background: #fff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 12px 24px -18px rgba(16, 24, 40, 0.45);
}
.au-dropzone--tile.au-dropzone:hover,
.au-dropzone--tile .au-dropzone-content:hover {
    border-color: var(--au-primary);
    background: #fff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 18px 32px -18px var(--au-primary);
}

/* ring - solid tinted ring on a soft fill. Friendly, high-affordance. */
.au-dropzone--ring.au-dropzone,
.au-dropzone--ring .au-dropzone-content {
    border: 2px solid var(--au-primary-light);
    border-radius: calc(var(--au-border-radius) * 2.25);
    background: var(--au-primary-light);
    color: var(--au-primary);
}
.au-dropzone--ring.au-dropzone:hover,
.au-dropzone--ring .au-dropzone-content:hover {
    border-color: var(--au-primary);
    background: var(--au-primary-light);
}

/* inset - a recessed well. Suits zones sitting inside a panel. */
.au-dropzone--inset.au-dropzone,
.au-dropzone--inset .au-dropzone-content {
    border: 1px solid var(--au-gray-200);
    border-radius: var(--au-border-radius);
    background: var(--au-gray-100);
    box-shadow: inset 0 2px 6px rgba(16, 24, 40, 0.06);
}
.au-dropzone--inset.au-dropzone:hover,
.au-dropzone--inset .au-dropzone-content:hover {
    background: var(--au-gray-50);
    border-color: var(--au-primary);
    box-shadow: inset 0 2px 6px rgba(16, 24, 40, 0.04);
}

/* minimal - no box at all; a hairline and centred content. */
.au-dropzone--minimal.au-dropzone,
.au-dropzone--minimal .au-dropzone-content {
    border: 0;
    border-top: 1px solid var(--au-gray-200);
    border-bottom: 1px solid var(--au-gray-200);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    min-height: 132px;
}
.au-dropzone--minimal.au-dropzone:hover,
.au-dropzone--minimal .au-dropzone-content:hover {
    background: transparent;
    border-top-color: var(--au-primary);
    border-bottom-color: var(--au-primary);
    box-shadow: none;
    transform: none;
}

/* compact - short and horizontal: glyph beside the label, not above it. */
.au-dropzone--compact.au-dropzone,
.au-dropzone--compact .au-dropzone-content {
    flex-direction: row;
    gap: 0.85rem;
    min-height: 0;
    padding: 1rem 1.25rem;
    border-radius: calc(var(--au-border-radius) * 1.25);
}
.au-dropzone--compact.au-dropzone::before,
.au-dropzone--compact .au-dropzone-content::before {
    width: 26px;
    height: 26px;
}
.au-dropzone--compact .au-dropzone-icon svg {
    width: 26px;
    height: 26px;
}

/* ── More drop-zone variants ─────────────────────────────────────── */

/* gradient - soft brand wash. Good hero/marketing placement. */
.au-dropzone--gradient.au-dropzone,
.au-dropzone--gradient .au-dropzone-content {
    border: 1px solid var(--au-primary-light);
    border-radius: calc(var(--au-border-radius) * 1.75);
    background: linear-gradient(135deg, var(--au-primary-light) 0%, #fff 55%, var(--au-primary-light) 100%);
    color: var(--au-primary);
}
.au-dropzone--gradient.au-dropzone:hover,
.au-dropzone--gradient .au-dropzone-content:hover {
    border-color: var(--au-primary);
    background: linear-gradient(135deg, var(--au-primary-light) 0%, #fff 45%, var(--au-primary-light) 100%);
}

/* banner - wide and short with an accent edge. Sits above a form. */
.au-dropzone--banner.au-dropzone,
.au-dropzone--banner .au-dropzone-content {
    flex-direction: row;
    gap: 0.9rem;
    min-height: 0;
    padding: 0.95rem 1.15rem;
    border: 1px solid var(--au-gray-200);
    border-left: 4px solid var(--au-primary);
    border-radius: var(--au-border-radius-sm);
    background: var(--au-gray-50);
    text-align: left;
}
.au-dropzone--banner.au-dropzone::before,
.au-dropzone--banner .au-dropzone-content::before {
    width: 24px;
    height: 24px;
}

/* bold - deliberately loud dashes for a primary, unmissable target. */
.au-dropzone--bold.au-dropzone,
.au-dropzone--bold .au-dropzone-content {
    border: 3px dashed var(--au-primary);
    border-radius: calc(var(--au-border-radius) * 1.5);
    background: var(--au-primary-light);
    color: var(--au-primary);
    min-height: 200px;
}
.au-dropzone--bold.au-dropzone:hover,
.au-dropzone--bold .au-dropzone-content:hover {
    background: #fff;
}

/* dark - for dark sections; opts out of the light palette entirely. */
.au-dropzone--dark.au-dropzone,
.au-dropzone--dark .au-dropzone-content {
    border: 1px dashed rgba(255, 255, 255, 0.28);
    border-radius: calc(var(--au-border-radius) * 1.5);
    background: #0f172a;
    color: #cbd5e1;
}
.au-dropzone--dark.au-dropzone:hover,
.au-dropzone--dark .au-dropzone-content:hover {
    border-color: #38bdf8;
    background: #111f3a;
    color: #e2e8f0;
    box-shadow: 0 14px 30px -18px #38bdf8;
}

/* ═══════════════════════════════════════════════════════════════════
   Progress-bar style variants (opt-in)
   ───────────────────────────────────────────────────────────────────
   Put one of these on the .au-progress wrapper:
       <div class="au-progress au-progress--thin"> ... </div>
   They restyle .au-progress-bar / .au-progress-fill only, so the
   markup, ARIA attributes and width updates are untouched.
   ═══════════════════════════════════════════════════════════════════ */

/* thin - a hairline. Unobtrusive under a file row. */
.au-progress--thin .au-progress-bar { height: 0.1875rem; }

/* thick - chunky, easy to read across a room. */
.au-progress--thick .au-progress-bar { height: 0.875rem; }

/* flat - one solid colour, square ends, no gradient. */
.au-progress--flat .au-progress-bar,
.au-progress--flat .au-progress-fill { border-radius: 2px; }
.au-progress--flat .au-progress-fill { background: var(--au-primary); }

/* striped - classic moving barber pole while a transfer is live. */
.au-progress--striped .au-progress-fill {
    /* The base rule paints the fill with the `background` SHORTHAND, so setting
       background-image alone would replace the gradient and leave translucent
       stripes over nothing - the bar rendered empty. Repaint a solid brand base
       underneath, then lay the stripes on top. */
    background-color: var(--au-primary);
    background-image: linear-gradient(45deg,
        rgba(255, 255, 255, 0.22) 25%, transparent 25%,
        transparent 50%, rgba(255, 255, 255, 0.22) 50%,
        rgba(255, 255, 255, 0.22) 75%, transparent 75%, transparent);
    background-size: 1rem 1rem;
    animation: au-progress-stripes 1s linear infinite;
}
@keyframes au-progress-stripes { from { background-position: 1rem 0; } to { background-position: 0 0; } }

/* segmented - ticked into blocks; reads as discrete chunks. */
.au-progress--segmented .au-progress-bar { border-radius: 3px; }
.au-progress--segmented .au-progress-fill {
    border-radius: 3px;
    -webkit-mask: repeating-linear-gradient(90deg, #000 0 10px, transparent 10px 14px);
            mask: repeating-linear-gradient(90deg, #000 0 10px, transparent 10px 14px);
}

/* glow - soft halo in the brand colour. Suits dark surfaces. */
.au-progress--glow .au-progress-fill {
    box-shadow: 0 0 10px var(--au-primary), 0 0 2px var(--au-primary);
}

/* Respect a reduced-motion preference: stop the stripe animation. */
@media (prefers-reduced-motion: reduce) {
    .au-progress--striped .au-progress-fill { animation: none; }
}
