/**
 * Modern Enterprise File Uploader & Dropzone Styles
 * Antigravity Unified Ticket & Hospital Management System
 */

/* Dropzone Container */
.modern-dropzone {
    position: relative;
    border: 2px dashed var(--border, #cbd5e1);
    border-radius: 14px;
    background: var(--surface-alt, #f8fafc);
    padding: 10px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    box-sizing: border-box;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 50px;
}

.modern-dropzone:hover {
    border-color: var(--primary, #6366f1);
    background: rgba(99, 102, 241, 0.03);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.06);
}

.modern-dropzone.is-dragover {
    border-color: var(--primary, #6366f1);
    background: rgba(99, 102, 241, 0.07);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.18), 0 8px 24px rgba(99, 102, 241, 0.12);
    transform: translateY(-2px);
}

.modern-dropzone.is-compact {
    padding: 14px 16px;
    border-radius: 10px;
}

/* Icon Squircle */
.modern-dropzone .dropzone-icon-box {
    width: 50px;
    height: 50px;
    margin: 0 auto 12px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(129, 140, 248, 0.22) 100%);
    color: var(--primary, #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.45rem;
    transition: transform 0.25s ease, background 0.25s ease;
}

.modern-dropzone:hover .dropzone-icon-box,
.modern-dropzone.is-dragover .dropzone-icon-box {
    transform: translateY(-3px) scale(1.06);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(129, 140, 248, 0.35) 100%);
}

.modern-dropzone.is-compact .dropzone-icon-box {
    width: 36px;
    height: 36px;
    margin-bottom: 8px;
    font-size: 1.1rem;
    border-radius: 10px;
}

/* Dropzone Text */
.modern-dropzone .dropzone-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text, #1e293b);
    margin-bottom: 4px;
    line-height: 1.4;
}

.modern-dropzone .dropzone-browse-text {
    color: var(--primary, #6366f1);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    font-weight: 600;
    transition: color 0.15s ease;
}

.modern-dropzone .dropzone-browse-text:hover {
    color: var(--primary-hover, #4f46e5);
}

.modern-dropzone .dropzone-subtitle {
    font-size: 0.78rem;
    color: var(--muted, #64748b);
    margin-bottom: 0;
}

.modern-dropzone .dropzone-limits-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(100, 116, 139, 0.08);
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-soft, #475569);
    border: 1px solid rgba(100, 116, 139, 0.12);
}

/* File Preview List */
.dropzone-filelist {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 14px;
}

.dropzone-filelist.is-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 10px;
}

/* File Card */
.dropzone-file-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    background: var(--surface, #ffffff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    transition: all 0.18s ease;
    animation: dropzoneFileCardIn 0.22s ease forwards;
    gap: 12px;
}

.dropzone-file-card:hover {
    border-color: var(--primary-soft, #c7d2fe);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

.dropzone-file-card.has-error {
    border-color: #fca5a5 !important;
    background: #fff5f5 !important;
}

@keyframes dropzoneFileCardIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* File Icon Box */
.dropzone-file-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
    overflow: hidden;
    background: #f1f5f9;
    color: #475569;
}

.dropzone-file-icon img.file-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.dropzone-file-icon.is-pdf {
    background: #fee2e2;
    color: #dc2626;
}

.dropzone-file-icon.is-word {
    background: #dbeafe;
    color: #2563eb;
}

.dropzone-file-icon.is-excel {
    background: #dcfce7;
    color: #16a34a;
}

.dropzone-file-icon.is-image {
    background: #e0e7ff;
    color: #4f46e5;
}

.dropzone-file-icon.is-text {
    background: #f1f5f9;
    color: #475569;
}

.dropzone-file-icon.is-archive {
    background: #fef3c7;
    color: #d97706;
}

/* File Info */
.dropzone-file-info {
    flex: 1;
    min-width: 0;
}

.dropzone-file-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text, #0f172a);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.dropzone-file-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.73rem;
    color: var(--muted, #64748b);
}

.dropzone-file-size {
    font-weight: 500;
}

/* File Actions */
.dropzone-file-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.dropzone-file-remove {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--muted, #94a3b8);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.15s ease;
}

.dropzone-file-remove:hover {
    background: #fee2e2;
    color: #dc2626;
    transform: scale(1.08);
}

/* Global File Summary Bar */
.dropzone-summary-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(99, 102, 241, 0.05);
    border: 1px solid rgba(99, 102, 241, 0.12);
    font-size: 0.78rem;
    margin-top: 10px;
    color: var(--text, #1e293b);
}

.dropzone-clear-all {
    color: #dc2626;
    font-weight: 600;
    cursor: pointer;
    border: none;
    background: transparent;
    font-size: 0.74rem;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.dropzone-clear-all:hover {
    color: #b91c1c;
}

/* Compact Tray (for Reply Composer & Modals) */
.compact-file-tray {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.compact-file-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--surface, #ffffff);
    border: 1px solid var(--border, #cbd5e1);
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text, #1e293b);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    animation: dropzoneFileCardIn 0.2s ease forwards;
}

.compact-file-chip .chip-remove-btn {
    border: none;
    background: transparent;
    padding: 0;
    margin-left: 2px;
    color: var(--muted, #94a3b8);
    cursor: pointer;
    font-size: 0.78rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    transition: all 0.12s ease;
}

.compact-file-chip .chip-remove-btn:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Dark Mode Overrides */
[data-theme="dark"] .modern-dropzone,
.dark .modern-dropzone {
    background: var(--surface-alt, #0f172a);
    border-color: var(--border, #334155);
}

[data-theme="dark"] .modern-dropzone:hover,
.dark .modern-dropzone:hover {
    background: rgba(99, 102, 241, 0.08);
    border-color: var(--primary, #818cf8);
}

[data-theme="dark"] .modern-dropzone.is-dragover,
.dark .modern-dropzone.is-dragover {
    background: rgba(99, 102, 241, 0.12);
    border-color: var(--primary, #818cf8);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.25);
}

[data-theme="dark"] .dropzone-file-card,
.dark .dropzone-file-card {
    background: var(--surface, #1e293b);
    border-color: var(--border, #334155);
}

[data-theme="dark"] .dropzone-file-card.has-error,
.dark .dropzone-file-card.has-error {
    background: rgba(220, 38, 38, 0.15) !important;
    border-color: #ef4444 !important;
}

[data-theme="dark"] .compact-file-chip,
.dark .compact-file-chip {
    background: var(--surface, #1e293b);
    border-color: var(--border, #334155);
    color: var(--text, #f1f5f9);
}

[data-theme="dark"] .dropzone-summary-bar,
.dark .dropzone-summary-bar {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.25);
}