/* Enhanced styles with Berry Computer branding and celebration effects */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

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

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #FF6B6B, #10b981);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #FF9F9F, #059669);
}

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

@keyframes confetti {
    0% { 
        transform: translateY(0) rotate(0deg) scale(1); 
        opacity: 1; 
    }
    50% { 
        transform: translateY(-50px) rotate(180deg) scale(1.2); 
        opacity: 0.8; 
    }
    100% { 
        transform: translateY(-100px) rotate(360deg) scale(0.8); 
        opacity: 0; 
    }
}

@keyframes shimmer {
    0% { 
        background-position: -200px 0; 
    }
    100% { 
        background-position: 200px 0; 
    }
}

@keyframes pulse-slow {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1);
    }
    50% { 
        opacity: 0.8; 
        transform: scale(1.05);
    }
}

@keyframes bounce-slow {
    0%, 100% { 
        transform: translateY(0); 
    }
    50% { 
        transform: translateY(-10px); 
    }
}

/* Celebration confetti animation */
.animate-confetti {
    animation: confetti 3s ease-out infinite;
    animation-delay: var(--delay, 0s);
}

.animate-confetti:nth-child(1) { --delay: 0s; left: 10%; }
.animate-confetti:nth-child(2) { --delay: 0.5s; left: 30%; }
.animate-confetti:nth-child(3) { --delay: 1s; left: 70%; }
.animate-confetti:nth-child(4) { --delay: 1.5s; left: 90%; }

/* Shimmer effect for title */
.animate-shimmer {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    background-size: 200px 100%;
    animation: shimmer 3s infinite;
}

/* Enhanced berry computer styles */
.bg-berry-gradient {
    background: linear-gradient(135deg, #FF6B6B 0%, #FF9F9F 50%, #10b981 100%);
}

.text-berry-gradient {
    background: linear-gradient(135deg, #FF6B6B, #10b981);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Custom backdrop blur for better browser support */
.backdrop-blur-sm {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Enhanced hover effects for cards */
.bg-white\/10:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    transition: all 0.3s ease;
}

.bg-white\/5:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
    transition: all 0.3s ease;
}

/* Loading button animation with Berry Computer styling */
button:disabled .animate-spin {
    display: inline-block;
    margin-right: 0.5rem;
}

button:disabled {
    position: relative;
    overflow: hidden;
}

button:disabled::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 107, 107, 0.2), transparent);
    animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Enhanced toast notification animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%) scale(0.8);
        opacity: 0;
    }
    to {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
    to {
        transform: translateX(100%) scale(0.8);
        opacity: 0;
    }
}

/* Toast animations with enhanced styling */
.fixed.top-4.right-4 {
    animation: slideInRight 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Progress bar animations */
.bg-gradient-to-r.from-rhea-green.to-emerald-500 {
    background-size: 200% 100%;
    animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Enhanced copy button feedback */
button[onclick*="copyToClipboard"]:active {
    transform: scale(0.95);
    background: linear-gradient(135deg, #FF6B6B, #10b981);
}

/* JSON syntax highlighting enhancement */
pre {
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Custom selection color with Berry Computer theming */
::selection {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.3), rgba(16, 185, 129, 0.3));
    color: white;
}

::-moz-selection {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.3), rgba(16, 185, 129, 0.3));
    color: white;
}

/* Responsive font sizing with enhanced mobile experience */
@media (max-width: 640px) {
    .text-4xl {
        font-size: 2rem;
        line-height: 2.25rem;
    }
    
    .text-6xl {
        font-size: 2.5rem;
        line-height: 1;
    }
    
    .grid-cols-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    
    /* Enhanced mobile padding */
    .p-6 {
        padding: 1rem;
    }
    
    .p-8 {
        padding: 1.5rem;
    }
}

/* Enhanced address display in search history */
.font-mono.text-blue-300 {
    word-break: break-all;
    line-height: 1.2;
}

/* Status indicator colors with enhanced visibility */
.text-rhea-orange {
    color: #f59e0b;
    text-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.text-rhea-yellow {
    color: #eab308;
    text-shadow: 0 0 10px rgba(234, 179, 8, 0.3);
}

.text-rhea-green {
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

/* Enhanced badge styling with Berry Computer branding */
.bg-rhea-green {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.bg-gradient-to-r.from-berry-red.to-berry-pink {
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

/* Enhanced grid responsiveness with better spacing */
@media (max-width: 768px) {
    .grid.grid-cols-2.md\:grid-cols-4 {
        gap: 0.75rem;
    }
    
    .flex.gap-4 {
        gap: 0.75rem;
    }
}

/* Improved truncated address styling */
.min-w-0 {
    min-width: 0;
}

/* Enhanced focus states for better accessibility */
.rounded-lg:focus-within {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3);
    transform: translateY(-1px);
}

/* Better contrast for small text */
.text-xs.text-blue-400 {
    opacity: 0.9;
}

/* Improved button hover states with Berry Computer theming */
.bg-blue-500\/20:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(255, 107, 107, 0.1));
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.bg-green-500\/20:hover {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.3), rgba(16, 185, 129, 0.2));
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Enhanced card borders with Berry Computer accent */
.border-white\/20 {
    border-color: rgba(255, 255, 255, 0.2);
}

.border-white\/10 {
    border-color: rgba(255, 255, 255, 0.1);
}

.border-berry-red\/30 {
    border-color: rgba(255, 107, 107, 0.3);
}

/* Leaderboard styling */
.text-rhea-yellow {
    color: #fbbf24;
    text-shadow: 0 0 8px rgba(251, 191, 36, 0.4);
}

/* Social sharing button enhancements */
button.bg-blue-500:hover {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(59, 130, 246, 0.3);
}

button.bg-purple-600:hover {
    background: linear-gradient(135deg, #9333ea, #7c3aed);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(147, 51, 234, 0.3);
}

/* Enhanced shadow effects */
.shadow-2xl {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

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

/* Celebration result styling */
.bg-gradient-to-r.from-rhea-green\/30.to-rhea-green\/20 {
    border: 2px solid rgba(16, 185, 129, 0.5);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
}

/* Enhanced input styling */
input:focus {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3), 0 0 20px rgba(16, 185, 129, 0.1);
    transform: translateY(-1px);
}

/* Footer styling */
footer {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.1), rgba(16, 185, 129, 0.1));
}