/* VATdb - Custom Styles */

/* CSS Custom Properties */
:root {
    --color-primary: #22c55e;
    --color-accent: #06b6d4;
    --gradient-primary: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    --gradient-horizontal: linear-gradient(90deg, var(--color-primary), var(--color-accent));
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom selection color */
::selection {
    background-color: color-mix(in srgb, var(--color-primary) 20%, transparent);
    color: inherit;
}

/* Animated gradient background for hero */
@keyframes gradient-shift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.gradient-animate {
    background-size: 200% 200%;
    animation: gradient-shift 15s ease infinite;
}

/* Floating animation for decorative elements */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

.float-animation {
    animation: float 6s ease-in-out infinite;
}

/* Pulse animation for status indicator */
@keyframes pulse-ring {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* Code block styling enhancements */
pre {
    font-family: 'JetBrains Mono', 'Fira Code', 'Monaco', 'Consolas', monospace;
    line-height: 1.6;
}

pre code {
    font-family: inherit;
}

/* Custom scrollbar for code blocks */
pre::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}

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

pre::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

pre::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Input focus enhancement */
input:focus {
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-primary) 10%, transparent);
}

/* Button press effect */
button:active:not(:disabled) {
    transform: scale(0.98);
}

/* Card hover lift effect */
.feature-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
}

/* Smooth transition for navigation */
nav {
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

nav.scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Gradient text animation */
@keyframes text-shimmer {
    0% {
        background-position: -200% center;
    }
    100% {
        background-position: 200% center;
    }
}

.shimmer-text {
    background: linear-gradient(
        90deg,
        var(--color-primary) 0%,
        var(--color-accent) 25%,
        var(--color-primary) 50%,
        var(--color-accent) 75%,
        var(--color-primary) 100%
    );
    background-size: 200% auto;
    animation: text-shimmer 3s linear infinite;
    -webkit-background-clip: text;
    background-clip: text;
}

/* Pricing card popular badge */
.pricing-popular::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: var(--gradient-primary);
    border-radius: 1rem;
    z-index: -1;
}

/* Testimonial card hover effect */
.testimonial-card {
    position: relative;
    overflow: hidden;
}

.testimonial-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient-horizontal);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.testimonial-card:hover::before {
    transform: scaleX(1);
}

/* Response area animation */
#response-area {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading spinner custom animation */
@keyframes spin-slow {
    to {
        transform: rotate(360deg);
    }
}

.spin-slow {
    animation: spin-slow 1.5s linear infinite;
}

/* Flag marquee animations */
.flag-marquee {
    overflow: hidden;
    width: 100%;
}

.flag-marquee-track {
    display: flex;
    gap: 1rem;
    width: max-content;
}

.flag-marquee-left {
    animation: marquee-left 30s linear infinite;
}

.flag-marquee-right {
    animation: marquee-right 30s linear infinite;
}

.flag-item {
    font-size: 2.5rem;
    flex-shrink: 0;
}

@keyframes marquee-left {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

@keyframes marquee-right {
    from { transform: translateX(-50%); }
    to { transform: translateX(0); }
}

/* Feature icon bounce on hover */
.feature-icon {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.group:hover .feature-icon {
    transform: scale(1.1) rotate(5deg);
}

/* Tab underline animation */
.code-tab {
    position: relative;
}

.code-tab::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--gradient-horizontal);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.code-tab[data-active="true"]::after {
    transform: scaleX(1);
}

/* Mobile menu animation */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.mobile-menu {
    animation: slideIn 0.3s ease;
}

/* Grid pattern background */
.grid-pattern {
    background-image:
        linear-gradient(to right, rgba(0, 0, 0, 0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
}

/* Glow effect for buttons */
.glow-button {
    position: relative;
    overflow: hidden;
}

.glow-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120%;
    height: 120%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.5s ease;
}

.glow-button:hover::before {
    transform: translate(-50%, -50%) scale(1);
}

/* Smooth image loading */
img {
    opacity: 1;
    transition: opacity 0.3s ease;
}

img[data-loading="true"] {
    opacity: 0;
}

/* Focus visible for accessibility */
:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* Print styles */
@media print {
    nav,
    footer,
    #demo,
    .no-print {
        display: none !important;
    }

    body {
        font-size: 12pt;
    }

    a {
        text-decoration: underline;
    }
}

/* Dark mode preparation (uncomment when needed) */
/*
@media (prefers-color-scheme: dark) {
    body {
        background-color: #0f172a;
        color: #e2e8f0;
    }
}
*/

/* Custom utility classes */
.text-balance {
    text-wrap: balance;
}

.bg-blur {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Noise texture overlay */
.noise-overlay {
    position: relative;
}

.noise-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.02;
    pointer-events: none;
}

/* Glassmorphism effect */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Gradient border */
.gradient-border {
    position: relative;
    background: white;
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 2px;
    background: var(--gradient-primary);
    border-radius: inherit;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: xor;
    -webkit-mask-composite: xor;
}

/* Subtle shadow layers */
.shadow-layered {
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.02),
        0 2px 4px rgba(0, 0, 0, 0.02),
        0 4px 8px rgba(0, 0, 0, 0.02),
        0 8px 16px rgba(0, 0, 0, 0.02),
        0 16px 32px rgba(0, 0, 0, 0.02);
}

/* Animated underline for links */
.link-underline {
    position: relative;
    text-decoration: none;
}

.link-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.link-underline:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Code block wrapper with copy button (moved from base.html) */
.code-wrapper {
    position: relative;
}

.copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 8px;
    font-size: 12px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
}

.copy-btn:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

.copy-btn.copied {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

/* Inline code copy button */
.inline-code-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.inline-copy-btn {
    padding: 2px 6px;
    font-size: 10px;
    background: #e5e7eb;
    border: none;
    border-radius: 3px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
}

.inline-copy-btn:hover {
    background: #d1d5db;
    color: #374151;
}

.inline-copy-btn.copied {
    background: var(--color-primary);
    color: #fff;
}

/* Override prose code styling for dark theme */
.prose pre {
    background: #1e1e1e !important;
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
}

.prose code {
    color: #e5e7eb;
    font-size: 0.875rem;
}

.prose :not(pre) > code {
    background: #f3f4f6;
    color: #1f2937;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.875em;
}

/* Remove backticks added by Tailwind typography plugin */
.prose :not(pre) > code::before,
.prose :not(pre) > code::after {
    content: none;
}
