/* ============================================
   Rockwell Pediatrics — Custom Styles
   ============================================ */

/* Base & Typography */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

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

#navbar.scrolled {
    background-color: rgba(7, 11, 21, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05), 0 4px 20px rgba(0, 0, 0, 0.3);
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #4fd39b, #2dc07e);
    border-radius: 1px;
    transition: width 0.3s ease, left 0.3s ease;
}

.nav-link:hover::after {
    width: 60%;
    left: 20%;
}

/* ============================================
   Hero Animations
   ============================================ */
@keyframes float {
    0%, 100% { transform: translateY(0px) scale(1); }
    50% { transform: translateY(-20px) scale(1.02); }
}

@keyframes float-slow {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(2deg); }
}

@keyframes float-reverse {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(12px); }
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

.hero-orb {
    animation: pulse-glow 6s ease-in-out infinite;
}

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

.hero-float {
    animation: float 4s ease-in-out infinite;
}

.float-1 { animation-delay: 0s; animation-duration: 5s; }
.float-2 { animation-delay: 1s; animation-duration: 4s; }
.float-3 { animation-delay: 2s; animation-duration: 6s; }
.float-4 { animation-delay: 0.5s; animation-duration: 3.5s; }

/* Hero entrance */
.hero-badge {
    animation: fadeInUp 0.8s ease forwards;
    opacity: 0;
}

.hero-title {
    animation: fadeInUp 0.8s ease 0.15s forwards;
    opacity: 0;
}

.hero-subtitle {
    animation: fadeInUp 0.8s ease 0.3s forwards;
    opacity: 0;
}

.hero-ctas {
    animation: fadeInUp 0.8s ease 0.45s forwards;
    opacity: 0;
}

.hero-trust {
    animation: fadeInUp 0.8s ease 0.6s forwards;
    opacity: 0;
}

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

/* ============================================
   Section Headers
   ============================================ */
.section-tag {
    animation: fadeInUp 0.6s ease forwards;
}

.section-title {
    animation: fadeInUp 0.6s ease 0.1s forwards;
    opacity: 0;
}

.section-desc {
    animation: fadeInUp 0.6s ease 0.2s forwards;
    opacity: 0;
}

/* ============================================
   Services Grid
   ============================================ */
.services-grid {
    animation: fadeInUp 0.6s ease forwards;
}

.service-card {
    opacity: 0;
    transform: translateY(20px);
}

.service-card.revealed {
    animation: cardReveal 0.5s ease forwards;
}

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

/* ============================================
   About Section
   ============================================ */
.about-image-order {
    opacity: 0;
    transform: translateX(-30px);
}

.about-image-order.revealed {
    animation: slideInLeft 0.7s ease forwards;
}

.about-content {
    opacity: 0;
    transform: translateX(30px);
}

.about-content.revealed {
    animation: slideInRight 0.7s ease forwards;
}

@keyframes slideInLeft {
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
    to { opacity: 1; transform: translateX(0); }
}

.about-stat-card {
    animation: float-slow 5s ease-in-out infinite;
}

/* ============================================
   New Patients Steps
   ============================================ */
.patients-step {
    opacity: 0;
    transform: translateY(20px);
}

.patients-step.revealed {
    animation: cardReveal 0.5s ease forwards;
}

/* ============================================
   Contact Form
   ============================================ */
.form-input {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-input:focus {
    border-color: rgba(45, 192, 126, 0.5) !important;
    box-shadow: 0 0 0 4px rgba(45, 192, 126, 0.1) !important;
}

.form-input::placeholder {
    color: rgba(129, 145, 185, 0.6);
}

.form-input:invalid:not(:placeholder-shown) {
    border-color: rgba(239, 68, 68, 0.5);
}

.form-submit {
    position: relative;
    overflow: hidden;
}

.form-submit::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.5s ease;
}

.form-submit:hover::before {
    left: 100%;
}

/* ============================================
   Footer
   ============================================ */
.footer-grid {
    animation: fadeInUp 0.6s ease forwards;
}

/* ============================================
   Mobile Menu
   ============================================ */
#mobile-menu {
    animation: mobileMenuIn 0.3s ease forwards;
}

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

.mobile-link {
    display: block;
    border-radius: 0.75rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

/* ============================================
   Scroll Reveal (Progressive Enhancement)
   ============================================ */
@media (prefers-reduced-motion: no-preference) {
    .reveal-on-scroll {
        opacity: 0;
        transform: translateY(24px);
        transition: opacity 0.6s ease, transform 0.6s ease;
    }
    
    .reveal-on-scroll.revealed {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Default visible state for reduced motion / no-JS */
@media (prefers-reduced-motion: reduce) {
    .reveal-on-scroll,
    .service-card,
    .patients-step,
    .about-image-order,
    .about-content {
        opacity: 1;
        transform: none;
    }
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 768px) {
    .about-image-order {
        order: -1;
    }
}

/* ============================================
   Utility & Misc
   ============================================ */
::selection {
    background-color: rgba(45, 192, 126, 0.3);
    color: #f0f4f9;
}

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

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

::-webkit-scrollbar-thumb {
    background: rgba(45, 192, 126, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(45, 192, 126, 0.5);
}
