/* === Custom Styles for Coleoptera Asia === */

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

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f5efe0;
}
::-webkit-scrollbar-thumb {
    background: #c9a84c;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #b8933a;
}

/* Selection styling */
::selection {
    background: #c9a84c;
    color: #0a1410;
}

/* Reveal on scroll */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal-on-scroll.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Species card hover effect */
.species-card {
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s ease;
}

/* Gallery items */
.gallery-item {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.gallery-item:hover {
    transform: translateY(-4px);
}

/* Fun facts carousel */
.fun-fact {
    transition: opacity 0.5s ease;
}
.fun-fact.active {
    display: block;
    animation: fadeInUp 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fact dots */
.fact-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #d1d5db;
    cursor: pointer;
    transition: all 0.3s ease;
}
.fact-dot.active {
    background: #c9a84c;
    transform: scale(1.3);
    box-shadow: 0 0 8px rgba(201, 168, 76, 0.5);
}

/* Anatomy parts hover */
.anatomy-part {
    transition: filter 0.3s ease, opacity 0.3s ease;
    cursor: pointer;
}
.anatomy-part:hover {
    filter: brightness(1.4) drop-shadow(0 0 6px rgba(201, 168, 76, 0.6));
}

/* Wing animation */
.wing-left,
.wing-right {
    transition: transform 0.5s ease;
}
.antenna-left,
.antenna-right {
    transition: transform 0.4s ease;
    animation: antennaWave 3s ease-in-out infinite;
}
.antenna-right {
    animation-delay: 0.5s;
}
@keyframes antennaWave {
    0%, 100% { transform: rotate(0deg); }
    30% { transform: rotate(-5deg); }
    60% { transform: rotate(3deg); }
}

/* Horn subtle animation */
.horn-left,
.horn-right {
    transition: transform 0.3s ease;
}

/* Particle animations */
.particle {
    will-change: transform, opacity;
}

/* Nav link active state */
.nav-link.active {
    color: #c9a84c;
    background: rgba(201, 168, 76, 0.1);
    font-weight: 600;
}

/* Mobile menu transition */
#mobile-menu {
    transition: max-height 0.4s ease, opacity 0.3s ease;
    max-height: 0;
    overflow: hidden;
}
#mobile-menu.open {
    max-height: 400px;
}

/* Print styles */
@media print {
    nav, #mobile-menu-btn, #mobile-menu, .gallery-item::after {
        display: none !important;
    }
    body {
        background: white;
        color: black;
    }
    .bg-forest-dark {
        background: #1a1a1a !important;
    }
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .species-card .text-xs {
        font-size: 0.65rem;
    }
    #fun-facts-carousel {
        padding: 1.5rem;
        min-height: 180px;
    }
    .fun-fact p {
        font-size: 1rem;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .reveal-on-scroll {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* Lightbox modal */
#lightbox-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
}
#lightbox-modal.open {
    display: flex;
}
#lightbox-modal img {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: 12px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
}

/* Focus visible styles for accessibility */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #c9a84c;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Smooth underline for links */
.nav-link {
    position: relative;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 60%;
    height: 2px;
    background: #c9a84c;
    transition: transform 0.3s ease;
    border-radius: 2px;
}
.nav-link:hover::after,
.nav-link.active::after {
    transform: translateX(-50%) scaleX(1);
}