/* ===== Custom Styles for Northern Michigan Heart Center ===== */

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

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #faf0fb;
}
::-webkit-scrollbar-thumb {
    background: #7B2D8B;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #6a2477;
}

/* Hero shapes animation */
.hero-shape {
    animation: float 8s ease-in-out infinite;
}

.shape-plum-1 {
    animation-delay: 0s;
}
.shape-amber-1 {
    animation-delay: -2s;
}
.shape-plum-2 {
    animation-delay: -4s;
}
.shape-amber-2 {
    animation-delay: -6s;
}
.shape-plum-3 {
    animation-delay: -1s;
}

@keyframes float {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-30px) scale(1.05); }
}

/* Scroll line animation */
.scroll-line {
    animation: scrollDown 1.5s ease-in-out infinite;
}

@keyframes scrollDown {
    0% { top: -16px; opacity: 0; }
    50% { opacity: 1; }
    100% { top: 40px; opacity: 0; }
}

/* Hero badge animation */
.hero-badge {
    animation: fadeInUp 0.8s ease-out both;
}

/* Hero text animations */
h1, h1 span {
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

/* Hero paragraph */
.hero p {
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

/* Hero buttons */
.hero a {
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

.hero .flex {
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

/* Hero stats */
.hero > div > div > div:last-child {
    animation: fadeInUp 0.8s ease-out 0.8s both;
}

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

/* Service cards animation */
.service-card {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out, box-shadow 0.4s ease, border-color 0.4s ease;
}

.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; }

/* Patient steps animation */
.patient-step {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out, background 0.3s ease;
}

.patient-step.visible {
    opacity: 1;
    transform: translateY(0);
}

.patient-step:nth-child(1) { transition-delay: 0.05s; }
.patient-step:nth-child(2) { transition-delay: 0.15s; }
.patient-step:nth-child(3) { transition-delay: 0.25s; }
.patient-step:nth-child(4) { transition-delay: 0.35s; }

/* Navbar scroll state */
.nav-scrolled {
    background: rgba(255, 255, 255, 0.97) !important;
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 20px rgba(123, 45, 139, 0.08);
}

.nav-scrolled .font-display,
.nav-scrolled .text-plum-700 {
    color: #561d61 !important;
}

.nav-scrolled .text-plum-500 {
    color: #7B2D8B !important;
}

.nav-scrolled a:not(.bg-plum-500) {
    color: #43174d !important;
}

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

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

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

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

#mobile-menu-btn.active .menu-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}
#mobile-menu-btn.active .menu-line:nth-child(2) {
    opacity: 0;
}
#mobile-menu-btn.active .menu-line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* About section images */
.about-img {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.about-img.visible {
    opacity: 1;
    transform: translateX(0);
}

.about-text {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.8s ease-out 0.2s, transform 0.8s ease-out 0.2s;
}

.about-text.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Contact form focus states */
input:focus,
select:focus,
textarea:focus {
    box-shadow: 0 0 0 3px rgba(123, 45, 139, 0.1);
}

/* Button ripple effect */
button, a {
    position: relative;
    overflow: hidden;
}

/* Selection color */
::selection {
    background: #7B2D8B;
    color: white;
}

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

/* Tablet adjustments */
@media (max-width: 768px) {
    #hero {
        min-height: auto;
        padding-top: 100px;
        padding-bottom: 60px;
    }

    .hero-shape {
        display: none;
    }

    .hero-shape.shape-plum-1,
    .hero-shape.shape-amber-1 {
        display: block;
        opacity: 0.08;
    }
}

/* Large desktop */
@media (min-width: 1280px) {
    .font-display {
        font-feature-settings: 'ss01', 'ss02';
    }
}
