/* Custom styles for enhanced visual 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: rgba(99, 102, 241, 0.6);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.8);
}

/* Animation for loading state */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Custom gradient text */
.bg-clip-text {
    -webkit-background-clip: text;
    background-clip: text;
}

/* Smooth transitions for interactive elements */
button, input {
    transition: all 0.2s ease-in-out;
}

/* Enhanced focus styles for accessibility */
input:focus, button:focus {
    outline: 2px solid rgba(16, 185, 129, 0.5);
    outline-offset: 2px;
}

/* Error state styles */
input.border-red-400 {
    border-color: rgba(248, 113, 113, 0.6) !important;
    background-color: rgba(248, 113, 113, 0.1);
}

input.border-red-400:focus {
    box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.3);
    outline: none;
}

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

/* Hover effects for cards */
.bg-white\/10:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.bg-white\/5:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

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

/* Enhanced button states */
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

button:hover:not(:disabled) {
    transform: translateY(-1px);
}

button:active:not(:disabled) {
    transform: translateY(0);
}

/* Responsive font sizing */
@media (max-width: 640px) {
    .text-4xl {
        font-size: 2.25rem;
        line-height: 2.5rem;
    }
    
    .text-6xl {
        font-size: 3rem;
        line-height: 1;
    }
}

/* Enhanced copy button feedback */
button[onclick*="copyToClipboard"]:active,
[onclick*="copyToClipboard"]:active {
    transform: scale(0.95);
}

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

/* Custom selection color */
::selection {
    background-color: rgba(99, 102, 241, 0.3);
    color: white;
}

::-moz-selection {
    background-color: rgba(99, 102, 241, 0.3);
    color: white;
}

/* Error message animations */
.text-red-300 {
    animation: slideInFromTop 0.3s ease-out;
}

@keyframes slideInFromTop {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced accessibility - high contrast mode support */
@media (prefers-contrast: high) {
    .bg-white\/10 {
        background-color: rgba(255, 255, 255, 0.2);
        border-color: rgba(255, 255, 255, 0.4);
    }
    
    .text-blue-200 {
        color: #ddd;
    }
    
    .text-blue-300 {
        color: #bbb;
    }
}

/* Enhanced mobile responsiveness */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .text-2xl {
        font-size: 1.5rem;
    }
    
    .text-3xl {
        font-size: 1.875rem;
    }
}

/* Loading state enhancements */
.loading-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

/* Enhanced hover states for interactive elements */
.cursor-pointer:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 0.375rem;
    padding: 0.125rem 0.25rem;
    margin: -0.125rem -0.25rem;
    transition: all 0.15s ease-in-out;
}

/* Code block styling improvements */
code {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 0.875em;
    line-height: 1.4;
}

/* Enhanced focus indicators for better accessibility */
button:focus-visible,
input:focus-visible {
    outline: 2px solid rgba(16, 185, 129, 0.8);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
}