/* Enhanced File Upload Styles */
.file-upload-enhanced {
    border: 2px dashed var(--border-color);
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: var(--bg-tertiary);
    position: relative;
}

.file-upload-enhanced:hover {
    border-color: var(--accent-primary);
    background-color: var(--bg-secondary);
}

.file-upload-enhanced.dragover {
    border-color: var(--accent-primary);
    background-color: rgba(59, 130, 246, 0.1);
}

.file-upload-enhanced input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 1;
}

.file-upload-enhanced .upload-content {
    pointer-events: none;
    z-index: 0;
}

.file-upload-enhanced .upload-icon {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.file-upload-enhanced .upload-text {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.file-upload-enhanced .upload-hint {
    color: var(--text-muted);
    font-size: 0.875rem;
    opacity: 0.8;
}

/* File Preview Grid */
.file-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
}

.file-preview-item {
    position: relative;
    background: var(--bg-primary);
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
    cursor: pointer;
}

.file-preview-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Hover Overlay */
.file-preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 150px;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 2;
}

.file-preview-item:hover .file-preview-overlay {
    opacity: 1;
}

.file-preview-eye-icon {
    font-size: 2.5rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Image Preview */
.file-preview-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 0.5rem 0.5rem 0 0;
}

/* Video Preview */
.file-preview-video {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 0.5rem 0.5rem 0 0;
}

.file-preview-video::-webkit-media-controls {
    display: none;
}

.file-preview-video::-webkit-media-controls-enclosure {
    display: none;
}

.video-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 150px;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.video-play-overlay:hover {
    background: rgba(0, 0, 0, 0.5);
}

.video-play-icon {
    font-size: 3rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Document Preview */
.file-preview-document {
    width: 100%;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: 0.5rem 0.5rem 0 0;
}

.file-preview-document .material-icons {
    font-size: 4rem;
    color: var(--text-muted);
}

/* File Info */
.file-preview-info {
    padding: 0.75rem;
    background: var(--bg-primary);
}

.file-preview-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    word-break: break-word;
    line-height: 1.2;
}

.file-preview-size {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.file-preview-actions {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    z-index: 3;
}

.file-delete-icon {
    background: none;
    border: none;
    color: #dc2626;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-delete-icon:hover {
    color: #ef4444;
}

.file-delete-icon .material-icons {
    font-size: 1.25rem;
}

/* Fullview Modal */
.fullview-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.fullview-modal.active {
    display: flex;
}

.fullview-modal-content {
    position: relative;
    width: 95%;
    height: 95%;
    max-width: 1200px;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullview-modal-body {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    overflow: hidden;
}

.fullview-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 0.5rem;
}

.fullview-video {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 0.5rem;
}

.fullview-pdf {
    width: 100%;
    height: 100%;
    min-height: 85vh;
    border-radius: 0.5rem;
    background: white;
}

.fullview-document {
    text-align: center;
    padding: 2rem;
    background: var(--bg-primary);
    border-radius: 0.5rem;
    color: var(--text-primary);
}

.fullview-document-icon {
    font-size: 6rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.fullview-document h3 {
    margin-bottom: 1rem;
    word-break: break-word;
}

.fullview-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--accent-primary);
    color: white;
    text-decoration: none;
    border-radius: 0.5rem;
    margin-top: 1rem;
    transition: all 0.2s ease;
}

.fullview-download-btn:hover {
    background: var(--accent-primary);
    transform: translateY(-1px);
}

.fullview-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: all 0.2s ease;
    z-index: 1001;
}

.fullview-modal-close:hover {
    background: rgba(0, 0, 0, 0.8);
    color: var(--accent-primary);
}

/* Prevent body scroll when modal is open */
.modal-open {
    overflow: hidden;
}

/* Zoomable content */
.fullview-zoomable {
    transition: transform 0.05s ease;
    cursor: default;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
}

.fullview-zoomable.rapid-zoom {
    transition: none !important;
}

.fullview-zoomable.zoomable {
    cursor: grab;
}

.fullview-zoomable:active {
    cursor: grabbing;
}

.fullview-image.zoomable {
    width: auto;
    height: auto;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
    pointer-events: auto;
}

.fullview-video.zoomable {
    width: auto;
    height: auto;
    user-select: none;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
}

/* Loading State */
.file-upload-loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.file-upload-loading::after {
    content: '';
    position: absolute;
    top: calc(50% - 30px);
    left: calc(50% - 10px);
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Upload Progress Percentage */
.upload-progress-text {
    position: absolute;
    top: calc(50% + 25px);
    left: 50%;
    transform: translateX(-50%);
    color: var(--accent-primary);
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    z-index: 15;
}

.upload-progress-percentage {
    color: var(--accent-primary);
    font-weight: bold;
    font-size: 1rem;
}

.upload-progress-status {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 2px;
    opacity: 0.8;
}

/* Compression Progress */
.compression-progress {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 8px;
    padding: 8px;
    color: white;
    font-size: 0.8rem;
    z-index: 10;
}

.compression-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    margin-top: 4px;
    overflow: hidden;
}

