/* static/style.css - Material You Healthcare Theme */

:root {
    /* Healthcare-friendly Material You Color Palette */
    --primary-green: #00897B;
    --primary-light: #4DB6AC;
    --primary-lighter: #B2DFDB;
    --primary-lightest: #E0F2F1;

    --accent-blue: #1E88E5;
    --accent-blue-light: #64B5F6;

    --surface: #FFFFFF;
    --surface-variant: #F5F5F5;
    --surface-container: #FAFAFA;

    --on-surface: #1C1B1F;
    --on-surface-variant: #49454F;
    --outline: #E0E0E0;

    --success: #2E7D32;
    --info: #0288D1;

    /* Elevation shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* {
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #E0F2F1 0%, #B2DFDB 100%);
    font-family: 'Google Sans', 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 0;
    padding: 0;
    color: var(--on-surface);
    line-height: 1.6;
}

.container {
    max-width: 90%;
    margin: 24px auto;
    padding: 32px;
    background: var(--surface);
    border-radius: 28px;
    box-shadow: var(--shadow-xl);
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h1 {
    text-align: center;
    color: var(--on-surface);
    margin-bottom: 8px;
    font-size: 2.5rem;
    font-weight: 500;
    letter-spacing: -0.5px;
}

h2 {
    text-align: center;
    color: var(--primary-green);
    margin-top: 8px;
    margin-bottom: 8px;
    font-weight: 400;
    font-size: 1.75rem;
    letter-spacing: 0.25px;
}

p {
    text-align: center;
    color: var(--on-surface-variant);
    margin-bottom: 32px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    font-size: 1rem;
    line-height: 1.5;
}

/* --- Services Counter Card --- */
.services-counter-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-light) 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 12px;
    margin: 0 auto 16px auto;
    width: 100%;
    max-width: 200px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.services-counter-card #counter-number {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
    transition: transform 0.3s ease;
}

.services-counter-card #counter-label {
    font-size: 0.75rem;
    font-weight: 500;
    opacity: 0.9;
    margin-top: 2px;
}

#map-container {
    height: 70vh;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#map {
    height: 100%;
    width: 100%;
}

/* --- GPS Button in Input --- */
.input-wrapper {
    position: relative;
    width: 100%;
}

.gps-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--primary-green);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 2;
}

.gps-btn:hover {
    background-color: rgba(0, 137, 123, 0.1);
    transform: translateY(-50%) scale(1.1);
}

.gps-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.gps-btn.loading svg {
    animation: spin 1s linear infinite;
}

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

/* --- Filter --- */
#filter-container {
    text-align: center;
    margin-bottom: 12px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

#filter-container label {
    display: block;
    margin-bottom: 12px;
    color: var(--on-surface);
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.1px;
}

#provider-filter {
    background-color: var(--primary-lightest);
    color: var(--on-surface);
    padding: 10px 16px;
    border: 2px solid var(--primary-lighter);
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%3E%3Cpath%20d%3D%22M7%2010L12%2015L17%2010%22%20stroke%3D%22%2300897B%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22/%3E%3C/svg%3E');
    background-repeat: no-repeat;
    background-position: right 16px center;
}

#provider-filter:hover {
    background-color: var(--primary-lighter);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

#provider-filter:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 4px rgba(0, 137, 123, 0.12);
}

/* --- Info Window Styles --- */
.info-window-content {
    font-family: 'Google Sans', 'Roboto', sans-serif;
    line-height: 1.6;
    max-width: 320px;
    padding: 8px;
}

.info-header {
    color: var(--primary-green);
    font-size: 1.125rem;
    font-weight: 500;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-lighter);
}

.info-details {
    font-size: 0.9375rem;
    color: var(--on-surface);
}

.info-details p {
    margin: 8px 0;
    text-align: left;
}

.info-navigation {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--outline);
}

.info-navigation a {
    color: var(--accent-blue);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.info-navigation a:hover {
    color: var(--accent-blue-light);
}

.info-details a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: color 0.2s;
}

