:root {
    --main-theme-color: #4168E1;
    --main-theme-color-hover: #3556b8;
    --main-theme-color-light: #b0c4de; /* 薄い青 */
}

body {
    background-color: #fff;
    font-family: sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box; /* パディングとボーダーを幅に含める */
    overflow-x: hidden; /* 横スクロールを禁止 */
}

body.admin-mode-active {
    --main-theme-color: #d93025; /* 赤色 */
    --main-theme-color-hover: #b0251c; /* 少し濃い赤色 */
    --main-theme-color-light: #f5c2bf; /* 薄い赤色 */
}

/* ヘッダー */
.site-header {
    background-color: #fff;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: center; /* タイトルを中央に */
    position: relative;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.site-title {
    margin: 0;
    font-size: 1.2em;
    color: #333;
    font-weight: bold;
}

/* ハンバーガーメニュー */
.menu-toggle {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 1200; /* ナビゲーションメニューより手前に */
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: #333;
    border-radius: 3px;
    transition: all 0.3s ease-in-out;
}

.menu-toggle.active span {
    background-color: #333;
}

.menu-toggle.active span:nth-child(1) {
    transform: translateY(10.5px) rotate(45deg);
}

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

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-10.5px) rotate(-45deg);
}

/* ナビゲーションメニュー */
.main-nav {
    position: fixed;
    top: 0;
    right: 0;
    width: 250px;
    height: 100%;
    background-color: #fff;
    box-shadow: -2px 0 5px rgba(0,0,0,0.2);
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    z-index: 1100;
}

.main-nav.active {
    transform: translateX(0);
}

/* 全体を囲む外側の枠線付きコンテナ */
.outer-container {
    width: 80vw; /* 画面幅の80% */
    margin: 20px auto; /* 上下20px、左右autoで中央寄せ */
    /* 背景、影、パディング等をなくし、純粋なレイアウトコンテナとする */
    display: flex; /* 子要素（曜日表示、区切り線、セクション）をflexboxで配置 */
    flex-direction: column; /* 子要素を縦に並べる */
    align-items: center; /* 子要素を中央寄せ */
    text-align: center; /* テキストを中央寄せ */
}

/* 曜日表示を囲むコンテナ */
.day-display-container {
    width: 70vw; /* content-containerと同じ幅 */
    max-width: 600px;
    text-align: center; /* 曜日表示を中央寄せ */
    margin-bottom: 10px; /* 曜日表示とボタンの間にスペース */
}

/* 曜日を表示する要素のスタイル */
#current-day {
    margin: 0; /* マージンをリセット */
    font-size: 2em; /* 曜日のフォントサイズを調整 */
    color: #222; /* テキストカラーを黒っぽくしました */
    font-weight: bold; /* 曜日を太字にする */
    user-select: none; /* テキスト選択を防ぐ */
    -webkit-user-select: none; /* Safari */
    -ms-user-select: none; /* IE 10+ */
}

/* 講義室番号入力ボタンを囲むコンテナ */
.classroom-button-container {
    width: 70vw; /* content-containerと同じ幅 */
    max-width: 600px;
    margin-bottom: 15px; /* ボタンと区切り線の間にスペース */
    display: flex;
    justify-content: space-between;
    align-items: center;
}


/* 講義室番号入力ボタンのスタイル */
.classroom-entry-button {
    padding: 8px 15px; /* パディングを小さく調整 */
    font-size: 0.9em;
    cursor: pointer;
    border-radius: 5px;
    background-color: #fff; /* 白色の背景に変更 */
    border: 2px solid #b0c4de; /* 上部の薄い青色に合わせ、少し太くする */
    color: #333; /* テキストカラーを黒っぽく変更 */
    transition: background-color 0.3s ease, border-color 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05); /* 影を追加して浮かび上がらせる */
}

.classroom-entry-button:hover {
    background-color: #f8f8f8; /* ホバー時の背景色を調整 */
    border-color: #96a9c2; /* ホバー時の枠線色を少し濃い青に */
    color: #333; /*テキストカラーは維持 */
}

/* 管理メニューボタンのスタイル */
.admin-button {
    background-color: var(--main-theme-color);
    border-color: var(--main-theme-color-hover);
    color: white;
}

