/* استایل‌های اختصاصی صفحه مدیریت رسانه */

.upload-section {
    margin-bottom: 25px;
    text-align: center;
}
.upload-media-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.upload-media-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.upload-progress {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.upload-progress-item {
    margin-bottom: 10px;
    padding: 10px;
    background: white;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.upload-progress-item:last-child {
    margin-bottom: 0;
}

.progress-file-name {
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    word-break: break-word;
}

.progress-bar-container {
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
    border-radius: 3px;
}

.progress-status {
    font-size: 12px;
    color: #6c757d;
    margin-top: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress-status i {
    font-size: 14px;
}

/* فیلتر و جستجو */
.filter-section {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.search-input, .filter-select {
    flex: 1;
    min-width: 200px;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: 'Vazirmatn', 'Tahoma', sans-serif;
}

.filter-select {
    max-width: 200px;
}

/* عملیات گروهی */
.bulk-actions {
    margin-bottom: 20px;
    padding: 15px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.bulk-action-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.bulk-action-btn:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.bulk-action-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    opacity: 0.6;
}

.bulk-progress {
    width: 100%;
    padding: 10px 0;
}

.bulk-progress-bar-container {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.bulk-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #dc3545 0%, #ff6b6b 100%);
    transition: width 0.3s ease;
    border-radius: 4px;
}

.bulk-progress-text {
    font-size: 13px;
    color: #495057;
    display: block;
    text-align: center;
}

/* Grid رسانه‌ها */
#media-grid-container {
    min-height: 400px;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.media-card {
    background: #fff;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.media-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.media-card.selected {
    border-color: #667eea;
    background: #f0f4ff;
}

.media-checkbox {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    z-index: 10;
    appearance: none;
    background: white;
    border: 2px solid #6c757d;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.media-checkbox:checked {
    background: #667eea;
    border-color: #667eea;
}

.media-checkbox:checked::after {
    content: '✓';
    color: white;
    font-weight: bold;
    font-size: 16px;
    display: block;
    text-align: center;
    line-height: 20px;
}

.media-preview {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 8px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.media-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.media-preview .file-icon {
    font-size: 64px;
    color: #adb5bd;
}

.media-info {
    margin-top: 12px;
}

.media-name {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.media-meta {
    font-size: 12px;
    color: #868e96;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.media-meta i {
    font-size: 11px;
}

.media-type-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    color: white;
}

.media-type-badge.image {
    background: #28a745;
}

.media-type-badge.video {
    background: #dc3545;
}

.media-type-badge.audio {
    background: #17a2b8;
}

.media-type-badge.document {
    background: #ff9800;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.pagination-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    color: #495057;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.pagination-btn:hover:not(:disabled) {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Modal */
.media-modal-content {
    max-width: 600px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
}

.close-modal {
    background: none;
    border: none;
    font-size: 20px;
    color: #6c757d;
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: #dc3545;
}

.modal-body {
    text-align: center;
}

#modal-media-preview {
    margin-bottom: 20px;
    max-height: 400px;
    overflow: hidden;
    border-radius: 8px;
}

#modal-media-preview img {
    max-width: 100%;
    max-height: 150px;
    border-radius: 8px;
}

#modal-media-preview .file-icon {
    font-size: 120px;
    color: #adb5bd;
}

.media-details {
    text-align: right;
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    align-items: center;
}

.detail-item:last-child {
    margin-bottom: 0;
}

.detail-label {
    font-weight: 600;
    color: #495057;
}

.media-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.media-actions .action-btn {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.action-btn.copy-url {
    background: #17a2b8;
    color: white;
}

.action-btn.copy-url:hover {
    background: #138496;
}

.action-btn.edit {
    background: #ffc107;
    color: #000;
}

.action-btn.edit:hover {
    background: #e0a800;
}

.action-btn.delete {
    background: #dc3545;
    color: white;
}

.action-btn.delete:hover {
    background: #c82333;
}

.action-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

/* Copy notification */
.copy-notification {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #28a745;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: none;
}

.copy-notification.show {
    display: block;
}

/* Modal ویرایش */
.edit-media-modal-content {
    max-width: 600px;
}

#edit-modal-preview {
    margin-bottom: 20px;
    max-height: 300px;
    overflow: hidden;
    border-radius: 8px;
    border: 2px solid #dee2e6;
}

#edit-modal-preview img {
    max-width: 100%;
    display: block;
}

.seo-notice {
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    align-items: start;
    gap: 10px;
}

.seo-notice i {
    color: #0066cc;
    font-size: 20px;
    margin-top: 2px;
}

.seo-notice strong {
    color: #004080;
}

.form-group {
    margin-bottom: 20px;
    text-align: right;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: 'Vazirmatn', 'Tahoma', sans-serif;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.form-help {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #6c757d;
}

.modal-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.modal-actions .action-btn {
    flex: 1;
}

.action-btn.save {
    background: #28a745;
    color: white;
}

.action-btn.save:hover {
    background: #218838;
}

.action-btn.cancel {
    background: #6c757d;
    color: white;
}

.action-btn.cancel:hover {
    background: #5a6268;
}

/* Responsive */
@media (max-width: 768px) {
    .media-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }

    .filter-section {
        flex-direction: column;
    }

    .search-input, .filter-select {
        width: 100%;
        max-width: 100%;
    }

    .media-actions {
        flex-direction: row;
    }

    .media-actions .action-btn {
        width: 30%;
    }
}

@media (max-width: 480px) {
    .media-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .media-modal-content {
        padding: 20px;
    }
}