.info-details a:hover {
    color: var(--accent-blue-light);
}

#locations-cards-container {
    margin-top: 20px;
}

#main-content-container {
    display: flex;
    margin-top: 24px;
    position: relative;
    gap: 20px;
}

#map-container {
    flex: 1 1 auto;
    margin-right: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

#map-container.full-width {
    flex: 4;
}

#locations-cards-container {
    flex: 0 0 400px;
    overflow-y: auto;
    max-height: 70vh;
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(0);
    padding-right: 8px;
}

#locations-cards-container::-webkit-scrollbar {
    width: 8px;
}

#locations-cards-container::-webkit-scrollbar-track {
    background: var(--surface-variant);
    border-radius: 10px;
}

#locations-cards-container::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 10px;
}

#locations-cards-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary-green);
}

#locations-cards-container.hidden {
    flex: 0;
    transform: translateX(100%);
    display: none;
}

#card-toggle-btn {
    position: absolute;
    top: 50%;
    right: -25px;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    min-width: 56px;
    min-height: 56px;
    font-size: 28px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: strobe 1.5s ease-in-out infinite;
}

@keyframes strobe {

    0%,
    100% {
        box-shadow: 0 0 10px rgba(239, 68, 68, 0.4), 0 0 20px rgba(239, 68, 68, 0.3), var(--shadow-lg);
        opacity: 1;
    }

    50% {
        box-shadow: 0 0 20px rgba(239, 68, 68, 0.8), 0 0 40px rgba(239, 68, 68, 0.6), 0 0 60px rgba(239, 68, 68, 0.4);
        opacity: 0.9;
    }
}

#card-toggle-btn:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: var(--shadow-xl);
}

#card-toggle-btn:active {
    transform: translateY(-50%) scale(0.95);
}

#distance-calculator {
    text-align: center;
    margin-bottom: 24px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.custom-input,
.custom-btn {
    background-color: var(--primary-lightest);
    color: var(--on-surface);
    padding: 10px 18px;
    border: 2px solid var(--primary-lighter);
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    font-family: 'Google Sans', 'Roboto', sans-serif;
}

#address-input {
    display: inline-block;
    width: 100%;
    cursor: text;
    padding-right: 50px;
    /* Space for GPS button */
}

#address-input::placeholder {
    color: var(--on-surface-variant);
}

#find-nearest-btn {
    display: inline-block;
    width: 100%;
    margin-top: 12px;
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 0.75rem;
}

.custom-input:hover {
    background-color: var(--primary-lighter);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.custom-btn:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.custom-input:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 4px rgba(0, 137, 123, 0.12);
    background-color: var(--surface);
}

.custom-btn:active {
    transform: translateY(0);
}

.location-card {
    border: none;
    padding: 0;
    margin-bottom: 16px;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    background-color: var(--surface);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.location-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-title {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-light) 100%);
    color: white;
    padding: 16px 20px;
    margin: 0;
    font-size: 1.0625rem;
    font-weight: 500;
    letter-spacing: 0.25px;
}

.card-content {
    padding: 16px 20px;
    font-size: 0.9375rem;
    background-color: var(--surface);
}

.card-content p {
    margin: 8px 0;
    padding: 0;
    text-align: left;
    white-space: normal;
    overflow-wrap: break-word;
    color: var(--on-surface-variant);
}

.card-content p strong {
    color: var(--on-surface);
    font-weight: 500;
}

.card-content a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: color 0.2s;
    font-weight: 500;
}

.card-content a:hover {
    color: var(--accent-blue-light);
    text-decoration: underline;
}

/* --- Tab Styles --- */
.tabs {
    overflow: hidden;
    border-bottom: 2px solid var(--outline);
    margin-bottom: 16px;
    display: flex;
    gap: 8px;
}

.tab-link {
    background-color: transparent;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 16px 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: 12px 12px 0 0;
    color: var(--on-surface-variant);
    position: relative;
    flex: 1;
}

.tab-link:hover {
    background-color: var(--primary-lightest);
    color: var(--primary-green);
}

