/* ========================================
   コンポーネント別スタイル
   ======================================== */

/* ========================================
   ハンバーガーメニュー用スタイル
   ======================================== */
.menu-toggle {
    position: fixed;
    top: 18px;
    left: 8px;
    z-index: 2001;
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 6px;
    width: 44px;
    height: 44px;
    font-size: 2rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.menu-toggle:hover {
    background: #4958b8;
}

.side-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100vh;
    background: #fff;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.12);
    z-index: 2002;
    padding: 2.5rem 1.2rem 1.2rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transition: left 0.3s cubic-bezier(.4, 0, .2, 1);
}

.side-menu.open {
    left: 0;
}

.menu-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: #667eea;
    font-size: 2rem;
    cursor: pointer;
    z-index: 2003;
}

@media (max-width: 600px) {
    .side-menu {
        width: 50vw;
        min-width: 0;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

/* ========================================
   メニューコンテンツの表示/非表示
   ======================================== */
.menu-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.hidden {
    display: none !important;
}

/* ========================================
   コントロールパネル
   ======================================== */
.control-panel {
    background: white;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.category-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.category-btn {
    padding: 0.6rem 1.2rem;
    border: none;
    background: white;
    color: #667eea;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-btn:hover {
    background: #f0f4ff;
    transform: translateY(-2px);
}

.category-btn.active {
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.control-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.control-btn {
    padding: 0.6rem 1rem;
    border: 1px solid #ddd;
    background: white;
    color: #333;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.control-btn:hover {
    background: #f8f8f8;
    border-color: #667eea;
}

/* ========================================
   サイドメニュー内のボタン配置調整
   ======================================== */
.side-menu .category-buttons,
.side-menu .control-buttons {
    flex-direction: column;
    gap: 0.7rem;
    align-items: stretch;
    justify-content: flex-start;
    display: flex;
    margin-bottom: 0;
}

.side-menu .category-btn,
.side-menu .control-btn {
    width: 100%;
    margin: 0;
    border-radius: 8px;
}

/* ========================================
   ローディング表示
   ======================================== */
.loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-align: center;
    z-index: 2000;
}

.loading.hidden {
    display: none;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ========================================
   フッター内のリンク色
   ======================================== */
.footer a {
    color: #66b3ff;
    text-decoration: underline;
    transition: color 0.2s;
}

.footer a:hover {
    color: #ffe066;
}

/* ========================================
   レスポンシブ対応（コンポーネント）
   ======================================== */
@media (max-width: 768px) {
    .category-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .control-btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .control-panel {
        padding: 0.75rem;
    }

    .category-buttons {
        gap: 0.4rem;
    }

    .category-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
}

/* 現在地アイコン */
.current-location-icon {
    font-size: 24px;
    color: #e74c3c;
    /* 赤色 */
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    /* 影で立体感 */
}

/* ========================================
   お気に入り関連スタイル
   ======================================== */

/* ポップアップ内のお気に入りボタン */
.favorite-btn {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #f5f5f5;
    color: #333;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    font-size: 0.9rem;
}

.favorite-btn:hover {
    background-color: #ffe082;
    color: #ff6f00;
    border-color: #ff6f00;
    transform: scale(1.02);
}

.favorite-btn.favorite-active {
    background-color: #ffe082;
    color: #ff6f00;
    border-color: #ff6f00;
}

.favorite-btn.favorite-active:hover {
    background-color: #ffd54f;
}

/* ========================================
   サイドメニュー内のお気に入いリスト
   ======================================== */
.menu-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.favorites-list-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow: hidden;
}

.favorites-list-container.hidden {
    display: none;
}

.favorites-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.favorites-list-header h3 {
    margin: 0;
    font-size: 1rem;
    color: #333;
}

.favorites-back-btn {
    background: none;
    border: none;
    color: #667eea;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9rem;
    padding: 0;
    transition: color 0.2s;
}

.favorites-back-btn:hover {
    color: #4958b8;
}

.favorites-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 70vh;
    overflow-y: auto;
}

.favorites-item {
    padding: 0.8rem;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.favorites-item[draggable="true"] {
        cursor: grab;
}

.favorites-item.dragging {
        opacity: 0.6;
        cursor: grabbing;
}

.favorites-item.drag-over {
        border-color: #667eea;
        border-style: dashed;
        background: #eef1ff;
}

.favorites-item:hover {
    background: #fff3e0;
    border-color: #ff9800;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.favorites-item-name {
    font-weight: bold;
    color: #333;
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
}

.favorites-item-address {
    color: #666;
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
}

.favorites-item-category {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: #667eea;
    color: white;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: bold;
}

.favorites-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: #999;
}

/* ========================================
   レスポンシブ対応（お気に入い）
   ======================================== */
@media (max-width: 480px) {
    .favorite-btn {
        padding: 6px 10px;
        font-size: 0.85rem;
    }

    .favorites-list {
        max-height: 50vh;
    }
}