/* ══════════════════════════════════════════════════════════════════════════ */
/* Secure Upload UI Styles */
/* ══════════════════════════════════════════════════════════════════════════ */

.secure-upload-wrapper {
    position: relative;
    width: 100%;
}

/* ═══════════════════════════════════════════════════════════════ */
/* Progress Container */
/* ═══════════════════════════════════════════════════════════════ */
.upload-progress-container {
    margin-top: 10px;
    padding: 12px;
    background: linear-gradient(135deg, #e8f4fd 0%, #d1e9fb 100%);
    border-radius: 8px;
    border: 1px solid #b3d7f5;
}

.upload-progress-bar-wrapper {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.upload-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #1976d2 0%, #42a5f5 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.upload-progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #1565c0;
}

.progress-percent {
    font-weight: bold;
}

.progress-status {
    display: flex;
    align-items: center;
    gap: 5px;
}

.progress-status::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #1976d2;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ═══════════════════════════════════════════════════════════════ */
/* Status Container */
/* ═══════════════════════════════════════════════════════════════ */
.upload-status-container {
    padding: 10px 12px;
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.upload-status-container.upload-success {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border: 1px solid #81c784;
    color: #2e7d32;
}

.upload-status-container.upload-error {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    border: 1px solid #e57373;
    color: #c62828;
}

.upload-status-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.upload-success .upload-status-icon {
    color: #43a047;
}

.upload-error .upload-status-icon {
    color: #e53935;
}

.upload-status-message {
    flex-grow: 1;
    font-size: 13px;
    line-height: 1.4;
}

/* ═══════════════════════════════════════════════════════════════ */
/* Disabled Save Button During Upload */
/* ═══════════════════════════════════════════════════════════════ */
button.upload-in-progress {
    opacity: 0.7;
    cursor: not-allowed !important;
    background: #9e9e9e !important;
    border-color: #9e9e9e !important;
}

button.upload-in-progress:hover {
    background: #9e9e9e !important;
    border-color: #9e9e9e !important;
}

/* ═══════════════════════════════════════════════════════════════ */
/* Upload Row with Preview */
/* ═══════════════════════════════════════════════════════════════ */
.upload-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.upload-content-col {
    flex: 0 0 66.666%;
    max-width: 66.666%;
    padding: 0 10px;
}

.upload-preview-col {
    flex: 0 0 33.333%;
    max-width: 33.333%;
    padding: 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-preview-thumbnail {
    width: 100%;
    max-width: 120px;
    height: 120px;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.upload-preview-thumbnail.has-image {
    border-style: solid;
    border-color: #81c784;
}

.upload-preview-thumbnail.has-file {
    border-style: solid;
    border-color: #2196f3;
    background: #e3f2fd;
}

.upload-preview-thumbnail img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

/* Download button for non-image files */
.upload-download-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #1565c0;
    padding: 10px;
    transition: all 0.3s ease;
    width: 100%;
    height: 100%;
}

.upload-download-btn:hover {
    background: #bbdefb;
    color: #0d47a1;
    text-decoration: none;
}

.upload-download-btn i {
    font-size: 2.5rem;
    margin-bottom: 8px;
}

.upload-download-btn .download-text {
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
}

.upload-download-btn .en-text,
.upload-download-btn .ar-text {
    display: block;
}

/* File preview (before upload) */
.upload-file-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    text-align: center;
}

.upload-file-preview .file-name {
    color: #495057;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upload-preview-placeholder {
    color: #adb5bd;
    font-size: 12px;
    text-align: center;
    padding: 10px;
}

.upload-preview-placeholder i {
    font-size: 32px;
    display: block;
    margin-bottom: 5px;
}

/* ═══════════════════════════════════════════════════════════════ */
/* Responsive */
/* ═══════════════════════════════════════════════════════════════ */
@media (max-width: 576px) {
    .upload-content-col,
    .upload-preview-col {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .upload-preview-col {
        margin-top: 15px;
    }

    .upload-preview-thumbnail {
        max-width: 100px;
        height: 100px;
    }
}