.tab-link.active {
    background-color: var(--primary-lightest);
    color: var(--primary-green);
}

.tab-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-green) 0%, var(--primary-light) 100%);
    border-radius: 3px 3px 0 0;
}

.tab-content {
    display: none;
    padding: 8px 0;
    animation: tabFadeIn 0.3s ease-out;
}

@keyframes tabFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Bounce animation for map markers */
@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* User Location Marker (Red Pin) */
.user-location-marker {
    font-size: 40px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    cursor: pointer;
    user-select: none;
}

/* Google Places Autocomplete Styling */
.pac-container {
    font-family: 'Google Sans', 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    margin-top: 8px;
    border: none;
    z-index: 9999;
}

.pac-item {
    padding: 12px 16px;
    cursor: pointer;
    border-top: 1px solid var(--outline);
    font-size: 14px;
}

.pac-item:first-child {
    border-top: none;
}

.pac-item:hover {
    background: var(--primary-lightest);
}

.pac-item-query {
    font-weight: 600;
    color: var(--on-surface);
}

.pac-matched {
    font-weight: 700;
}

/* ============================================
   DESKTOP REDESIGN (Floating Search Hub)
   ============================================ */

@media (hover: hover) and (min-width: 1025px) {
    .container {
        max-width: 100%;
        margin: 0;
        padding: 0;
        height: 100vh;
        border-radius: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        background: transparent;
        box-shadow: none;
    }

    #app-header {
        position: absolute;
        top: 24px;
        right: 80px;
        z-index: 1000;
        text-align: right;
        pointer-events: auto;
        background: rgba(255, 255, 255, 0.85);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        padding: 16px 24px;
        border-radius: 24px;
        box-shadow: var(--shadow-md);
        border: 1px solid rgba(255, 255, 255, 0.3);
        max-width: 400px;
    }

    #app-header h2 {
        font-size: 1.25rem;
        margin: 0;
        color: var(--primary-green);
        background: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        padding: 0;
        box-shadow: none;
        border: none;
    }

    #app-header p {
        display: block;
        font-size: 0.875rem;
        margin-top: 8px;
        margin-bottom: 0;
        color: var(--on-surface-variant);
        text-align: right;
        background: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        padding: 0;
        box-shadow: none;
        border: none;
        max-width: 100%;
        float: none;
    }

    #search-hub {
        position: absolute;
        top: 80px;
        /* Moved down to avoid blocking map controls */
        left: 24px;
        z-index: 1001;
        width: 380px;
        background: rgba(255, 255, 255, 0.85);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        padding: 24px;
        border-radius: 28px;
        box-shadow: var(--shadow-xl), 0 0 0 rgba(0, 137, 123, 0);
        border: 1px solid rgba(255, 255, 255, 0.3);
        display: flex;
        flex-direction: column;
        gap: 20px;
        cursor: grab;
        animation: pulseGlow 3s ease-in-out infinite;
    }

    @keyframes pulseGlow {
        0% {
            box-shadow: var(--shadow-xl), 0 0 0 0px rgba(0, 137, 123, 0);
        }

        50% {
            box-shadow: var(--shadow-xl), 0 0 20px 2px rgba(0, 137, 123, 0.4);
        }

        100% {
            box-shadow: var(--shadow-xl), 0 0 0 0px rgba(0, 137, 123, 0);
        }
    }

    #search-hub:active {
        cursor: grabbing;
    }

    @keyframes slideInLeft {
        from {
            opacity: 0;
            transform: translateX(-40px);
        }

        to {
            opacity: 1;
            transform: translateX(0);
        }
    }

    #filter-container,
    #distance-calculator {
        margin: 0;
        max-width: 100%;
        text-align: left;
    }

    #filter-container label {
        margin-bottom: 8px;
        font-size: 0.875rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        opacity: 0.8;
    }

    #provider-filter,
    .custom-input,
    .custom-btn {
        background-color: var(--surface);
        border-color: var(--outline);
        padding: 12px 20px;
    }

    #find-nearest-btn {
        margin-top: 16px;
    }

    .services-counter-card {
        margin: 0;
        width: 100%;
        max-width: 100%;
        border-radius: 16px;
        padding: 12px;
    }

    #main-content-container {
        flex: 1;
        margin: 0;
        gap: 0;
        position: relative;
    }

    #map-container {
        height: 100% !important;
        border-radius: 0;
        box-shadow: none;
    }

    #locations-cards-container {
        height: 100vh;
        max-height: 100vh;
        background: var(--surface);
        border-left: 1px solid var(--outline);
        margin: 0;
        padding: 24px;
        z-index: 1002;
    }

    #card-toggle-btn {
        display: flex;
        right: 400px;
        border-radius: 50% 0 0 50%;
        width: 48px;
        height: 80px;
        margin-right: -1px;
    }

    #map-container.full-width+#locations-cards-container+#card-toggle-btn,
    #main-content-container:has(#map-container.full-width) #card-toggle-btn {
        right: 0;
    }

    #card-toggle-btn {
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }
}

