/*
 * Upload Box Style
 * Stile per la casella di upload documenti drag & drop
 * Creato: 09 Luglio 2025
 */

/* ==================================================================
   UPLOAD ZONE DRAG & DROP
   ================================================================== */

#uploadForm {
    background-color: #ffffff;
    border-radius: var(--apple-radius-md, 10px);
    box-shadow: var(--apple-shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.06));
    margin-bottom: 1rem;
    overflow: visible;
}

#uploadForm h6 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--apple-gray-3, #48484a);
    margin: 0;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--apple-separator, rgba(60, 60, 67, 0.12));
    background-color: var(--apple-bg-secondary, #f2f2f7);
}

#uploadForm h6 i {
    margin-right: 0.5rem;
    color: var(--apple-blue, #007aff);
}

.upload-zone-simple {
    position: relative;
    border: 1px solid #dee2e6; /* Unified border */
    border-radius: 8px; /* Unified radius */
    padding: 2rem 1rem;
    text-align: center;
    background: #f8f9fa; /* Unified background */
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0;
}

.upload-zone-simple:hover {
    border-color: #007aff;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.1);
}

.upload-zone-simple.drag-over {
    border-color: var(--apple-blue, #007aff);
    border-width: 2px;
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.1) 0%, rgba(0, 122, 255, 0.05) 100%);
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 122, 255, 0.2);
}

/* Animazione per il drag and drop */
.upload-zone-simple.drag-active {
    animation: pulse-upload 1.5s ease-in-out infinite;
}

@keyframes pulse-upload {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 122, 255, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(0, 122, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 122, 255, 0);
    }
}

/* Success animation when files are dropped */
.upload-zone-simple.upload-success {
    border-color: #28a745;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1) 0%, rgba(40, 167, 69, 0.05) 100%);
    animation: success-pulse 1.5s ease-out;
}

