/**
 * Delivery File Manager - Styles CSS
 * Styles pour les modales d'upload et téléchargement des fichiers de livraison
 */

/* ===== MODAL OVERLAY ===== */
.delivery-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ===== MODAL CONTAINER ===== */
.delivery-modal-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ===== MODAL HEADER ===== */
.delivery-modal-header {
    background: linear-gradient(135deg, #6300ff, #8b5cf6);
    color: white;
    padding: 20px 25px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.delivery-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.delivery-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.delivery-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ===== MODAL BODY ===== */
.delivery-modal-body {
    padding: 25px;
}

/* ===== UPLOAD AREA ===== */
.upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    background: #f9fafb;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.upload-area:hover {
    border-color: #6300ff;
    background: #f3f4f6;
}

.upload-area.drag-over {
    border-color: #6300ff;
    background: #ede9fe;
    transform: scale(1.02);
}

.upload-area .upload-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.upload-area h4 {
    margin: 0 0 8px 0;
    color: #374151;
    font-weight: 600;
}

.upload-area p {
    margin: 0 0 20px 0;
    color: #6b7280;
    font-size: 14px;
}

.upload-area #delivery-file-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.btn-select-files {
    background: #6300ff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-select-files:hover {
    background: #5b21b6;
}

/* ===== FILE INFO ===== */
.file-info {
    margin-top: 15px;
    text-align: center;
    color: #6b7280;
}

/* ===== FILES PREVIEW ===== */
.delivery-files-preview {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid #e5e7eb;
}

.delivery-files-preview h4 {
    margin: 0 0 15px 0;
    color: #374151;
    font-weight: 600;
}

.files-list,
.download-files-list {
    max-height: 200px;
    overflow-y: auto;
}

.file-item,
.download-file-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    margin-bottom: 8px;
    background: white;
    transition: background-color 0.2s ease;
}

.file-item:hover,
.download-file-item:hover {
    background: #f9fafb;
}

.file-icon {
    font-size: 20px;
    margin-right: 12px;
    flex-shrink: 0;
}

.file-name {
    flex: 1;
    font-weight: 500;
    color: #374151;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size {
    color: #6b7280;
    font-size: 12px;
    margin-right: 10px;
    flex-shrink: 0;
}

.file-remove {
    background: #ef4444;
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

.file-remove:hover {
    background: #dc2626;
}

/* ===== PROGRESS BAR ===== */
.delivery-progress {
    margin-top: 20px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6300ff, #8b5cf6);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.progress-text {
    text-align: center;
    margin-top: 8px;
    color: #6b7280;
    font-size: 14px;
}

/* ===== DOWNLOAD BUTTONS ===== */
.btn-download-file {
    background: #059669;
    color: white !important;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none !important;
    cursor: pointer;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

.btn-download-file:hover {
    background: #047857;
    color: white !important;
}

/* ===== MODAL FOOTER ===== */
.delivery-modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: #f9fafb;
    border-radius: 0 0 12px 12px;
}

.btn-cancel {
    background: #6b7280;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-cancel:hover {
    background: #4b5563;
}

.btn-upload {
    background: #059669;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-upload:hover:not(:disabled) {
    background: #047857;
}

.btn-upload:disabled {
    background: #d1d5db;
    color: #6b7280;
    cursor: not-allowed;
}

/* ===== BODY MODAL OPEN ===== */
body.modal-open {
    overflow: hidden;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .delivery-modal-container {
        width: 95%;
        max-height: 95vh;
    }
    
    .delivery-modal-header,
    .delivery-modal-body,
    .delivery-modal-footer {
        padding: 15px 20px;
    }
    
    .upload-area {
        padding: 30px 15px;
    }
    
    .upload-area .upload-icon {
        font-size: 36px;
    }
    
    .file-item,
    .download-file-item {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .file-name {
        flex-basis: 100%;
        order: -1;
    }
}

/* ===== ANIMATIONS SPÉCIALES ===== */
.delivery-modal-overlay.closing {
    animation: fadeOut 0.3s ease forwards;
}

.delivery-modal-overlay.closing .delivery-modal-container {
    animation: slideDown 0.3s ease forwards;
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes slideDown {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
}

/* ===== INTÉGRATION AVEC LE THEME EXISTANT ===== */
.delivery-modal-container * {
    box-sizing: border-box;
}

.delivery-modal-container button:focus,
.delivery-modal-container input:focus {
    outline: 2px solid #6300ff;
    outline-offset: 2px;
}

/* ===== DRAG AND DROP INDICATORS ===== */
.upload-area::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 2px solid transparent;
    border-radius: 8px;
    background: linear-gradient(45deg, #6300ff, #8b5cf6);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.upload-area.drag-over::before {
    opacity: 0.1;
}
