/* Vue File Uploader Custom Styles */
.vue-file-uploader {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ===== CUSTOM BUTTON ENHANCEMENTS ===== */

/* Icon-only buttons */
.btn-icon-only {
    width: 38px;
    height: 38px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon-only.btn-sm {
    width: 31px;
    height: 31px;
}

.btn-icon-only.btn-lg {
    width: 48px;
    height: 48px;
}

/* Action Button Groups */
.action-buttons {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.action-buttons .btn {
    min-width: 38px;
}

.action-buttons .btn-sm {
    min-width: 31px;
}

/* Status Buttons */
.btn-status {
    position: relative;
    overflow: hidden;
}

.btn-status::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-status:hover::before {
    left: 100%;
}

/* Loading State */
.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: btn-loading-spin 1s linear infinite;
}

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

/* ===== END CUSTOM BUTTON ENHANCEMENTS ===== */

/* File Table Styling */
.file-table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Uppy Dashboard Customization */
.uppy-Dashboard-browse {
    color: var(--bs-link-color, #ff6900);
}

.uppy-DashboardContent-addMore {
    color: var(--bs-link-color, #ff6900);
}

.uppy-Dashboard--isDraggingOver {
    border-color: var(--bs-primary);
}

.uppy-StatusBar-progress{
    background-color: var(--bs-primary);
}

.uppy-Dashboard-browse:hover,.uppy-Dashboard-browse:focus  {
    border-bottom: 1px solid var(--bs-link-color, #ff6900);
}

/* Progress Circle */
.progress-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--t-ink-strong, #374151);
    background: #e2e8f0;
    transition: all 0.3s ease;
}

.progress-circle .progress-text {
    font-size: 0.625rem;
    line-height: 1;
}

/* Processed Indicator */
.processed-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

/* Error Indicator */
.error-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.error-indicator small {
    font-size: 0.7rem;
    margin-top: 0.25rem;
    line-height: 1.2;
}

/* Pending Indicator */
.pending-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

/* Vue Select styling */
.vue-select-sm {
    font-size: 0.875rem;
}

.vue-select-sm .vs__dropdown-toggle {
    min-height: 31px;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--t-line, #ced4da);
    border-radius: 0.375rem;
    background-color: var(--t-surface, #fff);
}

.vue-select-sm .vs__selected-options {
    padding: 0;
}

.vue-select-sm .vs__search {
    margin: 0;
    padding: 0;
    font-size: 0.875rem;
    line-height: 1.5;
}

.vue-select-sm .vs__clear {
    margin-right: 0.25rem;
}

.vue-select-sm .vs__open-indicator {
    margin-top: 0.125rem;
}

.vue-select-sm .vs__dropdown-menu {
    font-size: 0.875rem;
}

/* ===== CUSTOM COMPONENT STYLES ===== */

/* Bulk Actions Panel */
.bulk-actions-panel {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* SharePoint Upload Button Styling */
.sharepoint-upload-btn {
    background: linear-gradient(135deg, #0078d4 0%, #106ebe 100%);
    border: none;
    color: white;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 120, 212, 0.2);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
}

.uppy-DashboardContent-back {
    color: var(--bs-link-color, #ff6900);
}

.sharepoint-upload-btn:hover {
    background: linear-gradient(135deg, #106ebe 0%, #005a9e 100%);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 120, 212, 0.3);
    text-decoration: none;
}

.sharepoint-upload-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 120, 212, 0.2);
}

.sharepoint-upload-btn:focus {
    color: white;
    box-shadow: 0 0 0 0.25rem rgba(0, 120, 212, 0.25);
}

.sharepoint-upload-btn i {
    font-size: 1.1em;
}

/* Upload section header styling */
.upload-section-header {
    border-bottom: 2px solid var(--t-line, #e9ecef);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.upload-section-header h4 {
    color: var(--t-ink-strong, #495057);
    font-weight: 600;
}

.upload-section-header h4 i {
    color: var(--bs-primary);
}

/* Utility Classes */
.opacity-50 {
    opacity: 0.5;
}

.pointer-events-none {
    pointer-events: none;
}

/* Responsive design for bulk actions */
@media (max-width: 768px) {
    .bulk-actions-panel .row {
        flex-direction: column;
    }
    
    .bulk-actions-panel .col-md-4 {
        margin-bottom: 1rem;
    }
    
    .bulk-actions-panel .btn-group {
        width: 100%;
    }
    
    .bulk-actions-panel .btn-group .btn {
        flex: 1;
        border-radius: 0.375rem !important;
        margin-bottom: 0.5rem;
    }
    
    .bulk-actions-panel .btn-group .btn:not(:last-child) {
        margin-right: 0.5rem;
    }
}

/* ===== UPLOAD AREA STYLES (Extracted from JS) ===== */

.upload-area {
    border-bottom: 2px dashed var(--bs-primary);
    border-TOP: 2px dashed var(--bs-primary);
    text-align: center;
    background-color: var(--t-surface-2, #f8f9fa);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-area:hover {
    border-color: var(--bs-primary);
    background-color: rgba(var(--bs-primary-rgb), 0.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.upload-area.dragover {
    border-color: var(--bs-primary);
    background-color: rgba(var(--bs-primary-rgb), 0.05);
}

.upload-content {
    pointer-events: none;
}

.upload-icon {
    font-size: 48px;
    color: var(--t-ink-muted, #6c757d);
    margin-bottom: 16px;
}

.upload-area:hover .upload-icon {
    color: var(--bs-primary);
}


.upload-content-interactive {
    padding: 1rem;
    overflow: hidden;
    width: 100%;
    height: 100%;
}

.file-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
    max-height: 280px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.5rem;
}

.file-preview-grid::-webkit-scrollbar {
    width: 6px;
}

.file-preview-grid::-webkit-scrollbar-track {
    background: var(--t-surface-2, #f1f1f1);
    border-radius: 3px;
}

.file-preview-grid::-webkit-scrollbar-thumb {
    background: var(--t-fill, #c1c1c1);
    border-radius: 3px;
}

.file-preview-grid::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.file-preview-item {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    background: white;
    border: 1px solid var(--t-line, #dee2e6);
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    min-height: 80px;
}

.file-preview-item:hover {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.file-preview-item.more-files {
    background: var(--t-surface-2, #f8f9fa);
    border-style: dashed;
}

.file-preview-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e9ecef 0%, #f8f9fa 100%);
    border-radius: 0.375rem;
    margin-right: 0.75rem;
    flex-shrink: 0;
    border: 1px solid var(--t-line, #dee2e6);
}

.file-preview-icon i {
    font-size: 1.1rem;
    color: var(--t-ink-muted, #6c757d);
}

.file-preview-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-weight: 500;
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.25rem;
    color: var(--t-ink-strong, #495057);
}

.file-size {
    font-size: 0.7rem;
    color: var(--t-ink-muted, #6c757d);
    margin-bottom: 0.25rem;
}

.file-progress {
    margin-top: 0.25rem;
}

.file-progress .progress {
    height: 4px;
    margin-bottom: 0.25rem;
}

.file-status {
    font-size: 0.7rem;
    font-weight: 500;
}

.upload-progress-container {
    width: 100%;
}

.upload-progress-container .progress {
    height: 6px;
}

/* ===== END UPLOAD AREA STYLES ===== */
.version-row {
    background-color: var(--t-surface-2, #f8f9fa) !important;
    border-left: 3px solid var(--bs-primary) !important;
}
.version-cell {
    padding: 8px 12px !important;
    font-size: 0.9em !important;
    color: var(--t-ink-muted, #6c757d) !important;
}
.version-link {
    cursor: pointer !important;
}
.version-chevron {
    transition: transform 0.2s ease;
}
.footnote-ref {
    color: var(--bs-primary);
    font-weight: bold;
    font-size: 0.8em;
    vertical-align: super;
}
.footnote-row {
    background-color: var(--t-surface-2, #f8f9fa);
    border-top: 1px solid var(--t-line, #dee2e6);
}
.footnote-cell {
    padding: 8px 12px;
    font-size: 0.9em;
    color: var(--t-ink-muted, #6c757d);
}
.footnotes {
    margin: 0;
}
.footnote-item {
    margin-bottom: 4px;
    line-height: 1.4;
}
.footnote-number {
    font-weight: bold;
    color: var(--bs-primary);
    margin-right: 4px;
}
/* The file-type icon's gradient is two near-whites; on a dark page it is a bright slab behind
   every attachment. Same gradient, on the dark end of the scale. */
[data-bs-theme="dark"] .file-preview-icon {
    background: linear-gradient(135deg, var(--sl-200, #24314a) 0%, var(--sl-100, #172033) 100%);
}