@keyframes success-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }
    25% {
        transform: scale(1.05);
        box-shadow: 0 0 0 5px rgba(40, 167, 69, 0.4);
    }
    75% {
        transform: scale(1.02);
        box-shadow: 0 0 0 15px rgba(40, 167, 69, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}

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

.upload-icon-simple {
    font-size: 2.5rem;
    color: var(--apple-blue, #007aff);
    margin-bottom: 0.75rem;
    display: block;
}

.upload-text-simple {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--apple-gray-2, #636366);
    margin-bottom: 0.25rem;
}

.upload-hint-simple {
    font-size: 0.75rem;
    color: var(--apple-gray-1, #8e8e93);
}

.file-input-simple {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* File list premium design */
.file-list-simple {
    margin: 0 1rem 1rem;
    background: var(--apple-bg-secondary, #f9f9fb);
    border-radius: var(--apple-radius-md, 10px);
    padding: 0.75rem;
    border: 1px solid var(--apple-separator, rgba(60, 60, 67, 0.08));
    backdrop-filter: blur(10px);
}

.file-list-header {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--apple-gray-3, #48484a);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.file-item-simple {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    margin-bottom: 0.25rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: var(--apple-radius-sm, 6px);
    border: 1px solid var(--apple-separator, rgba(60, 60, 67, 0.08));
    backdrop-filter: blur(5px);
}

.file-item-simple:last-child {
    margin-bottom: 0;
}

.file-icon-simple {
    width: 24px;
    height: 24px;
    margin-right: 0.75rem;
    color: var(--apple-blue, #007aff);
    flex-shrink: 0;
}

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

.file-name-simple {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--apple-gray-3, #48484a);
    margin-bottom: 0.125rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size-simple {
    font-size: 0.625rem;
    color: var(--apple-gray-1, #8e8e93);
}

.file-remove-simple {
    background: none;
    border: none;
    color: var(--apple-red, #ff3b30);
    font-size: 0.875rem;
    cursor: pointer;
    padding: 0.25rem;
    margin-left: 0.5rem;
    border-radius: var(--apple-radius-sm, 6px);
    transition: background-color 0.15s ease;
    flex-shrink: 0;
}

.file-remove-simple:hover {
    background: rgba(255, 59, 48, 0.1);
}

/* ==================================================================
   FILE ITEMS ADVANCED STYLING (Generated by JavaScript)
   ================================================================== */

/* File item container (matches JavaScript generated classes) */
.file-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--apple-radius-md, 10px);
    border: 1px solid var(--apple-separator, rgba(60, 60, 67, 0.08));
    backdrop-filter: blur(10px);
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.file-item:hover {
    background: rgba(255, 255, 255, 1);
    border-color: var(--apple-blue, #007aff);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.15);
}

.file-item:last-child {
    margin-bottom: 0;
}

/* File item content wrapper */
.file-item-content {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

/* File icon with type-based colors */
.file-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--apple-radius-sm, 6px);
    margin-right: 1rem;
    flex-shrink: 0;
    font-size: 1.5rem;
    transition: all 0.2s ease;
}

/* File type specific colors */
.file-icon.pdf {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.2);
}

.file-icon.doc {
    background: rgba(0, 123, 255, 0.1);
    color: #007bff;
    border: 1px solid rgba(0, 123, 255, 0.2);
}

.file-icon.xml,
.file-icon.json {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.2);
}

.file-icon.img {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.2);
}

.file-icon.default {
    background: rgba(108, 117, 125, 0.1);
    color: #6c757d;
    border: 1px solid rgba(108, 117, 125, 0.2);
}

/* File details container */
.file-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* File name styling */
.file-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--apple-gray-3, #48484a);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
}

/* File metadata container */
.file-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.75rem;
}

/* File size styling */
.file-size {
    color: var(--apple-gray-1, #8e8e93);
    font-weight: 500;
}

/* File type badge */
.file-type {
    background: var(--apple-bg-tertiary, rgba(0, 122, 255, 0.1));
    color: var(--apple-blue, #007aff);
    padding: 0.125rem 0.5rem;
    border-radius: var(--apple-radius-sm, 6px);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.625rem;
    border: 1px solid rgba(0, 122, 255, 0.2);
}

/* File actions container */
.file-actions {
    display: flex;
    align-items: center;
    margin-left: 1rem;
    flex-shrink: 0;
}

/* File remove button */
.file-remove {
    background: none;
    border: none;
    color: var(--apple-red, #ff3b30);
    font-size: 1rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--apple-radius-sm, 6px);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.file-remove:hover {
    background: rgba(255, 59, 48, 0.1);
    color: #d63031;
    transform: scale(1.1);
}

/* File count badge in header */
.file-count {
    background: var(--apple-blue, #007aff);
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: var(--apple-radius-lg, 12px);
    font-size: 0.625rem;
    font-weight: 700;
    margin-left: 0.5rem;
    min-width: 20px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 122, 255, 0.3);
}

/* Upload actions */
.upload-actions-simple {
    padding: 1rem;
    border-top: 1px solid var(--apple-separator, rgba(60, 60, 67, 0.12));
    background: var(--apple-bg-secondary, #f2f2f7);
}

.btn-upload {
    background: linear-gradient(135deg, var(--apple-blue, #007aff), #0056cc);
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--apple-radius-md, 10px);
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.btn-upload:hover:not(:disabled) {
    background: linear-gradient(135deg, #0056cc, #004aaa);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.4);
    color: white;
}

.btn-upload:disabled {
    background: var(--apple-gray-5, #d1d1d6);
    color: var(--apple-gray-1, #8e8e93);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Progress bar per upload */
.upload-progress {
    margin: 1rem;
    background: var(--apple-bg-secondary, #f2f2f7);
    border-radius: var(--apple-radius-sm, 6px);
    overflow: hidden;
    height: 4px;
    display: none;
}

.upload-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--apple-blue, #007aff), var(--apple-green, #34c759));
    border-radius: var(--apple-radius-sm, 6px);
    transition: width 0.3s ease;
    width: 0%;
}

/* Responsive design */
@media (max-width: 768px) {
    .upload-zone-simple {
        padding: 1.5rem 0.75rem;
        margin: 0;
    }
    
    .upload-icon-simple {
        font-size: 2rem;
    }
    
    .upload-text-simple {
        font-size: 0.8rem;
    }
    
    .upload-hint-simple {
        font-size: 0.7rem;
    }
    
    .btn-upload {
        padding: 0.625rem 1rem;
        font-size: 0.8rem;
    }
}