/* ============================================
   AMS In-Home Care Service Agency
   Custom Styles & Animations
   ============================================ */

/* ---------- Base / Reset ---------- */
*, *::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-color: rgba(151, 21, 48, 0.2);
    color: #1a1a2e;
}

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

::-webkit-scrollbar-track {
    background: #f5f5f5;
}

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

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

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

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

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

/* ---------- Hero Animations ---------- */
.animate-fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

.animate-slide-up {
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.animate-slide-up-delay {
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.animate-slide-up-delay-2 {
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

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

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

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

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

#navbar.scrolled {
    background-color: rgba(26, 26, 46, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

#navbar.scrolled .nav-link {
    color: rgba(255, 255, 255, 0.85);
}

#navbar.scrolled .nav-link:hover {
    color: #ffffff;
}

/* ---------- Service Cards ---------- */
.group:hover .group-hover\:translate-y-\[-2px\] {
    transform: translateY(-2px);
}

/* ---------- Button Focus States ---------- */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #b91d3c;
    outline-offset: 2px;
}

/* ---------- Mobile Menu ---------- */
#mobile-menu {
    animation: slideDown 0.3s ease-out;
}

#mobile-menu a {
    display: block;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

#mobile-menu a:last-child {
    border-bottom: none;
}

/* ---------- Form Inputs ---------- */
input[type="text"],
input[type="email"],
input[type="tel"],
select,
textarea {
    appearance: none;
    -webkit-appearance: none;
}

/* ---------- Smooth Image Loading ---------- */
img {
    loading: lazy;
    decoding: async;
}

/* ---------- Print Styles ---------- */
@media print {
    nav, #contact, footer, .animate-fade-in, .animate-slide-up {
        display: none !important;
    }
    
    body {
        color: #000;
        background: #fff;
    }
    
    section {
        page-break-inside: avoid;
    }
}

/* ---------- 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;
    }
    
    .reveal {
        opacity: 1;
        transform: none;
    }
}

/* ---------- High Contrast ---------- */
@media (prefers-contrast: high) {
    .bg-burgundy-600 {
        background-color: #7c132b;
    }
    
    .text-gray-600 {
        color: #374151;
    }
}

/* ---------- Tablet ---------- */
@media (max-width: 767px) {
    .font-serif {
        font-size: clamp(1.75rem, 5vw, 2.5rem);
    }
}

/* ---------- Large Screens ---------- */
@media (min-width: 1280px) {
    .reveal {
        transform: translateY(50px);
    }
}
