/* サイドバーメニュー用CSS */

/* ナビゲーションバーの位置調整 - 本家サイトに合わせて */
nav.navbar {
    position: fixed;
    right: 1rem;
    top: 1rem;
    z-index: 1000;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* ハンバーガーボタンのスタイル */
.navbar-toggler {
    border: none;
    padding: 0.25rem 0.5rem;
    background: transparent !important;
    position: relative;
}

.navbar-toggler:focus {
    box-shadow: none;
}

/* ::before疑似要素を完全に削除 */
.navbar-toggler::before {
    display: none !important;
    content: none !important;
}

/* ハンバーガーアイコン - 本家サイトに合わせて薄い白色 */
.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.9%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
    width: 1.5em !important;
    height: 1.5em !important;
    background-size: 100% !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-color: transparent !important;
    border: none !important;
}

/* Flat UIやBootstrapの干渉を防ぐ */
.navbar-toggler .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.9%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
    background-color: transparent !important;
}

/* サイドバー */
.sidebar {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100vh;
    background-color: #fff;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    transition: right 0.3s ease-in-out;
    overflow-y: auto;
}

.sidebar.active {
    right: 0;
}

/* サイドバーヘッダー */
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #eee;
    background-color: #f8f9fa;
}

.sidebar-header h5 {
    margin: 0;
    color: #34495e;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: #dc3545;
}

/* サイドバーコンテンツ */
.sidebar-content {
    padding: 0;
}

/* サイドバーメニュー */
.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    border-bottom: 1px solid #f0f0f0;
}

.sidebar-menu li:last-child {
    border-bottom: none;
}

.sidebar-menu a {
    display: block;
    padding: 1rem 1.5rem;
    color: #34495e;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.sidebar-menu a:hover {
    background-color: #f8f9fa;
    color: #16a085;
    padding-left: 2rem;
}

/* サイドバーオーバーレイ */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ヘッダーとの重なり防止 */
header#exam_header {
    z-index: 999;
}

/* スマートフォン表示時の調整 */
@media (max-width: 991.98px) {
    nav.navbar {
        right: 0.5rem;
        top: 0.5rem;
    }
    
    .sidebar {
        width: 280px;
        right: -280px;
    }
}

@media (max-width: 576px) {
    .sidebar {
        width: 100%;
        right: -100%;
    }
}