/* ============================================
   MOBILE RESPONSIVE STYLES
   ============================================ */

@media (max-width: 1024px) {
    .container {
        max-width: 100%;
        margin: 0;
        padding: 20px;
        border-radius: 0;
    }

    #app-header,
    #search-hub {
        display: contents;
    }

    h1 {
        font-size: 1.75rem;
        margin-bottom: 8px;
    }

    h2 {
        font-size: 1.25rem;
        margin-top: 4px;
        margin-bottom: 16px;
    }

    p {
        font-size: 0.9375rem;
        margin-bottom: 20px;
    }

    #main-content-container {
        display: block;
        margin-top: 20px;
    }

    #map-container {
        width: 100%;
        height: 50vh !important;
        margin-right: 0;
        margin-bottom: 20px;
    }

    #map-container.full-width {
        height: 50vh !important;
    }

    #map {
        height: 100%;
        width: 100%;
    }

    #locations-cards-container {
        width: 100%;
        max-height: none;
        position: static;
        transform: none !important;
        margin-top: 0;
        flex: none;
    }

    #locations-cards-container.hidden {
        display: block !important;
        transform: none !important;
    }

    #card-toggle-btn {
        display: none !important;
    }

    #filter-container,
    #distance-calculator {
        max-width: 100%;
        margin-bottom: 20px;
    }

    #filter-container label {
        font-size: 0.9375rem;
        margin-bottom: 8px;
    }

    #provider-filter,
    #address-input,
    #find-nearest-btn {
        width: 100%;
        font-size: 0.9375rem;
        padding: 14px 20px;
    }

    #find-nearest-btn {
        width: 100%;
        margin-top: 12px;
    }

    .location-card {
        margin-bottom: 16px;
    }

    .card-title {
        font-size: 1rem;
        padding: 14px 16px;
    }

    .card-content {
        font-size: 0.875rem;
        padding: 14px 16px;
    }

    .card-content p {
        white-space: normal;
        overflow-wrap: break-word;
    }

    .tabs {
        margin-bottom: 12px;
        gap: 4px;
    }

    .tab-link {
        padding: 12px 16px;
        font-size: 0.875rem;
    }

    .tab-content {
        padding: 12px 0;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .container {
        padding: 16px;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.125rem;
    }

    p {
        font-size: 0.875rem;
    }

    #map-container {
        height: 40vh !important;
        border-radius: 16px;
    }

    .card-title {
        font-size: 0.9375rem;
    }

    .card-content {
        font-size: 0.8125rem;
    }

    .tab-link {
        padding: 10px 12px;
        font-size: 0.8125rem;
    }
}

/* --- Footer Styles --- */
.site-footer {
    text-align: center;
    padding: 24px 16px;
    margin-top: 12px;
}

.site-footer p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--on-surface-variant);
}

.site-footer .company-name {
    color: #7C3AED;
    font-weight: 600;
}

.site-footer .highlight-red {
    color: #DC2626;
    font-weight: 600;
}