/* 管理モード表示 */
#admin-mode-indicator {
    position: absolute;
    bottom: 5px; /* 線の上に配置 */
    left: 50%;
    transform: translateX(-50%);
    color: var(--main-theme-color);
    font-weight: bold;
    margin: 0;
    display: none; /* JSで表示を制御 */
    white-space: nowrap; /* 折り返しを防ぐ */
}

/* 区切り線と管理モード表示のラッパー */
.divider-wrapper {
    position: relative;
    width: 70vw;
    max-width: 600px;
    margin: 15px 0;
}

/* 区切り線のスタイル */
.divider {
    width: 100%;
    border: none; /* デフォルトのボーダーを削除 */
    border-top: 2px solid #ccc; /* 区切り線のスタイル（色、太さ、種類） */
    margin: 0;
}

/* ヘッダー下のライン */
.header-lines {
    width: 100%;
}

.line-thin {
    height: 3px;
    background-color: var(--main-theme-color);
}

.line-thick {
    height: 10px;
    background-color: var(--main-theme-color-light);
}

/* 各曜日のセクションをまとめるコンテナの基本スタイル */
.weekday-sections {
    display: none; /* デフォルトでは非表示 */
    width: 100%; /* 親要素の幅に合わせる */
    display: flex; /* 子要素をflexboxで配置 */
    flex-direction: column; /* 子要素を縦に並べる */
    align-items: center; /* 子要素を中央寄せ */
}

/* 内側のコンテンツ（テキストとボタン）を囲む枠線付きのコンテナ */
.content-container {
    width: 70vw; /* 画面幅の70% */
    max-width: 600px;
    border: 2px solid #4168E1; /* テーマカラーから独立した色に変更 */
    border-radius: 10px; /* 内側枠線の角を丸くする */
    padding: 25px 20px; /* コンテナ内の余白を調整 */
    background-color: #fff; /* コンテナの背景色 */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* 影を追加 */
    display: flex; /* 子要素をflexboxで配置 */
    flex-direction: column; /* 子要素を縦に並べる */
    align-items: center; /* 子要素（h1とbutton）を中央寄せに戻す */
    /* text-align: center; 子要素内のテキスト配置は個別に調整 */
    margin-bottom: 20px; /* セクション間の余白を追加 */
}

/* 各曜日の最後のcontent-containerの下マージンは不要 */
.weekday-sections .content-container:last-child {
     margin-bottom: 0;
}

/* 時間外の場合に表示されるメッセージ */
.no-class-message {
    color: #555;
    font-size: 1.2em;
    margin-top: 20px;
    display: none; /* JavaScriptで表示を制御 */
}


/* 時間表示を含む左寄せ用のコンテナ */
.left-aligned-container {
    width: 100%; /* content-containerの幅に合わせる */
    text-align: left; /* テキストを左寄せ */
    margin-bottom: 5px; /* 時間とh1の間のスペース */
}

/* 時間表示のスタイル */
.course-time {
    font-size: 1.1em; /* フォントサイズを調整 */
    color: #555;
    margin-bottom: 0; /* 親要素でマージンを設定するため0に */
    margin-top: 0; /* 上の要素との余白をなくす */
}

h1 {
    margin-top: 0; /* 上の要素との余白をなくす */
    margin-bottom: 25px; /* テキストとボタンの間にスペースを調整 */
    color: #333;
    font-size: 20px; /* フォントサイズを調整 */
    margin-left: 0; /* 左マージンを削除 */
    text-align: center; /* h1自体を中央寄せ */
    width: 100%; /* 中央寄せのために幅を100%に */
}

.transition-button {
    /* ボタンの角を丸くする */
    border-radius: 10px; /* 角の丸みを調整 */
    /* 四角い形状に合わせてパディングを調整 */
    padding: 8px 25px; /* 上下、左右のパディングを調整 */
    font-size: 16px; /* フォントサイズを調整 */
    cursor: pointer;
    border: none;
    background-color: #4168E1; /* テーマカラーから独立した色に変更 */
    /* ボタンのテキストカラー */
    color: #FFFFFF;
    transition: background-color 0.3s ease;
}

.transition-button:hover {
    background-color: #3556b8; /* テーマカラーから独立した色に変更 */
    /* ホバー時のテキストカラーは白を維持 */
    color: #FFFFFF;
}

