/* ============================================
   iCure Pharmacy — Custom Styles
   ============================================ */

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

/* Selection color */
::selection {
    background: rgba(201, 168, 76, 0.3);
    color: #faf8f4;
}

/* ============================================
   Scroll Reveal Animations
   Progressive enhancement — only active when
   JS enables the .revealed class.
   ============================================ */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(30px);
        transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                    transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

    .reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }

    /* Staggered delays for grid items */
    .reveal:nth-child(1) { transition-delay: 0.05s; }
    .reveal:nth-child(2) { transition-delay: 0.12s; }
    .reveal:nth-child(3) { transition-delay: 0.19s; }
    .reveal:nth-child(4) { transition-delay: 0.26s; }
    .reveal:nth-child(5) { transition-delay: 0.33s; }
    .reveal:nth-child(6) { transition-delay: 0.40s; }
}

/* ============================================
   Hero Animations
   ============================================ */
@media (prefers-reduced-motion: no-preference) {
    .hero-content {
        animation: heroFadeIn 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    }

    .hero-image-wrapper {
        animation: heroImageIn 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s both;
    }
}

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

@keyframes heroImageIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

#navbar.scrolled {
    background: rgba(13, 13, 13, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* ============================================
   Mobile Menu
   ============================================ */
.mobile-link {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, color 0.3s ease;
}

#mobileMenu.open .mobile-link {
    opacity: 1;
    transform: translateY(0);
}

#mobileMenu.open .mobile-link:nth-child(1) { transition-delay: 0.05s; }
#mobileMenu.open .mobile-link:nth-child(2) { transition-delay: 0.1s; }
#mobileMenu.open .mobile-link:nth-child(3) { transition-delay: 0.15s; }
#mobileMenu.open .mobile-link:nth-child(4) { transition-delay: 0.2s; }

/* Hamburger animation */
.menu-line {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

#menuBtn.active .menu-line:nth-child(1) {
    transform: translateY(4px) rotate(45deg);
}

#menuBtn.active .menu-line:nth-child(2) {
    opacity: 0;
}

#menuBtn.active .menu-line:nth-child(3) {
    transform: translateY(-4px) rotate(-45deg);
    width: 20px;
}

/* ============================================
   Gold accent shimmer on hover
   ============================================ */
.gold-shimmer {
    position: relative;
    overflow: hidden;
}

.gold-shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(201, 168, 76, 0.08),
        transparent
    );
    transition: left 0.5s ease;
}

.gold-shimmer:hover::after {
    left: 100%;
}

/* ============================================
   Image hover effects
   ============================================ */
.rounded-2xl.overflow-hidden img {
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.rounded-2xl.overflow-hidden:hover img {
    transform: scale(1.03);
}

/* ============================================
   Accessibility: 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;
    }
}

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

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

::-webkit-scrollbar-track {
    background: #0d0d0d;
}

::-webkit-scrollbar-thumb {
    background: #1a3f1d;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #235426;
}
