/* Custom styles for orthopedic research aggregator with TailwindCSS */

/* Enhanced animations for modern UI */
@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

@keyframes slideUp {
    from { 
        opacity: 0; 
        transform: translateY(30px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

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

/* Smooth transitions and animations */
.animate-fade-in {
    animation: fadeIn 0.8s ease-out;
}

.animate-slide-up {
    animation: slideUp 0.8s ease-out 0.2s both;
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Custom scrollbar for dark mode */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    @apply bg-slate-100 dark:bg-slate-800;
}

::-webkit-scrollbar-thumb {
    @apply bg-slate-300 dark:bg-slate-600 rounded-full;
}

::-webkit-scrollbar-thumb:hover {
    @apply bg-slate-400 dark:bg-slate-500;
}

/* Enhanced focus states */
.focus\:ring-primary:focus {
    --tw-ring-color: rgb(59 130 246 / 0.5);
}

/* Smooth category toggle animations */
.category-content {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Loading spinner animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Glass morphism effects */
.glass {
    backdrop-filter: blur(16px) saturate(180%);
    background-color: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.125);
}

.glass-dark {
    backdrop-filter: blur(16px) saturate(180%);
    background-color: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.125);
}

/* Enhanced button states */
.btn-modern {
    @apply transition-all duration-300 ease-in-out;
}

.btn-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.btn-modern:active {
    transform: translateY(0);
}

/* Loading states with Tailwind */
.animate-spin {
    animation: spin 1s linear infinite;
}

/* Improved typography hierarchy */
.text-hierarchy-1 {
    @apply text-4xl font-semibold tracking-tight;
}

.text-hierarchy-2 {
    @apply text-xl font-medium;
}

.text-hierarchy-3 {
    @apply text-base font-semibold leading-snug;
}

.text-muted {
    @apply text-slate-500 dark:text-slate-400;
}

/* Responsive grid improvements */
@media (max-width: 640px) {
    .grid-responsive {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    .grid-responsive {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1025px) {
    .grid-responsive {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Print optimizations for modern design */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        @apply text-slate-900 bg-white;
    }
    
    .article-card {
        @apply border border-slate-300 mb-4;
        box-shadow: none;
        break-inside: avoid;
    }
    
    a[href^="http"]:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
}
