/* Custom CSS for JSON Beautifier */

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

/* JSON syntax highlighting colors */
.language-json .text-primary {
    color: hsl(var(--p));
}

.language-json .text-secondary {
    color: hsl(var(--s));
}

.language-json .text-accent {
    color: hsl(var(--a));
}

.language-json .text-info {
    color: hsl(var(--in));
}

.language-json .text-success {
    color: hsl(var(--su));
}

.language-json .text-warning {
    color: hsl(var(--wa));
}

.language-json .text-error {
    color: hsl(var(--er));
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: hsl(var(--b3));
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: hsl(var(--n));
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: hsl(var(--nf));
}

/* Drag and drop zone animation */
#drop-zone {
    transition: all 0.3s ease;
}

#drop-zone:hover {
    transform: scale(1.02);
}

#drop-zone.drag-over {
    border-color: hsl(var(--p));
    background-color: hsl(var(--p) / 0.1);
    transform: scale(1.05);
}

/* Textarea focus styles */
textarea:focus {
    outline: none;
    box-shadow: 0 0 0 3px hsl(var(--p) / 0.2);
}

/* Toast animation */
.toast {
    animation: slideIn 0.3s ease-out;
}

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

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

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

/* Code block styling */
pre {
    position: relative;
}

pre code {
    display: block;
    padding: 1rem;
    overflow-x: auto;
}

/* Stats animation */
.stat-value {
    transition: all 0.3s ease;
}

/* Button hover animations */
.btn {
    transition: all 0.2s ease;
}

.btn:active {
    transform: scale(0.95);
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .hero h1 {
        font-size: 2.5rem;
    }
}

@media (max-width: 640px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
}

/* Ad container styles */
.ad-container {
    overflow: hidden;
    text-align: center;
    margin: 0 auto;
}

.ad-container .adsbygoogle {
    margin: 0 auto;
}

.header-ad {
    max-width: 728px;
    margin: 0 auto;
}

.content-ad,
.before-faq-ad {
    max-width: 728px;
}

/* Mobile sticky footer ad — add body padding so content isn't hidden */
@media (max-width: 1023px) {
    body {
        padding-bottom: 60px;
    }
}

.mobile-sticky-ad {
    transition: transform 0.3s ease;
}

/* Hide mobile sticky ad when user scrolls to actual footer */
.mobile-sticky-ad.hidden-by-footer {
    transform: translateY(100%);
}

/* Print styles */
@media print {
    .navbar,
    .footer,
    .adsbygoogle,
    .ad-container,
    .mobile-sticky-ad,
    #drop-zone,
    .btn {
        display: none !important;
    }
    
    #json-output {
        border: 1px solid #000;
        page-break-inside: avoid;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn {
        border-width: 2px;
    }
}

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