/* Custom CSS for Funny Cats Gallery */

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

/* Gallery card hover effect */
.cat-item {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cat-item:hover {
    transform: translateY(-5px);
}

/* Image lazy loading placeholder */
img[loading="lazy"] {
    background: linear-gradient(110deg, #ececec 8%, #f5f5f5 18%, #ececec 33%);
    background-size: 200% 100%;
    animation: shimmer 1.5s linear infinite;
}

img[loading="lazy"].loaded {
    animation: none;
    background: none;
}

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

/* Category filter buttons */
.category-btn {
    transition: all 0.2s ease;
}

.category-btn.active {
    background-color: hsl(var(--p));
    color: hsl(var(--pc));
}

/* Modal backdrop blur */
.modal-box {
    backdrop-filter: blur(10px);
}

/* Like button animation */
.btn-like {
    transition: transform 0.2s ease;
}

.btn-like:active {
    transform: scale(1.2);
}

.btn-like.liked svg {
    fill: currentColor;
    animation: heartBeat 0.5s ease;
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    25% { transform: scale(1.2); }
    50% { transform: scale(1); }
    75% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Loading spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Ad container styling */
.adsbygoogle {
    display: block;
    text-align: center;
}

/* Mobile sticky footer ad spacing */
@media (max-width: 768px) {
    body {
        padding-bottom: 70px;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
}

/* Pinterest Save Button overlay */
.pinterest-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cat-item:hover .pinterest-overlay {
    opacity: 1;
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 100;
    animation: slideIn 0.3s ease;
}

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

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

::-webkit-scrollbar-track {
    background: hsl(var(--b2));
}

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

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

/* Image grid masonry effect */
@media (min-width: 640px) {
    #gallery {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        grid-auto-rows: 10px;
    }
    
    .cat-item {
        grid-row: span 35;
    }
    
    .cat-item:nth-child(3n) {
        grid-row: span 40;
    }
}

/* Print styles */
@media print {
    .adsbygoogle,
    nav,
    .btn,
    footer {
        display: none !important;
    }
    
    .cat-item {
        break-inside: avoid;
    }
}

/* Accessibility - Focus styles */
button:focus-visible,
a:focus-visible {
    outline: 2px solid hsl(var(--p));
    outline-offset: 2px;
}

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