/**
 * Multiple Files Upload Styles for Quotation Form Wizard
 * 
 * @package AnchorExpressInc\QuotationForm
 * @version 1.0.0
 */

/* ========================================
   File Upload Container
   ======================================== */

.qf-file-upload-section {
    margin-bottom: 24px;
}

.qf-file-upload-label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
}

/* ========================================
   Drop Zone
   ======================================== */

.qf-file-drop-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: #f9fafb;
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.qf-file-drop-zone:hover {
    background: #eff6ff;
    border-color: var(--qf-dynamic-primary);
}

.qf-file-drop-zone.qf-drag-over {
    background: #eff6ff;
    border-color: var(--qf-dynamic-primary);
    border-width: 3px;
    transform: scale(1.02);
}

.qf-upload-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
}

.qf-upload-icon svg {
    width: 100%;
    height: 100%;
    fill: var(--qf-dynamic-button);
}

.qf-upload-text {
    margin-bottom: 8px;
}

.qf-upload-text strong {
    color: var(--qf-dynamic-button);
    font-weight: 600;
}

.qf-upload-hint {
    font-size: 13px;
    color: #6b7280;
}

/* ========================================
   Selected Files List
   ======================================== */

.qf-selected-files-list {
    display: none;
}

.qf-selected-files-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.qf-files-count {
    font-size: 15px;
    font-weight: 600;
    color: #374151;
}

.qf-add-more-files-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    background: var(--qf-dynamic-form-bg, #ffffff);
    color: var(--qf-dynamic-button);
    border: 1px solid var(--qf-dynamic-button);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.qf-add-more-files-btn:hover {
    background: var(--qf-dynamic-button);
    color: var(--qf-dynamic-button-secondary);
}

.qf-add-more-files-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.qf-files-list-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ========================================
   File Item
   ======================================== */

.qf-file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.2s ease;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.qf-file-item:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.qf-file-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.qf-file-icon svg {
    width: 20px;
    height: 20px;
    fill: var(--qf-dynamic-button);
}

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

.qf-file-name {
    font-size: 14px;
    font-weight: 500;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.qf-file-size {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

.qf-file-remove {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.qf-file-remove:hover {
    background: #fee2e2;
}

.qf-file-remove svg {
    width: 16px;
    height: 16px;
    fill: #6b7280;
}

.qf-file-remove:hover svg {
    fill: #dc2626;
}

/* ========================================
   Upload Error
   ======================================== */

.qf-upload-error {
    display: none;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 16px;
    background: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    margin-top: 12px;
}

.qf-upload-error svg {
    width: 20px;
    height: 20px;
    fill: var(--qf-dynamic-error, #dc2626);
    flex-shrink: 0;
    margin-top: 2px;
}

.qf-error-message-text {
    flex: 1;
    font-size: 14px;
    color: #991b1b;
    line-height: 1.4;
}

/* ========================================
   Hidden File Input
   ======================================== */

#qf-document-upload {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ========================================
   Responsive Design
   ======================================== */

@media screen and (max-width: 768px) {
    .qf-file-drop-zone {
        padding: 32px 16px;
    }

    .qf-upload-icon {
        width: 40px;
        height: 40px;
    }

    .qf-selected-files-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .qf-add-more-files-btn {
        width: 100%;
        justify-content: center;
    }
}

@media screen and (max-width: 480px) {
    .qf-file-drop-zone {
        padding: 24px 12px;
    }

    .qf-upload-text {
        font-size: 14px;
    }

    .qf-upload-hint {
        font-size: 12px;
    }

    .qf-file-item {
        padding: 10px 12px;
    }

    .qf-file-name {
        font-size: 13px;
    }
}

/* ========================================
   Accessibility
   ======================================== */

.qf-file-drop-zone:focus-within {
    outline: 2px solid var(--qf-dynamic-primary);
    outline-offset: 2px;
}

.qf-file-remove:focus {
    outline: 2px solid var(--qf-dynamic-button);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .qf-file-drop-zone {
        border-width: 3px;
    }

    .qf-file-item {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .qf-file-item {
        animation: none;
    }

    .qf-file-drop-zone,
    .qf-file-item,
    .qf-file-remove,
    .qf-add-more-files-btn {
        transition: none;
    }
}
