/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Component animations */
.fade-in {
    animation: fadeIn 0.3s ease-out;
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

.animate-pulse-custom {
    animation: pulse 2s infinite;
}

/* Custom scrollbar for search results */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Gradient backgrounds */
.gradient-bg {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
}

.gradient-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.gradient-warning {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
}

/* Button hover effects */
.btn-hover-effect {
    transition: all 0.3s ease;
}

.btn-hover-effect:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

/* Card shadow effects */
.card-shadow {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.3s ease;
}

.card-shadow:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Loading spinner */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Status messages */
.status-success {
    color: #28a745;
    font-weight: 600;
}

.status-error {
    color: #dc3545;
    font-weight: 600;
}

.status-info {
    color: #007bff;
    font-weight: 600;
}

/* Mobile responsiveness */
@media (max-width: 640px) {
    .mobile-hidden {
        display: none;
    }
    
    .mobile-full {
        width: 100%;
    }
    
    .mobile-text-sm {
        font-size: 0.875rem;
    }

    /* Modal spacing tweaks on very small screens */
    .modal-panel { border-radius: 0.75rem; }
}

/* Focus states for accessibility */
.focus-ring:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Custom badges */
.badge-primary {
    background-color: #007bff;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-success {
    background-color: #28a745;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-warning {
    background-color: #ffc107;
    color: #333;
    padding: 0.25rem 0.5rem;
    border-radius: 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Modal helpers */
.modal-overlay { display: none; }
.modal-overlay.flex { display: flex; }

/* Use dynamic viewport for mobile toolbars; fallback to 85vh for older browsers */
.modal-max-h { max-height: 85vh; }
@supports (max-height: 90dvh) {
    .modal-max-h { max-height: 90dvh; }
}

.modal-body img { height: auto; max-width: 100%; }
.modal-pagination { row-gap: 0.5rem; }

/* Long names inside version cards should wrap nicely */
.version-option h4 { word-break: break-word; overflow-wrap: anywhere; }

/* Optional helper to compact vertical spacing when needed */
.compact-space { margin-bottom: 0.25rem !important; }
