/* تحسينات تصميم قسم رفع الملفات - خدمة شهادة التميز */

/* Grid Layout - مرفقين بجانب بعض */
.attachments-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 20px 0;
}

@media (max-width: 768px) {
    .attachments-grid {
        grid-template-columns: 1fr;
    }
}

.file-upload-container {
    position: relative;
    margin-bottom: 0;
}

/* تصميم المربع - Drag & Drop Area */
.file-upload-wrapper {
    position: relative;
    min-height: 120px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px dashed #dee2e6;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    cursor: pointer;
    overflow: hidden;
}

.file-upload-wrapper:hover {
    border-color: #0ac083;
    background: linear-gradient(135deg, #f0fdf9 0%, #e6f9f3 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(10, 192, 131, 0.1);
}

.file-upload-wrapper.drag-over {
    border-color: #0ac083;
    border-style: solid;
    background: linear-gradient(135deg, #e6f9f3 0%, #d1f4e8 100%);
    box-shadow: 0 0 20px rgba(10, 192, 131, 0.2);
}

.file-upload-wrapper.uploading {
    border-color: #ffc107;
    background: linear-gradient(135deg, #fffef0 0%, #fff9e1 100%);
    border-style: solid;
}

.file-upload-wrapper.success {
    border-color: #0ac083;
    background: linear-gradient(135deg, #f0fdf9 0%, #e6f9f3 100%);
    border-style: solid;
}

.file-upload-wrapper.error {
    border-color: #f27474;
    background: linear-gradient(135deg, #fff5f5 0%, #ffe9e9 100%);
    border-style: solid;
}

/* محتوى المربع */
.file-upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    gap: 6px;
}

.file-upload-icon {
    font-size: 36px;
    color: #6c757d;
    margin-bottom: 0;
    transition: all 0.3s ease;
}

.file-upload-wrapper:hover .file-upload-icon {
    color: #0ac083;
    transform: scale(1.1);
}

.file-upload-wrapper.success .file-upload-icon {
    color: #0ac083;
}

.file-upload-wrapper.error .file-upload-icon {
    color: #f27474;
}

.file-upload-title {
    font-size: 15px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.file-upload-subtitle {
    font-size: 12px;
    color: #6c757d;
    margin: 0;
}

.file-upload-or {
    font-size: 11px;
    color: #adb5bd;
    margin: 0;
}

.file-upload-text-btn {
    font-size: 13px;
    font-weight: 600;
    color: #0ac083;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 2px 0 0 0;
    transition: all 0.3s ease;
    border-bottom: 1px dashed transparent;
}

.file-upload-wrapper:hover .file-upload-text-btn {
    color: #089968;
    border-bottom-color: #089968;
}

.file-upload-text-btn i {
    font-size: 15px;
}

/* حقل الملف المخفي */
.file-input-hidden {
    opacity: 0;
    position: absolute;
    z-index: -1;
    width: 0;
    height: 0;
}

/* أيقونة الحالة */
.file-status-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    display: none;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.file-status-icon.waiting {
    display: block;
    color: #6c757d;
}

.file-status-icon.uploading {
    display: block;
    color: #ffc107;
    animation: spin 1s linear infinite;
}

.file-status-icon.success {
    display: block;
    color: #0ac083;
}

.file-status-icon.error {
    display: block;
    color: #f27474;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Progress Bar */
.file-progress-bar {
    width: 100%;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 12px;
    display: none;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
}

.file-progress-bar.active {
    display: block;
}

.file-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0ac083, #00d9a0);
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.file-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.3),
            transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* اسم الملف */
.file-name-display {
    font-size: 14px;
    color: #495057;
    margin-top: 10px;
    font-weight: 500;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-name-display.file-uploaded {
    color: #0ac083;
}

/* رسالة الخطأ */
.file-error-message {
    display: none;
    color: #f27474;
    font-size: 12px;
    margin-top: 10px;
    padding: 8px 12px;
    background: rgba(242, 116, 116, 0.1);
    border-radius: 6px;
    border-left: 3px solid #f27474;
    width: 100%;
    text-align: right;
}

.file-error-message.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* معلومات الملف */
.file-info {
    display: none;
    font-size: 11px;
    color: #6c757d;
    margin-top: 8px;
}

.file-info.show {
    display: block;
}

/* أنواع الملفات المقبولة */
.file-types-accepted {
    font-size: 10px;
    color: #adb5bd;
    margin-top: 0;
}

.file-types-accepted i {
    margin-right: 4px;
}