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

:root {
    --primary-sushi: #E8704A;
    --primary-sushi-light: #F5A17A;
    --secondary-attraction: #2196F3;
    --secondary-attraction-light: #64B5F6;
    --text-primary: #212121;
    --text-secondary: #666666;
    --bg-light: #FAFAFA;
    --bg-white: #FFFFFF;
    --border-color: #E0E0E0;
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.15);
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: var(--text-primary);
    background: var(--bg-white);
}

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

header {
    background: linear-gradient(135deg, var(--primary-sushi) 0%, var(--primary-sushi-light) 100%);
    color: white;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    text-align: center;
}

header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
}

.subtitle {
    font-size: 0.9rem;
    opacity: 0.95;
}

.main-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
    gap: 0;
}

.sidebar {
    width: 100%;
    background: var(--bg-white);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    z-index: 100;
    box-shadow: var(--shadow);
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    font-size: 1.1rem;
    color: var(--text-primary);
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    color: var(--text-primary);
}

.search-filters {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.search-box {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    transition: border-color 0.2s;
}

.search-box:focus {
    outline: none;
    border-color: var(--primary-sushi);
    box-shadow: 0 0 0 3px rgba(232, 112, 74, 0.1);
}

.filter-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    flex: 1;
    min-width: 70px;
    padding: 0.6rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-light);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.filter-btn:hover {
    background: var(--bg-white);
    border-color: var(--primary-sushi);
}

.filter-btn.active {
    background: var(--primary-sushi);
    color: white;
    border-color: var(--primary-sushi);
}

.poi-list {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.poi-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.2s;
}

.poi-item:hover {
    background-color: var(--bg-light);
}

.poi-item-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.poi-item-type {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.poi-item-address {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.poi-item.restaurant {
    border-left: 4px solid var(--primary-sushi);
}

.poi-item.attraction {
    border-left: 4px solid var(--secondary-attraction);
}

.poi-item.active {
    background-color: rgba(232, 112, 74, 0.1);
}

.map-container {
    flex: 1;
    position: relative;
    overflow: hidden;
}

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

.map-controls {
    position: absolute;
    bottom: 1.5rem;
    right: 1.5rem;
    background: var(--bg-white);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 10;
}

.layer-toggle {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.layer-toggle label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-primary);
    user-select: none;
}

.layer-toggle input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.popup-overlay.active {
    display: flex;
}

.popup-content {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 8px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 0.5rem;
}

.popup-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    word-wrap: break-word;
    word-break: break-word;
}

.popup-type {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.popup-type.restaurant {
    background: rgba(232, 112, 74, 0.15);
    color: var(--primary-sushi);
}

.popup-type.attraction {
    background: rgba(33, 150, 243, 0.15);
    color: var(--secondary-attraction);
}

.popup-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    color: var(--text-secondary);
    transition: color 0.2s;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.popup-close:hover {
    color: var(--text-primary);
    background: var(--bg-light);
}

.popup-info {
    margin-bottom: 1rem;
}

.popup-info-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
    align-items: flex-start;
}

.popup-label {
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 70px;
}

.popup-value {
    color: var(--text-primary);
    word-break: break-word;
}

.popup-value a {
    color: var(--primary-sushi);
    text-decoration: none;
}

.popup-value a:hover {
    text-decoration: underline;
}

.popup-curator-note {
    font-style: italic;
    color: var(--primary-sushi);
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(232, 112, 74, 0.08);
    border-left: 3px solid var(--primary-sushi);
    border-radius: 2px;
}

.popup-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.poi-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s;
    border: 2px solid white;
    box-shadow: var(--shadow);
}

.poi-marker:hover {
    transform: scale(1.15);
}

.poi-marker.restaurant {
    width: 32px;
    height: 32px;
    background: var(--primary-sushi);
}

.poi-marker.attraction {
    width: 28px;
    height: 28px;
    background: var(--secondary-attraction);
}

.poi-marker::before {
    content: '';
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 10px solid white;
    position: absolute;
    opacity: 0.8;
}

@media (min-width: 768px) {
    .main-layout {
        flex-direction: row;
    }

    .sidebar {
        width: 320px;
        min-width: 320px;
        border-right: 1px solid var(--border-color);
        box-shadow: none;
    }

    .sidebar-toggle {
        display: none;
    }

    header h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }
}

@media (max-width: 767px) {
    .sidebar {
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: var(--shadow-lg);
        border-right: none;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: block;
        font-size: 2rem;
    }

    .main-layout {
        position: relative;
    }

    header h1 {
        font-size: 1.3rem;
    }

    .subtitle {
        font-size: 0.8rem;
    }

    .popup-content {
        max-width: 90%;
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    header {
        padding: 1rem;
    }

    header h1 {
        font-size: 1.1rem;
    }

    .subtitle {
        font-size: 0.75rem;
    }

    .sidebar {
        width: 75vw;
    }

    .map-controls {
        bottom: 1rem;
        right: 1rem;
        padding: 0.75rem;
    }

    .layer-toggle {
        gap: 0.5rem;
    }

    .layer-toggle label {
        font-size: 0.85rem;
    }

    .popup-content {
        max-width: 95%;
        padding: 1.25rem;
    }

    .popup-title {
        font-size: 1.25rem;
    }

    .popup-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .popup-header > div {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 0.5rem;
        margin-bottom: 0.75rem;
    }

    .popup-close {
        align-self: flex-start;
        margin-top: 0;
    }
}

.leaflet-container {
    background: #f0f0f0;
}

.leaflet-popup {
    display: none;
}

.leaflet-control-zoom {
    border-radius: 4px;
}

.leaflet-control-zoom a {
    font-size: 1.25rem;
    font-weight: bold;
}
