/* ===== Base Styles ===== */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
    -webkit-text-size-adjust: 100%;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    touch-action: manipulation;
    overflow-x: hidden;
}

/* Prevent tap highlight on mobile */
a, button, input, select, textarea {
    -webkit-tap-highlight-color: transparent;
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.animate-fade-in {
    animation: fadeIn 1s ease-out both;
}

.animate-fade-in-up {
    animation: fadeInUp 1s ease-out both;
}

.animate-fade-in-up-delay {
    animation: fadeInUp 1s ease-out 0.3s both;
}

.animate-fade-in-up-delay-2 {
    animation: fadeInUp 1s ease-out 0.6s both;
}

/* Reduce animation on prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .animate-fade-in,
    .animate-fade-in-up,
    .animate-fade-in-up-delay,
    .animate-fade-in-up-delay-2 {
        animation: none;
        opacity: 1;
        transform: none;
    }
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
    html {
        scroll-behavior: auto;
    }
}

/* ===== Scroll Reveal ===== */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

/* ===== Navbar ===== */
#navbar {
    background: transparent;
}

#navbar.scrolled {
    background: rgba(253, 248, 244, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 20px rgba(0, 0, 0, 0.05);
}

/* ===== Mobile Menu Overlay ===== */
.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 40;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* ===== WhatsApp Float ===== */
.whatsapp-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    z-index: 100;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    /* Safe area support for notched phones */
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    right: calc(16px + env(safe-area-inset-right, 0px));
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(37, 211, 102, 0.5);
}

/* Active state for mobile (no hover) */
.whatsapp-float:active {
    transform: scale(0.95);
}

/* ===== Service Cards ===== */
.service-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
    transform: translateY(-4px);
}

/* Disable hover lift on touch devices - causes sticky state */
@media (hover: none) {
    .service-card:hover {
        transform: none;
    }
    .blog-card:hover {
        transform: none;
    }
}

/* ===== Calendar Styles ===== */
.cal-day {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px;
    min-width: 44px;
}

.cal-day:hover:not(.cal-day--disabled):not(.cal-day--empty) {
    background: #FAE8DC;
}

.cal-day:active:not(.cal-day--disabled):not(.cal-day--empty) {
    background: #F0D0BF;
}

.cal-day--today {
    border: 2px solid #D4A69A;
    font-weight: 600;
}

.cal-day--selected {
    background: #D4A69A !important;
    color: white;
    font-weight: 600;
}

.cal-day--disabled {
    color: #E0B09E;
    opacity: 0.4;
    cursor: not-allowed;
}

.cal-day--empty {
    cursor: default;
}

/* ===== Time Slots ===== */
.time-slot {
    padding: 0.75rem;
    border-radius: 12px;
    border: 1px solid #F5E6DC;
    text-align: center;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #5A3D36;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.time-slot:hover {
    border-color: #D4A69A;
    background: #FDF6F0;
}

.time-slot:active {
    background: #FAE8DC;
}

.time-slot--selected {
    background: #D4A69A;
    border-color: #D4A69A;
    color: white;
}

/* ===== FAQ ===== */
.faq-toggle {
    cursor: pointer;
    min-height: 56px;
}

.faq-icon {
    transition: transform 0.3s ease;
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
}

/* Smooth FAQ content animation */
.faq-content {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

.faq-content.collapsed {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
}

.faq-content.expanded {
    max-height: 500px;
    opacity: 1;
}

/* ===== Map Styles ===== */
#serviceMap {
    z-index: 1;
}

.map-popup {
    text-align: center;
    font-family: 'Lato', sans-serif;
}

.map-popup h4 {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    font-weight: 600;
    color: #5A3D36;
    margin-bottom: 4px;
}

.map-popup p {
    font-size: 0.8rem;
    color: #A67264;
}

/* Custom marker */
.custom-marker {
    background: #D4A69A;
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.custom-marker-main {
    background: #B8847A;
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 12px rgba(184, 132, 122, 0.5);
}

/* ===== Suburb Links ===== */
.suburb-link {
    text-decoration: none;
    min-height: 44px;
}

.suburb-link.active span:first-child {
    background: #B8847A;
    transform: scale(1.5);
}

.suburb-link.active span:last-child {
    color: #B8847A;
    font-weight: 600;
}

/* ===== Form Success State ===== */
.form-success {
    background: #F0FDF4;
    border: 1px solid #BBF7D0;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
}

.form-success p {
    color: #166534;
}

/* ===== Select Arrow ===== */
select.appearance-none {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23A67264' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.25rem;
    padding-right: 3rem;
}

/* ===== Horizontal Scroll Feed (mobile) ===== */
.feed-scroll {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.5rem;
}

.feed-scroll::-webkit-scrollbar {
    display: none;
}

.feed-scroll > * {
    scroll-snap-align: start;
    flex-shrink: 0;
}

/* ===== Mobile Responsive ===== */
@media (max-width: 640px) {
    /* WhatsApp float - smaller, safe area aware */
    .whatsapp-float {
        width: 52px;
        height: 52px;
        bottom: calc(16px + env(safe-area-inset-bottom, 0px));
        right: calc(12px + env(safe-area-inset-right, 0px));
    }

    .whatsapp-float svg {
        width: 26px;
        height: 26px;
    }

    /* Tighter section padding on mobile */
    .section-padding {
        padding-top: 4rem;
        padding-bottom: 4rem;
    }

    /* Calendar days slightly smaller text on very small screens */
    .cal-day {
        font-size: 0.8125rem;
        border-radius: 8px;
    }

    /* Feed items size on mobile */
    .feed-scroll .feed-item-ig {
        width: 70vw;
        max-width: 280px;
    }

    .feed-scroll .feed-item-tt {
        width: 45vw;
        max-width: 200px;
    }
}

/* Extra small phones (iPhone SE, etc) */
@media (max-width: 374px) {
    .cal-day {
        font-size: 0.75rem;
        min-height: 38px;
        min-width: 38px;
        border-radius: 6px;
    }

    .time-slot {
        font-size: 0.8125rem;
        padding: 0.5rem;
        min-height: 40px;
    }
}

/* Safe area padding for notched phones */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    footer {
        padding-bottom: calc(4rem + env(safe-area-inset-bottom));
    }
}

/* ===== Blog Cards ===== */
.blog-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-4px);
}

/* Blog article typography */
.blog-content h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.75rem;
    font-weight: 600;
    color: #5A3D36;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.blog-content h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.375rem;
    font-weight: 600;
    color: #5A3D36;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.blog-content p {
    color: #7D564B;
    line-height: 1.8;
    margin-bottom: 1rem;
}

.blog-content ul,
.blog-content ol {
    color: #7D564B;
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.blog-content li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

.blog-content a {
    color: #B8847A;
    text-decoration: underline;
}

.blog-content a:hover {
    color: #5A3D36;
}

.blog-content img {
    border-radius: 1rem;
    margin: 1.5rem 0;
}

.blog-content blockquote {
    border-left: 4px solid #D4A69A;
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    color: #A67264;
    font-style: italic;
}
