/* ========================================
   Chavas Billiards & Micheladas
   Custom Styles & Animations
   ======================================== */

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

body {
    overflow-x: hidden;
}

/* ========================================
   Navbar
   ======================================== */
#navbar {
    background: transparent;
    transition: background 0.4s ease, box-shadow 0.4s ease, padding 0.4s ease;
}

#navbar.scrolled {
    background: rgba(253, 252, 248, 0.95);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 20px rgba(46, 79, 53, 0.08);
}

.nav-logo-text {
    transition: color 0.4s ease;
}

#navbar:not(.scrolled) .nav-logo-text {
    color: #fdfcf8;
}

#navbar.scrolled .nav-link {
    color: #2e4f35 !important;
}

/* ========================================
   Hero Animations
   ======================================== */
.hero-orb {
    animation: float 8s ease-in-out infinite;
}

.orb-1 {
    animation-delay: 0s;
}

.orb-2 {
    animation-delay: -2.5s;
}

.orb-3 {
    animation-delay: -5s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(20px, -20px) scale(1.05); }
    66% { transform: translate(-15px, 15px) scale(0.95); }
}

.hero-ball {
    animation: floatBall 6s ease-in-out infinite;
}

.ball-1 {
    animation-delay: 0s;
}

.ball-2 {
    animation-delay: -1.5s;
}

.ball-3 {
    animation-delay: -3s;
}

.ball-4 {
    animation-delay: -4.5s;
}

@keyframes floatBall {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(10px, -15px) rotate(5deg); }
    50% { transform: translate(-5px, -25px) rotate(-3deg); }
    75% { transform: translate(-15px, -10px) rotate(3deg); }
}

.hero-headline {
    animation: fadeInUp 1s ease-out forwards;
}

.hero-subtitle {
    animation: fadeInUp 1s ease-out 0.2s forwards;
    opacity: 0;
}

.hero-ctas {
    animation: fadeInUp 1s ease-out 0.4s forwards;
    opacity: 0;
}

.hero-scroll {
    animation: fadeInUp 1s ease-out 0.6s forwards;
    opacity: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Scroll Reveal Animations
   (Progressive Enhancement: content visible without JS)
   ======================================== */
@media (prefers-reduced-motion: no-preference) {
    .reveal-up,
    .reveal-left,
    .reveal-right {
        opacity: 1;
        transform: none;
    }
    
    .reveal-up.animated,
    .reveal-left.animated,
    .reveal-right.animated {
        transition: opacity 0.7s ease-out, transform 0.7s ease-out;
    }
}

/* Default visible state for content (no JS fallback) */
.reveal-up,
.reveal-left,
.reveal-right {
    opacity: 1;
    transform: none;
}

/* ========================================
   Mobile Menu
   ======================================== */
.mobile-link {
    transition: color 0.2s ease, transform 0.2s ease;
}

.mobile-link:hover {
    color: #2e4f35;
    transform: translateX(4px);
}

#mobile-menu {
    animation: slideDown 0.3s ease-out;
}

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

/* ========================================
   Card Hover Effects
   ======================================== */
.group:hover .w-16 {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* ========================================
   Custom Scrollbar
   ======================================== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #faf8f0;
}

::-webkit-scrollbar-thumb {
    background: #9cc5a8;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #6fa07a;
}

/* ========================================
   Selection Color
   ======================================== */
::selection {
    background: #c5dfcc;
    color: #1f3524;
}

/* ========================================
   Image Hover
   ======================================== */
.rounded-3xl.overflow-hidden {
    transition: transform 0.5s ease;
}

.rounded-3xl.overflow-hidden:hover {
    transform: scale(1.01);
}

/* ========================================
   Button Focus States
   ======================================== */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #4d8058;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ========================================
   Utility: Reduced Motion
   ======================================== */
@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;
    }
}