/* メニューオーバーレイのスタイル */
.menu-overlay {
    position: fixed; /* 画面全体を覆う */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* 半透明の黒背景 */
    display: none; /* デフォルトでは非表示 */
    justify-content: center; /* メニューを中央寄せ */
    align-items: center;
    z-index: 1000; /* 他の要素より手前に表示 */
}

.main-nav ul {
    list-style: none;
    padding: 80px 0 0 0;
    margin: 0;
}

.main-nav ul li a {
    display: block;
    padding: 15px 25px;
    color: #333;
    text-decoration: none;
    font-size: 1.1em;
    transition: background-color 0.2s;
}

.main-nav ul li a:hover {
    background-color: #e9ecef;
}

/* ナビゲーションメニュー内の区切り線 */
.nav-separator {
    padding: 5px 25px;
}

.nav-separator hr {
    border: none;
    border-top: 1px solid #e0e0e0;
}

/* Welcome Overlay specific styles */
#welcomeOverlay .scrollable-content > p {
    text-align: left;
}

.welcome-instructions-list {
    list-style-type: none;
    padding-left: 0;
    text-align: left; /* Align text to the left */
    width: 100%; /* Take full width of parent */
    margin-top: 10px;
    margin-bottom: 10px;
    color: #333;
    box-sizing: border-box;
}

.welcome-instructions-list li {
    margin-bottom: 15px;
}

.welcome-instructions-list li strong {
    display: block;
    margin-bottom: 5px;
}

.welcome-instructions-list li p {
    margin: 0;
    padding-left: 1.2em; /* Indent the answer */
    text-indent: -1.2em; /* Hanging indent for 'A.' */
}

.faq-section {
    margin-top: 20px;
}

.faq-section hr {
    border: none;
    border-top: 1px solid #ccc;
}

.faq-title {
    font-weight: bold;
    text-align: left;
}

.welcome-checkbox-container {
    display: flex;
    align-items: center;
    justify-content: center; /* Align content to the center */
    width: 100%; /* Take full width of parent */
    margin-top: 20px;
    margin-bottom: 15px;
    font-size: 0.9em;
    color: #555;
    box-sizing: border-box; /* Include padding in width */
}

/* 管理メニュー内のコントロールをまとめるコンテナ */
.admin-menu-controls {
    width: 100%;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* トグルスイッチのコンテナ */
.toggle-switch-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0 10px; /* 左右に少しパディング */
    box-sizing: border-box;
}

.toggle-switch-container span {
    font-size: 1em;
    color: #333;
}

/* トグルスイッチ本体 */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

/* チェックボックスを隠す */
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* スライダーのスタイル */
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--main-theme-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* 丸いスライダー */
.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* メニューコンテンツのスタイル */
.menu-content {
    background-color: #fff;
    padding: 25px; /* パディングを小さく調整 */
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    text-align: center;
    width: 90%;
    max-width: 400px;
    display: flex; /* 子要素をflexboxで配置 */
    flex-direction: column; /* 子要素を縦に並べる */
    align-items: center; /* 子要素を中央寄せ */
    /* メニューに枠線を追加 */
    border: 1px solid #333; /* セクションの枠線と同じスタイル */
    box-sizing: border-box;
}

#adminMenu .menu-content {
    max-height: 480px;
}

/* Welcome Overlayのメニューコンテンツの最大幅を他のメニューと合わせる */
#welcomeOverlay .menu-content {
    max-height: 480px;
    max-width: 400px;
}


.menu-content h2 {
    margin-top: 0;
    margin-bottom: 15px; /* マージンを小さく調整 */
    color: #333;
    font-size: 1.2em; /* フォントサイズを調整 */
}

/* メニュー内のクラスボタンを囲むコンテナのスタイル */
.class-buttons-grid {
    display: grid; /* グリッドレイアウトを使用 */
    grid-template-columns: repeat(2, 1fr); /* 2列で、各列の幅は均等 */
    gap: 20px; /* ボタン間の隙間を小さく調整 */
    margin-bottom: 15px; /* ボタンと閉じるボタンの間のスペースを小さく調整 */
    width: 100%; /* 親要素の幅に合わせる */
}


