/* === Custom Styles for Medicine Plus Pharmacy === */

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

body {
    overflow-x: hidden;
}

/* === Hero Animations === */
.hero-eyebrow {
    animation: slideUp 0.8s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}

h1 {
    animation: slideUp 0.8s 0.15s ease forwards;
    opacity: 0;
    transform: translateY(25px);
}

.hero-eyebrow ~ * + p,
h1 + p {
    animation: slideUp 0.8s 0.3s ease forwards;
    opacity: 0;
    transform: translateY(25px);
}

h1 + p ~ .flex,
h1 + p {
    animation: slideUp 0.8s 0.3s ease forwards;
    opacity: 0;
    transform: translateY(25px);
}

/* Target the paragraph and buttons specifically */
h1 ~ p,
h1 ~ div {
    animation: slideUp 0.8s 0.3s ease forwards;
    opacity: 0;
    transform: translateY(25px);
}

h1 ~ div ~ div {
    animation: slideUp 0.8s 0.45s ease forwards;
    opacity: 0;
    transform: translateY(25px);
}

@keyframes slideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scroll indicator animation */
@keyframes scrollLine {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(160%); }
}

.animate-scroll-line {
    animation: scrollLine 1.5s ease-in-out infinite;
}

/* === Section Animations (Intersection Observer) === */
.section-eyebrow,
.section-title,
.section-desc,
.service-card,
.why-row {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.section-eyebrow.visible,
.section-title.visible,
.section-desc.visible {
    opacity: 1;
    transform: translateY(0);
}

.service-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.service-card:nth-child(1) { transition-delay: 0.05s; }
.service-card:nth-child(2) { transition-delay: 0.1s; }
.service-card:nth-child(3) { transition-delay: 0.15s; }
.service-card:nth-child(4) { transition-delay: 0.2s; }
.service-card:nth-child(5) { transition-delay: 0.25s; }
.service-card:nth-child(6) { transition-delay: 0.3s; }

.why-row.visible {
    opacity: 1;
    transform: translateY(0);
}

.why-row:nth-child(1) { transition-delay: 0.05s; }
.why-row:nth-child(2) { transition-delay: 0.1s; }
.why-row:nth-child(3) { transition-delay: 0.15s; }
.why-row:nth-child(4) { transition-delay: 0.2s; }

/* === Navbar Scroll State === */
nav.scrolled {
    background: rgba(26, 10, 22, 0.92);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(74, 25, 66, 0.5);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

/* === Mobile Menu === */
.mobile-link {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.4s ease, transform 0.4s 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; }
#mobileMenu.open .mobile-link:nth-child(5) { transition-delay: 0.25s; }

/* === Hamburger Animation === */
.menu-line {
    transition: all 0.3s ease;
}

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

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

#menuBtn.active .menu-line:nth-child(3) {
    transform: rotate(-45deg) translate(3px, -3px);
    width: 1.25rem;
}

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

::-webkit-scrollbar-track {
    background: #1A0A16;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #7A2D58;
}

/* === Selection === */
::selection {
    background: rgba(200, 149, 108, 0.3);
    color: #F9F0F7;
}

/* === Focus Visible === */
:focus-visible {
    outline: 2px solid #C8956C;
    outline-offset: 2px;
}

/* === Image hover effects === */
.overflow-hidden {
    will-change: transform;
}

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

    .section-eyebrow,
    .section-title,
    .section-desc,
    .service-card,
    .why-row {
        opacity: 1;
        transform: none;
    }
}

/* === Tablet === */
@media (max-width: 767px) {
    #hero {
        min-height: auto;
        padding: 8rem 0 4rem;
    }

    h1 {
        font-size: 2.75rem !important;
    }

    .lg\:h-\[600px\] {
        h-72;
    }

    .overflow-hidden img {
        height: 400px;
    }
}

/* === Large Screens === */
@media (min-width: 1280px) {
    .service-card {
        padding: 2rem;
    }
}
