﻿/* Custom styles for Emerald Choice Homecare */

/* Custom color palette inspired by brand */
:root {
    --emerald-primary: #005B45;
    --gold-accent: #D4AF37;
    --cream-bg: #FDF8F3;
    --cream-bg-alt1: #F8F3EB;
    --cream-bg-alt2: #F3ECE3;
}

body,
html {
    background: var(--cream-bg);
}

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

/* Prevent horizontal overflow on mobile */
body {
    overflow-x: hidden;
    width: 100%;
}

/* Fix mobile navigation positioning */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    width: 100%;
    max-width: 100vw;
}

nav .max-w-7xl {
    max-width: 100%;
    width: 100%;
}

/* Ensure mobile menu button stays in position */
.mobile-menu-button {
    position: relative;
    z-index: 51;
}

/* Custom Animation Library (Hover & CTA animations) */

/* CTA Animations */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(220, 38, 38, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
    }
}

@keyframes glow {
    0% {
        box-shadow: 0 0 5px rgba(16, 185, 129, 0.5);
    }

    50% {
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.8), 0 0 30px rgba(16, 185, 129, 0.6);
    }

    100% {
        box-shadow: 0 0 5px rgba(16, 185, 129, 0.5);
    }
}

@keyframes wiggle {

    0%,
    7% {
        transform: rotateZ(0);
    }

    15% {
        transform: rotateZ(-15deg);
    }

    20% {
        transform: rotateZ(10deg);
    }

    25% {
        transform: rotateZ(-10deg);
    }

    30% {
        transform: rotateZ(6deg);
    }

    35% {
        transform: rotateZ(-4deg);
    }

    40%,
    100% {
        transform: rotateZ(0);
    }
}

@keyframes heartbeat {
    0% {
        transform: scale(1);
    }

    14% {
        transform: scale(1.3);
    }

    28% {
        transform: scale(1);
    }

    42% {
        transform: scale(1.3);
    }

    70% {
        transform: scale(1);
    }
}

/* Interactive Animation classes */
.animate-pulse-cta {
    animation: pulse 2s infinite;
}

.animate-glow {
    animation: glow 2s ease-in-out infinite alternate;
}

.animate-wiggle {
    animation: wiggle 2s ease-in-out;
}

.animate-heartbeat {
    animation: heartbeat 1.5s ease-in-out infinite;
}

/* AOS animations are now handled by the library */

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-30px);
    }
}

