* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
        Cantarell, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

.container {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-text {
    flex: 1;
}

header h1 {
    font-size: 28px;
    margin-bottom: 8px;
}

header p {
    font-size: 14px;
    opacity: 0.9;
}

/* Search Container */
.search-container {
    position: relative;
    min-width: 280px;
}

.search-container input {
    width: 100%;
    padding: 12px 40px 12px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
    background-color: rgba(255, 255, 255, 0.95);
    color: #333;
}

.search-container input:focus {
    background-color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.search-container input::placeholder {
    color: #999;
}

.search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    pointer-events: none;
}

/* Map Type Toggle */
.map-type-toggle {
    display: flex;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    overflow: hidden;
}

.map-type-toggle button {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: white;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.map-type-toggle button:hover {
    background: rgba(255, 255, 255, 0.15);
}

.map-type-toggle button.active {
    background: rgba(255, 255, 255, 0.95);
    color: #667eea;
}

.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Map Section */
.map-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #e0e0e0;
    position: relative;
}

#map {
    flex: 1;
    width: 100%;
}

/* Results Section */
.results-section {
    width: 450px;
    background-color: white;
    display: flex;
    flex-direction: column;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
}

.results-header {
    padding: 20px 25px;
    border-bottom: 2px solid #f0f0f0;
}

.results-header h2 {
    font-size: 22px;
    margin-bottom: 8px;
    color: #333;
}

.location-info {
    font-size: 13px;
    color: #666;
    margin-top: 5px;
}

/* Filters */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    user-select: none;
}

.filter-item input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.filter-item:hover {
    color: #333;
}

.filter-count {
    color: #999;
    font-size: 12px;
    font-weight: normal;
}

/* Loading State */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

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

.loading p {
    color: #666;
    font-size: 14px;
}

/* Results List */
.results-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
    text-align: center;
    padding: 40px;
}

.empty-state svg {
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 15px;
}

/* Place Card */
.place-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.place-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    border-color: #667eea;
}

.place-card.highlighted {
    border-color: #667eea;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
    background-color: #f8f9ff;
    animation: highlight-pulse 0.5s ease;
}

@keyframes highlight-pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}

.place-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.place-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    flex: 1;
}

.place-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: #f59e0b;
    white-space: nowrap;
    margin-left: 10px;
}

.place-types {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
}

.place-type {
    background-color: #f0f0f0;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    color: #666;
    text-transform: capitalize;
}

.place-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.place-distance {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #667eea;
    font-weight: 600;
    white-space: nowrap;
}

.place-distance svg {
    width: 16px;
    height: 16px;
}

.place-address {
    font-size: 13px;
    color: #888;
    margin-top: 8px;
    line-height: 1.4;
}

.place-status {
    display: inline-block;
    margin-top: 8px;
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 4px;
}

.place-status.open {
    background-color: #d1fae5;
    color: #065f46;
}

.place-status.closed {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Scrollbar Styling */
.results-list::-webkit-scrollbar {
    width: 8px;
}

.results-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.results-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.results-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Error State */
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #dc2626;
    text-align: center;
}

.error-state svg {
    margin-bottom: 15px;
}

.error-state p {
    font-size: 14px;
}

/* Google Maps Info Window - Remove top padding/gap and reduce header size */
.gm-style .gm-style-iw-c {
    padding: 0 !important;
    max-width: 280px !important;
}

.gm-style .gm-style-iw-d {
    overflow: auto !important;
    padding: 0 !important;
}

.gm-style .gm-style-iw-tc::after {
    display: none !important;
}

/* Reduce the header/close button container height */
.gm-style .gm-style-iw-chr {
    height: 24px !important;
    display: flex !important;
    align-items: center !important;
}

/* Make close button smaller */
.gm-style .gm-ui-hover-effect {
    width: 24px !important;
    height: 24px !important;
    top: 4px !important;
    right: 4px !important;
}

.gm-style .gm-ui-hover-effect > span {
    width: 16px !important;
    height: 16px !important;
    margin: 4px !important;
}

/* Info Window Content Styles */
.info-window-content {
    padding: 0 12px 8px 12px;
    max-width: 250px;
}

.info-window-title {
    margin: 0 0 6px 0;
    font-size: 15px;
    line-height: 1.3;
}

.info-window-link {
    color: #667eea;
    text-decoration: none;
    outline: none;
}

.info-window-link:hover {
    text-decoration: underline;
}

.info-window-link:focus {
    outline: none;
}

.info-window-rating {
    margin: 0;
    color: #f59e0b;
    font-size: 14px;
}

.info-window-distance {
    margin: 0;
    color: #666;
    font-size: 13px;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .results-section {
        width: 380px;
    }

    .search-container {
        min-width: 250px;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .header-controls {
        flex-direction: column;
        gap: 10px;
    }

    .search-container {
        min-width: 100%;
    }

    .map-type-toggle {
        width: 100%;
    }

    .map-type-toggle button {
        flex: 1;
    }

    .main-content {
        flex-direction: column;
    }

    .map-section {
        height: 50vh;
    }

    .results-section {
        width: 100%;
        height: 50vh;
    }
}