/* メニュー内の一般的なボタンのスタイル（閉じるボタン以外） */
/* close-menu-button および reset-button 以外のボタンに適用 */
.class-buttons-grid button {
    margin: 0; /* グリッドのgapで余白を調整するためマージンを0に */
    padding: 8px 15px; /* パディングを小さく調整 */
    font-size: 0.9em; /* フォントサイズを小さく調整 */
    cursor: pointer;
    border-radius: 8px; /* 角の丸みを小さく調整 */
    background-color: #4168E1; /* テーマカラーから独立した色に変更 */
    border: none;
    color: white; /* テキストカラーを白に */
    transition: background-color 0.3s ease, color 0.3s ease;
    width: 100%; /* グリッドセルに合わせて幅を100%に */
}

.class-buttons-grid button:hover {
     background-color: #3556b8; /* テーマカラーから独立した色に変更 */
     color: white; /* ホバー時のテキストカラー */
}

/* 閉じるボタンのスタイルを個別に指定 */
.close-menu-button {
    margin: 10px;
    padding: 8px 15px; /* メニュー内の他のボタンと同じパディング */
    font-size: 0.9em; /* メニュー内の他のボタンと同じフォントサイズ */
    cursor: pointer;
    border-radius: 5px; /* 角丸は元のまま */
    /* 閉じるボタンの背景色を#E5E5E5に変更 */
    background-color: #E5E5E5; /* 薄いグレーの背景に戻す */
    /* 閉じるボタンの枠線スタイル */
    border: 1px solid #ccc; /* 薄いグレーの枠線に戻す */
    /* 閉じるボタンのテキストカラーを黒っぽく変更 */
    color: #333; /* テキストカラーを黒っぽく戻す */
    transition: background-color 0.3s ease, border-color 0.3s ease; /* ホバー時のトランジションを調整 */
    width: 80%; /* 幅を調整 */
}

.close-menu-button:hover {
    /* 閉じるボタンのホバー時の背景色を調整 */
    background-color: #d0d0d0; /* #E5E5E5より少し濃い色 */
    border-color: #b0b0b0; /* ホバー時の枠線色 */
    color: #333; /*テキストカラーは維持 */
}

 /* 開発メニュー内の「解除」ボタンのスタイル */
.reset-button {
    /* .day-selection-grid button のスタイルを継承 */
    margin: 0; /* グリッドのgapで余白を調整するためマージンを0に */
    padding: 8px 15px; /* パディングを小さく調整 */
    font-size: 0.9em; /* フォントサイズを小さく調整 */
    cursor: pointer;
    border-radius: 8px; /* 角の丸みを小さく調整 */
    width: 100%; /* グリッドセルに合わせて幅を100%に */
    text-align: center; /* テキスト中央寄せ */
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease; /* ホバー時のトランジションを調整 */

    /* 薄いグレーの背景に変更 */
    background-color: #E5E5E5;
    border: 1px solid #ccc;
    color: #333;
}

.reset-button:hover {
    /* ホバー時の背景色を調整 */
    background-color: #d0d0d0; /* #E5E5E5より少し濃い色 */
    border-color: #b0b0b0; /* ホバー時の枠線色 */
    color: #333; /*テキストカラーは維持 */
}


/* グレーアウトされたボタンのスタイル */
.grayed-out-button {
    background-color: #e0e0e0 !important; /* 薄いグレーの背景 */
    color: #a0a0a0 !important; /* グレーのテキスト */
    cursor: not-allowed !important; /* カーソルを禁止マークに */
    pointer-events: none; /* クリックイベントを無効化 */
}

/* 講義室番号入力メニュー内の入力フィールド */
#classroomNumberInput {
    padding: 8px; /* パディングを小さく調整 */
    margin-bottom: 15px; /* マージンを小さく調整 */
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1em;
    width: 100%; /* 幅を調整 */
    box-sizing: border-box; /* パディングとボーダーを幅に含める */
    text-align: center; /* テキストを中央揃えにする */
}

/* Welcome Overlayのチェックボックス */
.welcome-checkbox-container input[type="checkbox"] {
    margin-right: 8px;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* 入力ボックスのフォーカス時のスタイル */
#classroomNumberInput:focus {
    outline: none; /* フォーカス時のアウトラインを削除 */
}

