/* メニュートグルボタン */
.menu-toggle {
    display: none; /* デフォルトでは非表示 */
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.menu-toggle .menu-icon {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 24px;
}

.menu-toggle .menu-icon span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: #333;
    transition: transform 0.3s ease;
}

.menu-toggle.active .menu-icon span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.menu-toggle.active .menu-icon span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .menu-icon span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* メインナビゲーション */
.main-nav {
    flex: 1;
}

.main-menu-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.main-menu-list li {
    margin: 0;
}

.main-menu-list a {
    display: block;
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: #333;
    transition: background-color 0.2s, color 0.2s;
    border-radius: 4px;
    white-space: nowrap;
}

.main-menu-list a:hover,
.main-menu-list a:focus {
    background-color: #f0f0f0;
    color: #0066cc;
}

/* ヘッダーアクション */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* 検索ボックス */
.search-box form {
    display: flex;
    gap: 0.25rem;
}

.search-box input {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-width: 200px;
}

.search-box button {
    padding: 0.5rem 1rem;
    background: #0066cc;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.search-box button:hover {
    background: #0052a3;
}

/* ユーザーアクション */
.user-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-actions a {
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: #333;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.user-actions a:hover {
    background-color: #f0f0f0;
}

/* ドロップダウン */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    background: none;
    border: 1px solid #ddd;
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dropdown-toggle:hover {
    background-color: #f0f0f0;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0.5rem 0;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    z-index: 1000;
    min-width: 200px;
    list-style: none;
    margin: 0.5rem 0 0 0;
}

.dropdown-menu[hidden] {
    display: none;
}

.dropdown-menu li {
    margin: 0;
}

.dropdown-menu a {
    display: block;
    padding: 0.75rem 1rem;
    color: #333;
    text-decoration: none;
    transition: background-color 0.2s;
}

.dropdown-menu a:hover {
    background-color: #f0f0f0;
}

/* 視覚的に隠す */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border-width: 0;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border-width: 0;
}

/* ========================================
   レスポンシブデザイン (モバイル)
   ======================================== */
@media (max-width: 992px) {
    .menu-toggle {
        display: block; /* モバイルで表示 */
    }
    
    .main-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        border-top: 1px solid #ddd;
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    }
    
    .main-menu-list {
        flex-direction: column;
        padding: 1rem;
    }
    
    .main-menu-list[hidden] {
        display: none;
    }
    
    .main-menu-list a {
        padding: 1rem;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .search-box {
        display: none; /* モバイルでは非表示 */
    }
}

@media (min-width: 993px) {
    /* デスクトップでは常に表示 */
    .main-menu-list {
        display: flex !important;
    }
    
    .main-menu-list[hidden] {
        display: flex !important;
    }
}

/* ========================================
   アクセシビリティバーのスタイル
   ======================================== */
.accessibility-bar {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 0.5rem 0;
}

.accessibility-options {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    position: relative;
}


/* ================================
   Quiz Question Form – SAFE CSS
   一時対応用（JS/CSS衝突回避）
================================ */

/* 強制的に非表示指定を解除（ID重複対策） */
#options-container,
#dynamic-extra-container {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* 選択肢ブロック */
#options-container {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e5e5e5;
}

/* 選択肢リスト */
#options-list .option-item {
    padding: 8px 0;
}

/* 入力フィールド */
#options-list input[type="text"],
#dynamic-extra-container input[type="text"] {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* 正解チェック部分 */
#options-list .form-check {
    margin-top: 6px;
}

/* 削除ボタン */
#options-list .remove-option {
    min-width: 36px;
    height: 36px;
    line-height: 1;
}

/* true / false */
#dynamic-extra-container label {
    display: block;
    margin-bottom: 6px;
    cursor: pointer;
}

/* 見出し */
#options-container h4,
#dynamic-extra-container h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
}

/* 念のため、hidden 系を無効化 */
[hidden] {
    display: block !important;
}

.option-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.option-label {
    font-size: 0.9rem;
    color: #666;
}

.option-btn {
    padding: 0.25rem 0.75rem;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.option-btn:hover {
    background: #f0f0f0;
}

.option-btn.active {
    background: #0066cc;
    color: white;
    border-color: #0066cc;
}

/* アクセシビリティトグルボタン */
.accessible-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.accessible-toggle .menu-icon {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 24px;
}

.accessible-toggle .menu-icon span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: #333;
    transition: transform 0.3s ease;
}

.accessible-toggle.active .menu-icon span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.accessible-toggle.active .menu-icon span:nth-child(2) {
    opacity: 0;
}

.accessible-toggle.active .menu-icon span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* オプショングループリスト */
.option-group-list {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1rem;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    z-index: 1000;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.option-group-list[hidden] {
    display: none;
}

/* カラープレビュー */
.color-preview {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #ddd;
}

.color-preview.default {
    background: linear-gradient(135deg, #fff 50%, #333 50%);
}

.color-preview.dark {
    background: #333;
}

.color-preview.light {
    background: #f8f9fa;
}

.color-preview.blue {
    background: #0066cc;
}

.color-preview.yellow {
    background: #ffc107;
}

/* トグルボタン */
.toggle-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toggle-icon::before {
    content: '☐';
}

.toggle-btn.active .toggle-icon::before {
    content: '☑';
}
