@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;700&display=swap');

:root {
    --primary: #4F46E5;
    --primary-dark: #4338ca;
    --secondary: #EC4899;
    --bg-color: #f3f4f6;
    --surface-color: rgba(255, 255, 255, 0.85);
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --shadow: 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);
    --radius: 16px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    background-color: var(--bg-color);
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Floating Header / Control Panel */
.controls-overlay {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    z-index: 10;
    pointer-events: none;
    /* Allow clicking map behind gaps */
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.controls-inner {
    pointer-events: auto;
    background: var(--surface-color);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

.header-contact {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-left: 8px;
    transition: var(--transition);
    display: flex;
    align-items: center;
}

.header-contact:hover {
    color: var(--primary);
    transform: scale(1.1);
}

.header-contact span {
    margin-left: 6px;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Search Bar */
.search-container {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 999px;
    padding: 4px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: var(--transition);
    max-width: 40px;
    /* Collapsed width */
    overflow: hidden;
}

.search-container.expanded {
    max-width: 300px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

#searchInput {
    border: none;
    outline: none;
    background: transparent;
    padding: 0 12px;
    font-size: 0.95rem;
    font-family: 'Outfit', sans-serif;
    width: 200px;
    /* target width */
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.search-container.expanded #searchInput {
    opacity: 1;
    pointer-events: auto;
}

.search-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    /* Clean look */
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.search-btn:hover {
    background: var(--bg-color);
    color: var(--primary);
}

.search-container.expanded .search-btn {
    background: var(--primary);
    color: white;
}

/* Filter Pills */
.filter-container {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    /* Space for scrollbar if needed */
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.filter-container::-webkit-scrollbar {
    display: none;
}

.filter-pill {
    padding: 8px 16px;
    border-radius: 9999px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--text-muted);
    transition: var(--transition);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    user-select: none;
}

.filter-pill:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    color: var(--text-main);
}

.filter-pill.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

/* Map Container */
#mapContainer {
    width: 100%;
    height: 100%;
    position: relative;
}

#map {
    width: 100%;
    height: 100%;
}

/* Floating Action Buttons (Bottom Right) */
.fab-container {
    position: absolute;
    bottom: 80px;
    /* Above status bar */
    right: 20px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.fab {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: white;
    box-shadow: var(--shadow-lg);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--text-main);
    transition: var(--transition);
}

.fab:hover {
    transform: scale(1.1);
    background: var(--primary);
    color: white;
}

/* Status Bar (Bottom) */
.status-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 8px 20px;
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 20;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.status-bar a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

/* Custom InfoWindow Style Overrides */
.gm-style-iw {
    padding: 0 !important;
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow-lg) !important;
    overflow: hidden !important;
    border: none !important;
}

.gm-style-iw-d {
    overflow: hidden !important;
    max-height: none !important;
    padding: 0 !important;
}

.gm-ui-hover-effect {
    /* Close button style */
    top: 5px !important;
    right: 5px !important;
    background: white !important;
    border-radius: 50% !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1) !important;
    opacity: 0.9 !important;
}

/* Restaurant Card inside Map */
.restaurant-card {
    width: 280px;
    background: white;
    font-family: 'Outfit', sans-serif;
}

.card-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 16px;
    position: relative;
}

.card-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
    padding-right: 20px;
}

.card-type {
    font-size: 0.75rem;
    opacity: 0.9;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
}

.card-body {
    padding: 16px;
}

.info-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-main);
}

.info-row i {
    color: var(--primary);
    width: 16px;
    text-align: center;
}

.kashrut-badge {
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--secondary);
    font-weight: 600;
    background: rgba(236, 72, 153, 0.1);
    padding: 4px 10px;
    border-radius: 12px;
}

.card-actions {
    padding: 12px 16px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 8px;
}

.action-btn {
    flex: 1;
    padding: 8px;
    border-radius: 8px;
    border: none;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: var(--transition);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: white;
    border: 1px solid #d1d5db;
    color: var(--text-main);
}

.btn-secondary:hover {
    background: #f3f4f6;
}

/* Mobile Adaptations */
@media (max-width: 768px) {
    .controls-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 12px;
    }

    .brand h1 {
        font-size: 1.25rem;
    }

    .filter-container {
        justify-content: flex-start;
    }

    .fab-container {
        bottom: 70px;
        /* Adjust for mobile constraints */
    }

    .filter-pill span {
        display: none;
    }

    .header-contact span {
        display: none;
    }

    .filter-pill {
        padding: 8px 12px;
    }
}