﻿/* 側邊欄 */
.sidebar {
    height: 100%;
    width: 0;
    position: fixed;
    z-index: 1050;
    top: 0;
    left: 0;
    background-color: #343a40;
    overflow-x: hidden;
    transition: 0.3s;
    padding-top: 60px;
}

.sidebar.show {
    width: 250px;
}

.sidebar a {
    padding: 15px 25px;
    text-decoration: none;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.75);
    display: block;
    transition: 0.3s;
}

.sidebar a:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar .closebtn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 36px;
    margin-left: 50px;
    color: #fff;
    cursor: pointer;
}

/* 遮罩層 */
.sidebar-overlay {
    display: none;
    position: fixed;
    z-index: 1040;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.sidebar-overlay.show {
    display: block;
}

/* ===== 手機版 (< 576px) ===== */
@media (max-width: 575.98px) {
    .navbar {
        padding: 0.5rem 1rem;
    }

    .navbar-brand {
        font-size: 1.1rem;
    }

    /* 隱藏桌面版 collapse 選單，改由側邊欄取代 */
    .navbar-collapse {
        display: none !important;
    }

    /* 確保漢堡按鈕可見（覆蓋 Bootstrap 可能的隱藏） */
    .navbar-toggler {
        display: block !important;
    }

    /* 手機版側邊欄可見 */
    .sidebar {
        display: block;
    }
}

/* ===== 桌面版 (>= 576px) ===== */
@media (min-width: 576px) {
    /* 隱藏側邊欄與漢堡按鈕 */
    .sidebar {
        display: none !important;
    }

    .sidebar-overlay {
        display: none !important;
    }

    .navbar-toggler {
        display: none !important;
    }
}

/* 主要內容區域過渡 */
.main-content {
    transition: margin-left 0.3s;
}