/* Loading indicator styles */
.loading-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    pointer-events: none;
    opacity: 0;
    animation: fadeIn 0.2s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translate(-50%, -45%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}

.loading-spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 0.75rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-message {
    font-size: 1rem;
    font-weight: 500;
}

/* Drag and drop styles */
.thumbnail-nav-scroll {
    min-height: 76px; /* Ensure consistent height during drag operations */
    transition: background-color 0.2s ease;
}

.thumbnail-nav-scroll.reordering {
    background-color: rgba(0, 123, 255, 0.05);
}

.thumbnail-nav-scroll.reordering .thumbnail-item {
    transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.thumbnail-nav-scroll.reordering .thumbnail-item:not(.dragging-thumb) {
    cursor: move;
    cursor: grab;
}

.thumbnail-item.dragging-thumb {
    opacity: 0.7;
    transform: scale(0.98);
    transition: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
    cursor: grabbing !important;
}

.drop-placeholder-thumb {
    background-color: rgba(0, 123, 255, 0.1);
    border: 2px dashed #007bff;
    border-radius: 0.5rem;
    width: 68px;
    height: 68px;
    margin: 0 4px;
    transition: all 0.2s ease;
    position: relative;
    opacity: 0.8;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 0.6; transform: scale(0.98); }
    50% { opacity: 0.9; transform: scale(1.02); }
    100% { opacity: 0.6; transform: scale(0.98); }
}

.thumbnail-item.drag-over {
    position: relative;
    z-index: 10;
}

.thumbnail-item.drag-over::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border: 2px solid #007bff;
    border-radius: 0.5rem;
    pointer-events: none;
    animation: borderPulse 1.5s infinite;
}

@keyframes borderPulse {
    0% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.02); }
    100% { opacity: 0.3; transform: scale(1); }
}

/* Improve drag handle appearance */
.thumbnail-item img {
    user-select: none;
    -webkit-user-drag: none;
}

/* Add a subtle scale effect on hover */
.thumbnail-item:not(.dragging-thumb):hover {
    transform: translateY(-2px);
    transition: transform 0.2s ease;
}

/* Notification styles */
.notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    padding: 0.75rem 1.25rem;
    border-radius: 0.375rem;
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    opacity: 0;
    transform: translateX(120%);
    transition: opacity 0.3s ease, transform 0.3s ease;
    max-width: 320px;
}

.notification-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
}

.notification-message {
    flex: 1;
    margin-right: 10px;
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
}

.notification-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    opacity: 0.7;
}

.notification-close:hover {
    opacity: 1;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification.success {
    background-color: #28a745;
}

.notification.error {
    background-color: #dc3545;
}

.notification.info {
    background-color: #17a2b8;
}

.notification.warning {
    background-color: #ffc107;
    color: #212529;
}

/* Add some responsive adjustments */
@media (max-width: 768px) {
    .notification {
        left: 1rem;
        right: 1rem;
        max-width: none;
    }
}