/* 講義室番号入力メニュー内の登録ボタン */
.classroom-submit-button {
     /* 青色ボタンのスタイルをコピー */
    padding: 8px 15px; /* パディングを小さく調整 */
    font-size: 0.9em; /* フォントサイズを小さく調整 */
    cursor: pointer;
    border-radius: 8px; /* 角の丸みを小さく調整 */
    background-color: #4168E1; /* テーマカラーから独立した色に変更 */
    border: none;
    color: white;
    transition: background-color 0.3s ease, color 0.3s ease;
    width: 80%;
}

 .classroom-submit-button:hover {
     background-color: #3556b8; /* テーマカラーから独立した色に変更 */
     color: white; /* ホバー時のテキストカラー */
}

/* 講義室指定メニューのボタンコンテナ */
.menu-button-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
    width: 100%;
    margin-top: 15px;
}

.menu-button-container .classroom-submit-button,
.menu-button-container .close-menu-button {
    width: 100%;
    margin: 0;
}

/* 管理メニューのトグルコンテナ */
.admin-toggles-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    width: 100%;
    margin-bottom: 0;
}

/* 開発メニュー内の曜日選択エリアのラッパー */
.day-selection-wrapper {
    width: 100%;
    border-top: 1px solid #ccc;
    /* border-bottom: 1px solid #ccc; */
    padding: 15px 10px;
    margin-top: 20px;
    margin-bottom: 0;
    box-sizing: border-box;
}

.force-display-label {
    font-size: 0.8em;
    color: #555;
    margin: 0 0 10px 0;
    font-weight: bold;
    text-align: left;
}

/* 開発メニュー内の曜日選択ボタンを囲むコンテナ */
.day-selection-grid {
    display: grid; /* グリッドレイアウトを使用 */
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); /* レスポンシブなグリッド */
    gap: 20px; /* ボタン間の隙間を他のメニューに合わせる */
    margin-bottom: 0; /* ラッパーで制御するため0に */
    width: 100%; /* 親要素の幅に合わせる */
}

/* 開発メニュー内の曜日選択ボタンのスタイル */
.day-selection-grid button:not(.reset-button) {
    margin: 0; /* グリッドのgapで余白を調整するためマージンを0に */
    padding: 8px 15px; /* パディングを小さく調整 */
    font-size: 0.9em; /* フォントサイズを小さく調整 */
    cursor: pointer;
    border-radius: 8px;
    background-color: #4168E1; /* 他のボタンと色を統一 */
    border: none; 
    color: white;
    transition: background-color 0.3s ease, color 0.3s ease;
    text-align: center; /* テキスト中央寄せ */
    width: 100%; /* グリッドセルに合わせて幅を100%に */
}

.day-selection-grid button:not(.reset-button):hover {
    background-color: #3556b8; /* 他のボタンと色を統一 */
    color: white;
}

/* 管理メニューの無効化されたオプション */
.admin-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* 管理メニュー内のスクロール可能領域 */
.scrollable-content {
    overflow-y: auto;
    width: 100%;
    margin-bottom: 15px;
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.scrollable-content::-webkit-scrollbar {
    display: none; /* for Chrome, Safari, and Opera */
}

/* ウェルカム表示コントロール */
.welcome-overlay-controls {
    width: 100%;
    border-top: 1px solid #ccc;
    padding: 15px 10px;
    margin-top: 20px;
    box-sizing: border-box;
}

.welcome-overlay-controls .control-label {
    font-size: 0.8em;
    color: #555;
    margin: 0 0 10px 0;
    font-weight: bold;
    text-align: left;
}

.admin-action-wrapper {
    width: 100%;
    border-top: 1px solid #ccc;
    padding: 15px 10px;
    margin-top: 20px;
    box-sizing: border-box;
    text-align: left;
}

.admin-action-wrapper .control-label {
    font-size: 0.8em;
    color: #555;
    margin: 0 0 10px 0;
    font-weight: bold;
    text-align: left;
}

.admin-action-button {
    display: block;
    width: 100%;
    margin-bottom: 10px;
    padding: 8px 15px;
    font-size: 0.9em;
    cursor: pointer;
    border-radius: 8px;
    background-color: #4168E1; /* 青色 */
    border: none;
    color: white;
    transition: background-color 0.3s ease;
    box-sizing: border-box;
}

.admin-action-button:last-child {
    margin-bottom: 0;
}

.admin-action-button:hover {
    background-color: #3556b8; /* 濃い青色 */
}
