body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.app-container {
    position: relative;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

.map-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    z-index: 1;
    padding: 0px 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    height: 50px;
}

.map-header h1 {
    margin: 0;
    font-size: 16px;
    color: #333;
    font-weight: 700;
    line-height: 50px;
}

.map-container {
    position: absolute;
    top: 50px;
    bottom: 0;
    left: 0;
    right: 0;
}

.store-detail {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 300px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

@media (max-width: 640px) {
    .store-detail {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 90%;
        max-height: 90%;
        overflow-y: auto;
    }
}

@media (max-width: 480px) {
    .map-header {
        height: 60px;
    }
    
    .map-header h1 {
        font-size: 14px;
        line-height: 1.2;
        padding: 10px 0;
    }
    
    .map-container {
        top: 60px;
    }
}
.store-detail.hidden {
    display: none;
}

.store-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.store-detail-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.close-button {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 0 4px;
}

.chain-name {
    color: #666;
    margin: 4px 0;
}

.store-detail-content p {
    margin: 8px 0;
    font-size: 14px;
}

/* 凡例パネル */
.legend-panel {
    position: absolute;
    top: 70px;
    left: 20px;
    width: 280px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    padding: 16px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    z-index: 2;
}

.legend-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
    position: relative;
}

.legend-header h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.legend-close {
    position: absolute;
    top: -4px;
    right: 0;
    background: none;
    border: none;
    font-size: 24px;
    font-weight: 300;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 24px;
    height: 24px;
    display: none;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.legend-close:hover {
    color: #333;
}

.total-stores {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.total-stores span {
    font-weight: 700;
    color: #333;
}

.legend-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.legend-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    opacity: 1;
    transition: all 0.3s ease;
    border-radius: 6px;
    background: transparent;
}

.legend-item:hover {
    background-color: #f5f5f5;
}

.legend-item.inactive {
    opacity: 0.4;
}

.legend-item.inactive:hover {
    opacity: 0.6;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-right: 12px;
    border: 2px solid rgba(255,255,255,0.8);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.legend-text {
    flex-grow: 1;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.legend-count {
    font-size: 12px;
    color: #666;
    font-weight: 600;
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 10px;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .legend-panel {
        width: calc(100vw - 40px);
        left: 20px;
        right: 20px;
    }
}

@media (max-width: 480px) {
    .legend-panel {
        top: 80px;
        width: calc(100vw - 20px);
        left: 10px;
        right: 10px;
        max-height: calc(100vh - 140px);
    }
    
    .legend-header h3 {
        font-size: 14px;
    }
    
    .legend-text {
        font-size: 13px;
    }
    
    .legend-count {
        font-size: 11px;
    }
}

/* モバイル用トグルボタン */
.mobile-only {
    display: none;
}

.legend-toggle {
    position: absolute;
    top: 70px;
    right: 20px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 3;
    transition: background-color 0.3s ease;
}

.legend-toggle:hover {
    background-color: #f5f5f5;
}

.legend-toggle.active {
    background-color: #007cba;
    color: white;
}

/* マップスタイル切替ボタン */
.style-switcher {
    position: absolute;
    top: 70px;
    right: 20px;
    display: flex;
    background: white;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
    z-index: 3;
}

.style-button {
    background: white;
    border: none;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border-right: 1px solid #eee;
}

.style-button:last-child {
    border-right: none;
}

.style-button:hover {
    background-color: #f5f5f5;
}

.style-button.active {
    background-color: #007cba;
    color: white;
}

.style-button.active:hover {
    background-color: #005a8b;
}

/* モバイル表示調整 */
@media (max-width: 768px) {
    .mobile-only {
        display: block;
    }
    
    .legend-panel {
        display: none;
    }
    
    .legend-panel.show-mobile {
        display: block;
        position: fixed;
        top: 60px;
        left: 10px;
        right: 10px;
        bottom: 10px;
        width: auto;
        max-height: none;
        z-index: 5;
    }
    
    .legend-panel.show-mobile .legend-close {
        display: flex;
    }
    
    .store-detail {
        z-index: 10;
    }
    
    .legend-toggle {
        top: 120px;
    }
    
    .style-switcher {
        right: 10px;
        top: 70px;
    }
    
    .style-button {
        padding: 6px 8px;
        font-size: 11px;
    }
}