/* ==============================================
   サイドバー共通スタイル
   パターン3: アコーディオンメニュー（多重階層対応）
   デバイス別プレビュー（レスポンシブ対応）
   Figma トンマナ準拠: ライトサイドバー
   ============================================== */

/* --- ヘッダーとの隙間をなくす --- */
header {
    margin-bottom: 0 !important;
}

/* --- レイアウトラッパー --- */
.layout-wrapper {
    display: flex;
    min-height: calc(100vh - 70px);
}

.layout-wrapper .main-content {
    flex: 1;
    min-width: 0;
}

/* --- サイドバーエリア --- */
.sidebar-area {
    width: 250px;
    flex-shrink: 0;
    background: #FAFAFA;
    border-right: 1px solid #E4E7EC;
}

.sidebar-desktop {
    width: 250px;
    position: sticky;
    top: 0;
    overflow-y: auto;
    align-self: flex-start;
    height: calc(100vh - 70px);
}


/* --- アコーディオンメニュー（Bootstrapの.accordion-itemを上書きするため.sidebar-areaでスコープ） --- */
.sidebar-area .accordion-menu {
    background: #FAFAFA;
    padding: 0;
    margin: 0;
    list-style: none;
}

.sidebar-area .accordion-item {
    border-bottom: 1px solid #E4E7EC;
    background-color: transparent;
    border: none;
    border-bottom: 1px solid #E4E7EC;
    border-radius: 0;
    color: #181D27;
}

.sidebar-area .accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    color: #717680;
    cursor: pointer;
    transition: background 0.3s;
    user-select: none;
    background: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.sidebar-area .accordion-header:hover {
    background: #F2F4F7;
}

.sidebar-area .accordion-header.active {
    background: #F2F4F7;
    color: #007DD7;
}

.sidebar-area .accordion-icon {
    transition: transform 0.3s;
    font-size: 12px;
    color: #98A2B3;
}

.sidebar-area .accordion-icon.open {
    transform: rotate(180deg);
}

.sidebar-area .accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: #FFFFFF;
}

.sidebar-area .accordion-content.open {
    max-height: 500px;
}

.sidebar-area .accordion-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-area .accordion-content li {
    border-bottom: 1px solid #F2F4F7;
}

.sidebar-area .accordion-content a {
    display: block;
    padding: 12px 20px 12px 40px;
    color: #717680;
    text-decoration: none;
    transition: all 0.3s;
}

.sidebar-area .accordion-content a:hover {
    background: #F2F4F7;
    color: #007DD7;
    padding-left: 45px;
}


/* ==============================================
   タブレット対応 (768px - 1024px)
   ============================================== */
@media (max-width: 1024px) and (min-width: 769px) {
    .sidebar-area {
        width: 200px;
    }

    .sidebar-desktop {
        width: 200px;
    }

    .sidebar-desktop .accordion-header {
        font-size: 14px;
    }

    .sidebar-desktop .accordion-content a {
        font-size: 13px;
        padding: 10px 15px 10px 30px;
    }
}

/* --- ハンバーガーメニュー --- */
.mobile-header {
    background: #FAFAFA;
    border-bottom: 1px solid #E4E7EC;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-header-title {
    color: #181D27;
    font-size: 16px;
    font-weight: 600;
}

.hamburger-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    z-index: 10;
}

.hamburger-line {
    width: 100%;
    height: 3px;
    background: #717680;
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.hamburger-button.active .hamburger-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.hamburger-button.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-button.active .hamburger-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

.mobile-menu-container {
    position: relative;
}

.mobile-menu-wrapper {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
}

.mobile-menu-wrapper.open {
    max-height: 600px;
}

/* --- モバイルメニューは非表示（デスクトップ） --- */
.mobile-menu-container {
    display: none;
}

/* ==============================================
   モバイル対応 (768px以下)
   ============================================== */
@media (max-width: 768px) {
    header {
        display: none;
    }

    .sidebar-area {
        width: 100%;
    }

    .sidebar-desktop {
        display: none;
    }

    .mobile-menu-container {
        display: block;
    }

    .layout-wrapper {
        flex-direction: column;
        min-height: 100vh;
    }

    .layout-wrapper .main-content {
        width: 100%;
    }

    .mobile-menu-container .accordion-header span {
        font-size: 14px;
    }

    .mobile-menu-container .accordion-content a {
        font-size: 13px;
        padding: 12px 20px;
    }
}