.compression-progress-fill {
    height: 100%;
    background: var(--accent-primary);
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0%;
}

.compression-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
}

.compression-percentage {
    font-weight: bold;
    color: var(--accent-primary);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .file-preview-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.75rem;
        padding: 0.75rem;
    }
    
    .file-preview-image,
    .file-preview-video,
    .file-preview-document {
        height: 120px;
    }
    
    .video-play-overlay {
        height: 120px;
    }
    
    .video-play-icon {
        font-size: 2rem;
    }
    
    .file-preview-info {
        padding: 0.5rem;
    }
    
    .file-preview-name {
        font-size: 0.8rem;
    }
    
    .file-preview-size {
        font-size: 0.7rem;
    }
    
    /* Fullview Modal Mobile */
    .fullview-modal-content {
        width: 98%;
        height: 98%;
        max-width: none;
        max-height: none;
    }
    
    .fullview-modal-close {
        top: 0.5rem;
        right: 0.5rem;
        font-size: 1.5rem;
        padding: 0.25rem;
    }
    
    .fullview-video {
        max-height: 90vh;
    }
    
    .fullview-pdf {
        min-height: 90vh;
    }
    
    .fullview-document {
        padding: 1rem;
        margin: 0.5rem;
    }
    
    .fullview-document-icon {
        font-size: 4rem;
    }
    
    .fullview-download-btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    /* Mobile Hover Overlay */
    .file-preview-overlay {
        height: 120px;
    }
    
    .file-preview-eye-icon {
        font-size: 2rem;
    }
    
    /* Show overlay on touch devices when tapped */
    .file-preview-item:active .file-preview-overlay {
        opacity: 1;
    }
}

/* Empty State */
.file-preview-empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-style: italic;
}

.file-preview-empty .material-icons {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Temporary Upload Container - Dark themed by default */
.temporary-upload-container {
    border: 2px dashed #475569 !important;
    border-radius: 8px !important;
    background-color: #1e293b !important;
    padding: 16px !important;
    margin-top: 16px !important;
    position: relative !important;
}

.temporary-upload-header {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin-bottom: 12px !important;
    color: #94a3b8 !important;
    font-weight: 500 !important;
}

.temporary-upload-header .material-icons {
    font-size: 20px !important;
    color: #f59e0b !important;
}

.temporary-upload-header small {
    margin-left: auto !important;
    font-size: 12px !important;
    color: #64748b !important;
    font-weight: 400 !important;
}

/* Ensure dark theme in all cases */
[data-theme="light"] .temporary-upload-container {
    background-color: #1e293b !important;
    border-color: #475569 !important;
}

[data-theme="light"] .temporary-upload-header {
    color: #94a3b8 !important;
}

[data-theme="light"] .temporary-upload-header .material-icons {
    color: #f59e0b !important;
}

[data-theme="light"] .temporary-upload-header small {
    color: #64748b !important;
}

/* Delete button for existing files - Same style as temporary upload area */
.evidence-file-delete-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: none;
    color: #ef4444;
    border: none;
    border-radius: 0;
    width: auto;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease, color 0.2s ease;
    font-size: 16px;
    z-index: 10;
    padding: 0;
}

.evidence-file-delete-btn:hover {
    background: none;
    color: #dc2626;
}

.file-preview-item:hover .evidence-file-delete-btn {
    opacity: 1;
}

.evidence-file-delete-btn .material-icons {
    font-size: 18px;
}

/* Custom Confirmation Modal */
.custom-confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.custom-confirm-content {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 24px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.custom-confirm-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.custom-confirm-header .material-icons {
    color: #f59e0b;
    font-size: 24px;
}

.custom-confirm-header h3 {
    margin: 0;
    color: var(--color-text-primary);
    font-size: 18px;
    font-weight: 600;
}

.custom-confirm-message {
    color: var(--color-text-secondary);
    margin-bottom: 24px;
    line-height: 1.5;
}

.custom-confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.custom-confirm-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.custom-confirm-btn.cancel {
    background: var(--color-bg-tertiary);
    color: var(--color-text-secondary);
}

.custom-confirm-btn.cancel:hover {
    background: var(--color-bg-quaternary);
}

.custom-confirm-btn.confirm {
    background: #ef4444;
    color: white;
}

.custom-confirm-btn.confirm:hover {
    background: #dc2626;
} 