/* تنسيقات المرفقات */

.attachment-preview {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.attachment-card {
    transition: transform 0.2s ease-in-out;
    border: 1px solid #dee2e6;
}

.attachment-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.attachment-thumbnail {
    width: 30px;
    height: 30px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.attachment-icon {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    color: #dc3545;
}

.attachment-modal .modal-dialog {
    max-width: 90%;
}

.attachment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.attachment-info {
    font-size: 0.875rem;
    color: #6c757d;
}

.attachment-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.attachment-actions .btn {
    flex: 1;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

.file-preview-card {
    background-color: #f8f9fa;
    border: 1px dashed #dee2e6;
    border-radius: 4px;
    padding: 0.5rem;
    text-align: center;
}

.file-preview-card:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

.upload-zone {
    border: 2px dashed #007bff;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
}

.upload-zone:hover {
    border-color: #0056b3;
    background-color: #e3f2fd;
}

.upload-zone.dragover {
    border-color: #28a745;
    background-color: #d4edda;
}

.attachment-counter {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #dc3545;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
}

/* تنسيقات للصور */
.image-attachment {
    position: relative;
    overflow: hidden;
}

.image-attachment img {
    transition: transform 0.3s ease;
}

.image-attachment:hover img {
    transform: scale(1.05);
}

/* تنسيقات لملفات PDF */
.pdf-attachment {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border-radius: 4px;
    padding: 0.5rem;
    text-align: center;
}

/* تنسيقات للأزرار */
.btn-attachment {
    position: relative;
    overflow: hidden;
}

.btn-attachment::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-attachment:hover::before {
    left: 100%;
}

/* تنسيقات للتنبيهات */
.alert-attachment {
    border-left: 4px solid;
    border-radius: 0 4px 4px 0;
}

.alert-attachment.alert-success {
    border-left-color: #28a745;
}

.alert-attachment.alert-warning {
    border-left-color: #ffc107;
}

.alert-attachment.alert-danger {
    border-left-color: #dc3545;
}

/* تنسيقات للتحميل */
.download-progress {
    width: 100%;
    height: 4px;
    background-color: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
}

.download-progress-bar {
    height: 100%;
    background-color: #007bff;
    transition: width 0.3s ease;
}

/* تنسيقات للعرض المصغر */
.thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.thumbnail-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #dee2e6;
}

.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.thumbnail-item:hover .thumbnail-overlay {
    opacity: 1;
}

/* تنسيقات للاستجابة */
@media (max-width: 768px) {
    .attachment-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.5rem;
    }
    
    .attachment-actions {
        flex-direction: column;
    }
    
    .attachment-actions .btn {
        margin-bottom: 0.25rem;
    }
    
    .thumbnail-grid {
        grid-template-columns: repeat(auto-fit, minmax(40px, 1fr));
    }
}
