/* 全体レイアウト */
body {
    background-color: #f4f6f8;
    color: #333;
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

a {
    text-decoration: none;
}

h1,
h2,
h3 {
    font-weight: bold;
}

.container,
.main-container {
    /* ← 上マージン小さめ、下は保持 */
    padding: 0 1em;
    margin: 0.5em auto 2em;
    max-width: 960px;
}

/* ナビゲーション */
.admin-header {
    /* ← 小さくした */
    font-size: 0.95em;
    background-color: #007bff;
    border-radius: 6px;
    color: white;
    margin-bottom: 1em;
    padding: 0.5em 1em;
}

.admin-header .header-top {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

.admin-header .title {
    font-size: 1.2em;
    font-weight: bold;
}

.admin-header .username {
    font-size: 0.9em;
    text-align: right;
}

.admin-header nav {
    margin-top: 0.5em;
}

.admin-header nav a {
    color: white;
    margin-right: 1em;
    text-decoration: underline;
}

/* テーブル */
table {
    border-collapse: collapse;
    margin-top: 1em;
    width: 100%;
}

th,
td {
    border: 1px solid #ccc;
    padding: 0.75em;
}

tr:nth-child(even) {
    background-color: #f2f2f2;
}

/* ボタン（リンク式） */
/* 編集・削除ボタン */
.btn {
    border-radius: 4px;
    cursor: pointer;
    display: inline-block;
    font-size: 0.9em;
    margin-right: 0.5em;
    padding: 0.4em 0.8em;
    text-decoration: none;
    vertical-align: top;
    white-space: nowrap;
}

.btn.edit {
    background-color: #ffc107;
    color: black;
}

.btn.delete {
    background-color: #dc3545;
    color: white;
}

.btn.primary {
    background-color: #3498db;
    border-radius: 6px;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    padding: 0.75em 1.5em;
    padding: 1em;
    transition: background-color 0.3s ease-in-out;
    width: auto;
}

.btn.primary:hover {
    background-color: #2980b9;
}

.btn.secondary {
    width: auto;
    display: inline-block;
    padding: 12px 20px;
}

.btn.secondary:hover {
    background-color: #7f8c8d;
}

.btn.logout {
    font-size: 0.95em;
    padding: 0.5em 0.8em;
    text-decoration: none;
    width: auto;
    width: auto !important;
}

/* 編集・削除ボタン用のtd */
td.actions {
    text-align: center;
    vertical-align: top;
    white-space: nowrap;
}

/* ログイン画面専用 */
.login-container {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin: 100px auto;
    max-width: 400px;
    padding: 40px;
    text-align: center;
    width: 100%;
}

.login-container h1 {
    color: #2c3e50;
    font-size: 36px;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 0.5em;
    text-align: left;
}

.form-group label {
    color: #2c3e50;
    display: block;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 0.5em;
}

.form-group input {
    border-radius: 5px;
    border: 1px solid #bdc3c7;
    font-size: 16px;
    margin-bottom: 15px;
    padding: 12px;
    transition: border-color 0.3s ease-in-out;
    width: 100%;
}

.form-group input:focus {
    border-color: #3498db;
    outline: none;
}

.success-message {
    color: #2ecc71;
    font-size: 16px;
    margin-bottom: 20px;
}

.error-message {
    color: #e74c3c;
    font-size: 16px;
    margin-bottom: 20px;
}

form {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    padding: 2em;
}

input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
    border-radius: 6px;
    border: 1px solid #ccc;
    box-sizing: border-box;
    font-size: 1em;
    padding: 0.75em;
    width: 100%;
}

textarea {
    resize: vertical;
}

/* === 以下、merged.final.css より統合 === */
/* 全体のレイアウト */
body {
    background-color: #f4f6f8;
    color: #333;
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

/* ナビゲーションバー */
.navbar {
    background-color: #3498db;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    color: white;
    padding: 15px 0;
}

.navbar .container {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin: 0 auto;
    max-width: 1200px;
    padding: 0 20px;
}

.navbar .logo {
    color: white;
    font-size: 26px;
    font-weight: bold;
    letter-spacing: 1px;
    text-decoration: none;
}

.navbar-links a {
    border-radius: 5px;
    color: white;
    font-size: 16px;
    padding: 12px 20px;
    text-decoration: none;
    transition: background-color 0.3s ease-in-out;
}

.navbar-links a:hover {
    background-color: #2980b9;
}

.main-container {
    margin: 2em auto;
    max-width: 960px;
    padding: 1em;
}

/* ログインページ */
.login-container {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin: 100px auto;
    max-width: 400px;
    padding: 40px;
    text-align: center;
    width: 100%;
}

.btn {
    background-color: #3498db;
    border-radius: 5px;
    color: white;
    cursor: pointer;
    display: inline-block;
    font-weight: bold;
    padding: 12px 20px;
    text-decoration: none;
    transition: background-color 0.3s;
    width: 100%;
}

.btn:hover {
    background-color: #2980b9;
}

/* ダッシュボード */
.index-container {
    margin: 50px auto;
    max-width: 1200px;
    padding: 0 20px;
}

.index-container h2 {
    color: #2c3e50;
    font-size: 32px;
    margin-bottom: 20px;
}

.dashboard {
    display: flex;
    gap: 20px;
    justify-content: space-between;
    margin-top: 30px;
}

.dashboard-item {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    padding: 25px;
    text-align: center;
    width: 48%;
}

.dashboard-item h3 {
    color: #2c3e50;
    font-size: 26px;
    margin-bottom: 10px;
}

.dashboard-item p {
    color: #34495e;
    font-size: 18px;
}

.dashboard-item .btn {
    margin-top: 20px;
    width: auto;
}

/* 問題ページ */
.drill-container {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin: 50px auto;
    max-width: 650px;
    padding: 40px;
    width: 100%;
}

.drill-container h1 {
    color: #2c3e50;
    font-size: 32px;
    margin-bottom: 30px;
}

.question-text {
    color: #2c3e50;
    font-size: 1.2em;
    font-size: 1.3em;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 1.5em;
    margin-bottom: 20px;
}

.choices {
    display: flex;
    flex-direction: column;
    gap: 0.2em;
    margin-bottom: 2em;
    margin-bottom: 30px;
}

.choice {
    background: #eef6ff;
    border-radius: 8px;
    border: 2px solid transparent;
    color: #34495e;
    cursor: pointer;
    display: block;
    font-size: 1.05em;
    font-size: 16px;
    font-size: 1em;
    margin-bottom: 15px;
    padding-left: 20px;
    padding: 0.8em 1em;
    padding: 1em;
    transition: all 0.2s;
}

.choice input {
    margin-right: 10px;
}

.error-message,
.success {
    font-size: 18px;
    margin-top: 20px;
    text-align: center;
}

.success {
    color: #2ecc71;
}

/* 共通ボタンスタイル */
.btn.primary {
    background-color: #3498db;
    border-radius: 5px;
    color: white;
    cursor: pointer;
    font-weight: bold;
    padding: 12px 20px;
    transition: background-color 0.3s ease-in-out;
    width: 100%;
}

.guest-info {
    margin-top: 30px;
    text-align: left;
}

.guest-info a {
    color: #3498db;
    text-decoration: none;
}

.guest-info a:hover {
    text-decoration: underline;
}

.score-card {
    background-color: #ffffff;
    border-left: 5px solid #007bff;
    border-radius: 10px;
    border: 1px solid #ddd;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    padding: 1.5em;
    transition: 0.3s;
}

.score-card:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.score-card .emoji {
    font-size: 1.2em;
    margin-right: 0.5em;
}

.score-details {
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 1em;
}

.btn.back {
    background: transparent;
    border: none;
    color: #555;
    font-size: 0.95em;
    padding: 0.5em 0.8em;
    text-decoration: none;
}

.btn.back:hover {
    color: red;
    text-decoration: none;
}

.btn.login {
    box-sizing: border-box;
    max-width: 100%;
    text-align: center;
}

.category-group {
    margin-bottom: 2em;
}

.category-group h4 {
    border-left: 4px solid #3498db;
    color: #2c3e50;
    font-size: 1.2em;
    margin-bottom: 0.5em;
    padding-left: 10px;
}

.category-grid input[type="checkbox"] {
    /* チェックボックス自体を少し小さく */
    margin-right: 6px;
    transform: scale(0.9);
}

.accordion-toggle {
    background-color: #3498db;
    border-radius: 6px;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: bold;
    margin-bottom: 5px;
    padding: 0.4em 0.8em;
    text-align: left;
    transition: background-color 0.2s;
    width: 100%;
}

.accordion-toggle:hover {
    background-color: #2980b9;
}

.accordion-content {
    display: none;
    margin-bottom: 0.5em;
    padding: 0.5em 0 0.5em 1em;
}

.accordion-section.active .accordion-content {
    display: block;
}

/* グリッドも詰め気味に */
.category-grid {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.category-grid label {
    background: #fff;
    border-radius: 4px;
    border: 1px solid #ccc;
    display: block;
    font-size: 0.9em;
    padding: 6px 8px;
}

/* 以下は drill.php から統合されたスタイル */
/*
        body {
  background: #f4f6f8;
  font-family: sans-serif;
  margin: 0;
  padding: 0;
}

*/
.drill-container {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin: 2em auto;
    max-width: 720px;
    padding: 2em;
}

h1 {
    color: #333;
    font-size: 1.8em;
    margin-bottom: 1em;
    text-align: center;
}

.choice:hover {
    background: #dceeff;
    border-color: #3399ff;
}

.choice input[type="radio"] {
    margin-right: 0.8em;
    transform: scale(1.2);
}

/* 以下は index.php から統合されたスタイル */
button:disabled {
    background-color: #ccc !important;
    border-color: #aaa !important;
    color: #666 !important;
    cursor: not-allowed !important;
}

/* 以下は check_answer.php から統合されたスタイル */
.result-container {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin: 2em auto;
    max-width: 720px;
    padding: 2em;
    text-align: center;
}

h2 {
    font-size: 1.8em;
    margin-bottom: 1em;
    text-align: center;
}

.result-container p {
    font-size: 1.1em;
    margin: 0.5em 0;
}

.next-buttons {
    display: flex;
    gap: 1.5em;
    justify-content: center;
    margin-top: 2em;
}

@media screen and (max-width: 600px) {
    .drill-container {
        padding: 1em;
        margin: 1em auto;
    }
}

.navbar-links {
    align-items: center;
    display: flex;
    gap: 0.5em;
}

.profile-actions {
    display: flex;
    justify-content: center;
    gap: 1em;
    margin-top: 2em;
}

.profile-actions .btn {
    width: auto;
}

.modal {
    display: none; /* 初期は非表示 */
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 2em;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
    border-radius: 8px;
    position: relative;
}

.modal .close {
    color: #aaa;
    position: absolute;
    right: 1em;
    top: 1em;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.modal .close:hover {
    color: #000;
}
