/* ===================================
   UCSF Adult Congenital Heart Disease Clinic
   Custom Styles
=================================== */

/* Base Styles */
html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

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

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

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

/* ===================================
   Navigation
=================================== */

/* Navbar scroll state */
#navbar.scrolled {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(30, 30, 30, 0.1);
}

#navbar.scrolled .nav-text {
    color: #1E1E1E;
}

#navbar.scrolled .nav-icon {
    color: #1E1E1E;
}

#navbar.scrolled .mobile-menu-line {
    background: #1E1E1E;
}

/* Mobile menu */
.mobile-menu-line {
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.mobile-menu-btn.active .mobile-menu-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active .mobile-menu-line:nth-child(2) {
    opacity: 0;
    transform: translateX(-10px);
}

.mobile-menu-btn.active .mobile-menu-line:nth-child(3) {
    width: 24px;
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ===================================
   Hero Section
=================================== */

/* Hero entrance animations */
.hero-eyebrow {
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 0.2s;
    opacity: 0;
}

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

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

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

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

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

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

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

/* ===================================
   Section Headers
=================================== */

.section-eyebrow {
    animation: fadeIn 0.6s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ===================================
   Service Cards
=================================== */

.service-card {
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #FF6F61, #FF8C7A);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s ease;
}

.service-card:hover::before {
    transform: scaleX(1);
}

/* ===================================
   Scroll Reveal Animations
=================================== */

/* Default state - visible for accessibility */
.reveal-up,
.reveal-left,
.reveal-right {
    opacity: 1;
    transform: none;
}

/* When JS adds the animated state (progressive enhancement) */
.reveal-up.animated,
.reveal-left.animated,
.reveal-right.animated {
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-up.animated {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left.animated {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right.animated {
    opacity: 1;
    transform: translateX(0);
}

/* Initial hidden state (only applied by JS) */
.js-enabled .reveal-up {
    opacity: 0;
    transform: translateY(40px);
}

.js-enabled .reveal-left {
    opacity: 0;
    transform: translateX(-40px);
}

.js-enabled .reveal-right {
    opacity: 0;
    transform: translateX(40px);
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .reveal-up,
    .reveal-left,
    .reveal-right {
        opacity: 1 !important;
        transform: none !important;
    }
    
    html {
        scroll-behavior: auto;
    }
    
    .scroll-line {
        animation: none;
        opacity: 0.5;
    }
    
    .hero-eyebrow,
    .hero-title,
    .hero-subtitle,
    .hero-ctas,
    .hero-trust {
        animation: none;
        opacity: 1;
    }
}

/* ===================================
   Form Styles
=================================== */

input:focus,
textarea:focus {
    border-color: #FF6F61 !important;
}

input::placeholder,
textarea::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

/* ===================================
   Responsive Adjustments
=================================== */

@media (max-width: 768px) {
    html {
        font-size: 15px;
    }
    
    .hero-title {
        font-size: 2.5rem !important;
    }
}

@media (max-width: 640px) {
    html {
        font-size: 14px;
    }
}