/* Enhanced hover effects */
.hover-lift {
    transition: all 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

.hover-pulse:hover {
    animation: pulse 1s infinite;
}

/* Loading spinner for forms */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {

    .animate-pulse-cta,
    .animate-glow,
    .animate-wiggle,
    .animate-heartbeat {
        animation: none !important;
    }

    /* AOS will handle its own reduced motion preferences */
}

/* Custom hover effects */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Custom gradient backgrounds */
.gradient-emerald {
    background: linear-gradient(135deg, #005B45 0%, #D4AF37 100%);
}

.gradient-emerald-light {
    background: linear-gradient(135deg, #FDF8F3 0%, #D4AF37 100%);
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(16, 185, 129, 0.3);
    border-radius: 50%;
    border-top-color: #10b981;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Custom shadows */
.shadow-emerald {
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.2);
}

/* Responsive typography */
@media (max-width: 640px) {
    .text-responsive-xl {
        font-size: 1.5rem;
        line-height: 2rem;
    }

    .text-responsive-2xl {
        font-size: 1.875rem;
        line-height: 2.25rem;
    }

    .text-responsive-3xl {
        font-size: 2.25rem;
        line-height: 2.5rem;
    }
}

/* Form styles */
.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-input:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    resize: vertical;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-textarea:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Navigation active state */
.nav-active {
    color: #10b981;
    border-bottom: 2px solid #10b981;
}

/* Mobile menu - no animations */
.mobile-menu {
    /* No transitions or animations */
}

/* Card hover effects */
.service-card {
    background: #fff;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 91, 69, 0.08);
    border: 1px solid var(--gold-accent);
    transition: all 0.3s ease;
}

.service-card:hover {
    box-shadow: 0 25px 50px -12px rgba(0, 91, 69, 0.18);
    border-color: var(--emerald-primary);
    transform: translateY(-8px);
}

/* FAQ accordion styles */
.faq-icon {
    transition: transform 0.3s ease;
}

.faq-question:hover {
    background-color: #f7f3ea;
}

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

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

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

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

/* Button animations */
.btn-hover-scale {
    transition: transform 0.2s ease;
}

.btn-hover-scale:hover {
    transform: scale(1.05);
}

/* Image hover effects */
.img-hover-zoom {
    transition: transform 0.3s ease;
    overflow: hidden;
}

.img-hover-zoom:hover img {
    transform: scale(1.1);
}

/* Back to top button styles */
#back-to-top {
    transition: all 0.3s ease;
}

#back-to-top:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
}

/* Custom text colors */
.text-emerald-custom,
.text-emerald-600,
.text-emerald-light {
    color: var(--emerald-primary) !important;
}

.text-gold,
.text-gold-accent {
    color: var(--gold-accent) !important;
}

.bg-emerald-600,
.bg-emerald-custom {
    background-color: var(--emerald-primary) !important;
}

.bg-gold,
.bg-gold-accent {
    background-color: var(--gold-accent) !important;
}

.bg-cream {
    background-color: var(--cream-bg) !important;
}

.bg-cream-alt1 {
    background-color: var(--cream-bg-alt1) !important;
}

.bg-cream-alt2 {
    background-color: var(--cream-bg-alt2) !important;
}

.border-emerald-600,
.border-emerald-custom {
    border-color: var(--emerald-primary) !important;
}

.border-gold,
.border-gold-accent {
    border-color: var(--gold-accent) !important;
}

/* Red accent button styles */
.btn-ruby {
    background-color: var(--gold-accent);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    transform: scale(1);
}

.btn-ruby:hover {
    background-color: var(--gold-accent);
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(212, 175, 55, 0.3);
}

.btn-ruby-outline {
    border: 2px solid var(--gold-accent);
    color: var(--gold-accent);
    background: transparent;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-ruby-outline:hover {
    background-color: var(--gold-accent);
    transform: scale(1.02);
}

/* Emergency/Important section styling */
.emergency-highlight {
    background: linear-gradient(135deg, #FDF8F3 0%, #D4AF37 100%);
    border-left: 4px solid var(--gold-accent);
}

.emergency-icon {
    color: var(--gold-accent);
}

/* Special highlights */
.accent-highlight {
    background: linear-gradient(45deg, var(--emerald-600), var(--gold-accent));
    color: white;
}

.gradient-emerald-ruby {
    background: linear-gradient(135deg, var(--emerald-600) 0%, var(--gold-accent) 100%);
}

/* Red focus states for important elements */
.focus-ruby:focus {
    outline: 2px solid var(--gold-accent);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }

    nav,
    footer {
        display: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.4;
    }

    h1,
    h2,
    h3 {
        color: #000 !important;
    }
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles for better accessibility */
button:focus,
a:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid var(--gold-accent);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .bg-emerald-600 {
        background-color: #000;
    }

    .text-emerald-600 {
        color: #000;
    }

    .border-emerald-600 {
        border-color: #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* Prevent any horizontal scrolling on mobile */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
        width: 100vw;
        max-width: 100vw;
    }

    nav {
        width: 100vw;
        max-width: 100vw;
    }

    .mobile-menu {
        width: 100%;
        max-width: 100vw;
    }

    /* Ensure all images stay within bounds */
    img {
        max-width: 100%;
        height: auto;
    }

    /* Ensure all sections stay within bounds */
    section {
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }

    /* Ensure all containers stay within bounds */
    .max-w-7xl {
        max-width: 100%;
        width: 100%;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Prevent any element from overflowing */
    * {
        max-width: 100%;
        box-sizing: border-box;
    }
}