/* ============================================
   Care Connect of Virginia — Custom Styles
   Classic & Elegant | Midnight Blue + Mint
   ============================================ */

/* Base */
*, *::before, *::after {
    box-sizing: border-box;
}

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

body {
    overflow-x: hidden;
}

::selection {
    background: rgba(64, 181, 164, 0.25);
    color: #E8EDF5;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: #0B1D3A;
}
::-webkit-scrollbar-thumb {
    background: rgba(64, 181, 164, 0.3);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(64, 181, 164, 0.5);
}

/* Reveal animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Navbar transition */
.nav-scrolled {
    background: rgba(7, 16, 32, 0.92) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-scrolled .fixed-top {
    backdrop-filter: blur(20px);
}

/* Mobile menu */
.mobile-menu-open {
    opacity: 1 !important;
    pointer-events: all !important;
}

/* Form inputs */
input:focus,
textarea:focus {
    outline: none;
}

/* Image hover effects */
img {
    display: block;
    max-width: 100%;
}

/* Button focus states */
button:focus-visible,
a:focus-visible {
    outline: 2px solid rgba(64, 181, 164, 0.6);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Smooth section transitions */
section {
    position: relative;
}

/* Subtle grain texture overlay on body */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.015;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* Hero image parallax feel */
#hero img {
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Card hover lift */
.group:hover {
    transform: translateY(-2px);
}

.group {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Mobile menu animation */
#mobileMenu {
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), pointer-events 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Link underline on hover */
a.hover-underline:hover {
    background-image: linear-gradient(rgba(64, 181, 164, 0.4), rgba(64, 181, 164, 0.4));
    background-position: bottom left;
    background-size: 100% 1px;
    background-repeat: no-repeat;
    background-size: var(--underline-width, 0%) 1px;
    transition: background-size 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Success message animation */
#successMessage {
    animation: slideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
    .reveal {
        transform: translateY(20px);
    }

    #hero h1 {
        font-size: 2.75rem;
        line-height: 1.15;
    }

    #hero h1 span {
        display: block;
    }
}
