/* ================================== */
/* Admin Image Upload & Drag & Drop  */
/* ================================== */

.image-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
    min-height: 100px;
    padding: 12px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    background: #fafafa;
}

.image-preview-item {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e0e0e0;
    background: white;
    cursor: move;
    transition: all 0.2s ease;
}

.image-preview-item:hover {
    border-color: #333;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.image-preview-item.dragging {
    opacity: 0.5;
    border-color: #666;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    transform: scale(1.05);
    cursor: grabbing;
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    user-select: none;
}

.drag-handle {
    position: absolute;
    top: 4px;
    left: 4px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    cursor: grab;
    z-index: 2;
    letter-spacing: 2px;
}

.image-preview-item:active .drag-handle {
    cursor: grabbing;
}

.remove-image {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 28px;
    height: 28px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 2;
}

.remove-image:hover {
    background: rgba(255, 0, 0, 1);
    transform: scale(1.1);
}

/* Upload Button Styles */
input[type="file"] {
    display: block;
    width: 100%;
    padding: 12px;
    border: 2px dashed #ccc;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

input[type="file"]:hover {
    border-color: #333;
    background: #f9f9f9;
}

input[type="file"]::file-selector-button {
    padding: 8px 16px;
    border: none;
    background: #333;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 12px;
    transition: all 0.2s ease;
}

input[type="file"]::file-selector-button:hover {
    background: #555;
}

/* Loading State */
.image-preview-item.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
}

.image-preview-item.loading::after {
    content: '';
    width: 30px;
    height: 30px;
    border: 3px solid #ddd;
    border-top-color: #333;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Form Labels */
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

/* Category Checkboxes Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 8px;
}

.category-checkbox-label {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

.category-checkbox-label:hover {
    border-color: #333;
    background: #f9f9f9;
}

.category-checkbox-label input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

.category-checkbox-label input[type="checkbox"]:checked + span {
    font-weight: 600;
    color: #333;
}

.category-checkbox-label:has(input:checked) {
    border-color: #333;
    background: #f0f0f0;
}

/* Notification Styles */
.admin-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 8px;
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10000;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
    max-width: 400px;
    font-size: 15px;
}

.admin-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.admin-notification.success {
    border-left: 4px solid #4caf50;
}

.admin-notification.error {
    border-left: 4px solid #f44336;
}

.admin-notification.info {
    border-left: 4px solid #2196f3;
}

.admin-notification.warning {
    border-left: 4px solid #ff9800;
}