:root {
    --primary-color: #6C63FF;
    /* Modern Purple */
    --secondary-color: #2F2E41;
    /* Dark Gray */
    --accent-color: #FF6584;
    /* Soft Red/Pink */
    --bg-light: #F9FAFB;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-light);
    color: var(--secondary-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 600;
    border-radius: 8px;
    padding: 0.6rem 1.2rem;
}

.btn-primary:hover {
    background-color: #5a52d5;
    border-color: #5a52d5;
}

/* Home Hero Section */
.hero-section {
    min-height: 80vh;
    display: flex;
    flex-direction: column !important;
    /* Force stack layout for logo above card */
    align-items: center;
    justify-content: center;
    /* Background image with fade to bottom (to match bg-light #F9FAFB) */
    background: linear-gradient(to bottom, rgba(47, 46, 65, 0.3), rgba(249, 250, 251, 1)),
        url('https://images.unsplash.com/photo-1519741497674-611481863552?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80');
    background-size: cover;
    background-position: center;
    text-align: center;
    padding: 2rem;
}

.search-card {
    background: white;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    width: 100%;
}

/* Layout for Search Page */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* Desktop Sidebar */
.sidebar {
    width: 250px;
    background: white;
    border-right: 1px solid #eee;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    position: fixed;
    top: 0;
    left: -280px;
    /* Hidden by default */
    height: 100vh;
    z-index: 10000;
    transition: left 0.3s ease-in-out;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.05);
}

.sidebar.show {
    left: 0;
}

@media (min-width: 992px) {
    .app-container {
        flex-direction: row;
        margin-left: 0;
        /* No margin initially */
        transition: margin-left 0.3s ease-in-out;
    }

    /* Search Results Desktop Layout */
    .results-list {
        padding-top: 80px !important;
        /* Space for fixed menu button */
    }
}

.main-content {
    flex: 1;
    display: flex;
    /* Split view */
    height: 100vh;
    overflow: hidden;
}

/* Split View (List + Map) */
.results-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: #f8f9fa;
}

.map-container {
    flex: 1;
    background: #e9ecef;
    position: relative;
    height: 100%;
    /* Important for Leaflet */
}

#map {
    height: 100%;
    width: 100%;
    z-index: 1;
}

/* Provider Card */
.provider-card {
    background: white;
    border-radius: 12px;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 1rem;
    transition: transform 0.2s;
    cursor: pointer;
}

.provider-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.provider-img {
    height: 150px;
    object-fit: cover;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

/* Mobile Bottom Navigation (Tabs) */
.mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-around;
    padding: 0.8rem 0;
    z-index: 1000;
}

.mobile-nav-item {
    text-align: center;
    color: #888;
    text-decoration: none;
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.mobile-nav-item.active {
    color: var(--primary-color);
    font-weight: 600;
}

.mobile-nav-item svg {
    margin-bottom: 4px;
    width: 24px;
    height: 24px;
}

@media (min-width: 992px) {
    .mobile-nav {
        display: none;
    }
}

/* Mobile specific visibility toggles */
.d-mobile-none {
    display: none;
}

.d-mobile-block {
    display: block;
}

@media (min-width: 992px) {
    .d-mobile-none {
        display: block;
        /* or flex depending on need */
    }

    .d-mobile-block {
        display: none;
    }
}

/* Mobile View Switching Logic (handled by JS toggling classes) */
.view-mode-map .results-list {
    display: none;
}

.view-mode-map .map-container {
    display: block;
    height: calc(100vh - 60px);
    /* Minus nav height */
}

.view-mode-list .results-list {
    display: block;
}

.view-mode-list .map-container {
    display: none;
    /* Hide map on list view mobile */
}

/* On Desktop, always show both */
@media (min-width: 992px) {

    .view-mode-map .results-list,
    .view-mode-list .results-list {
        display: block !important;
    }

    .view-mode-map .map-container,
    .view-mode-list .map-container {
        display: block !important;
    }
}

/* Horizontal Scrolling Wrapper (Netflix Style) */
.scrolling-wrapper {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    /* Smooth scrolling on iOS */
    padding-bottom: 1rem;
    gap: 1rem;
}

.scrolling-wrapper::-webkit-scrollbar {
    display: none;
    /* Hide scrollbar */
}

.scrolling-wrapper .card {
    flex: 0 0 auto;
    width: 280px;
    /* Fixed width for cards */
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
}

.scrolling-wrapper .card:hover {
    transform: translateY(-5px);
}

.scrolling-wrapper .card img {
    height: 160px;
    object-fit: cover;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.service-icons-scroll {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    gap: 1rem;
    padding: 0 0.4rem 0.4rem;
}

.service-icons-scroll::-webkit-scrollbar {
    height: 6px;
}

.service-icons-scroll::-webkit-scrollbar-thumb {
    background: #d8d8e0;
    border-radius: 999px;
}

.service-icon-item {
    flex: 0 0 auto;
    min-width: 96px;
    width: 96px;
    text-align: center;
    white-space: normal;
}

.service-icon-item span {
    display: block;
    width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.15;
    min-height: 2.4em;
}

.service-label {
    display: block !important;
    width: 100% !important;
    max-width: 96px !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    line-height: 1.15 !important;
    min-height: 2.4em;
}

.service-icon-item.active .service-icon-circle {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.service-icon-item.active .service-icon-circle i {
    color: #fff !important;
}

@media (max-width: 991.98px) {
    .service-icons-scroll {
        display: grid !important;
        grid-auto-flow: column !important;
        grid-auto-columns: 96px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        justify-content: start !important;
    }

    .service-icon-item {
        width: 96px !important;
        min-width: 96px !important;
    }

    .service-label {
        max-width: 96px !important;
        font-size: 0.72rem !important;
    }
}

.object-fit-cover {
    object-fit: cover;
}

.hover-zoom {
    transition: transform 0.2s ease;
}

/* Autocomplete Styling */
.autocomplete-wrapper {
    position: relative;
    width: 100%;
}

.suggestions-box {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    /* Toggled by JS via .d-none */
}

.suggestions-box:not(.d-none) {
    display: block;
}

.suggestion-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background-color: #f8f9fa;
}
