/*
   * @fileoverview アプリケーション全体のスタイルシートです。
   * デザインシステム（色、フォント、余白など）を定義し、
   * 各コンポーネントのスタイルをBEMライクな命名規則で記述しています。
   */

/* ==========================================================================
   *  1. Root Variables (基本変数)
   * ========================================================================== */
:root {
  /* Color Palette */
  --primary-color: #304ffe;
  --primary-color-dark: #0026ca;
  --primary-color-light: #7a7cff;
  --secondary-color: #616161;
  --secondary-color-dark: #373737;
  --accent-color: #ffab00;
  --background-color: #f4f6f8;
  --card-background-color: #ffffff;
  --text-color: #212121;
  --text-light-color: #757575;
  --border-color: #e0e0e0;
  --success-color: #4caf50;
  --success-background-color: #e8f5e9;
  --success-border-color: #a5d6a7;
  --error-color: #f44336;
  --error-background-color: #ffebee;
  --error-border-color: #ef9a9a;

  /* Typography */
  --font-family-headings: "Montserrat", sans-serif;
  --font-family-body: "Nunito", sans-serif;

  /* UI Elements */
  --card-shadow: 0 5px 15px rgba(0, 0, 0, 0.08), 0 3px 8px rgba(0, 0, 0, 0.05);
  --card-border-radius: 12px;
}

/* ==========================================================================
   *  2. Base & Layout Styles (基本・レイアウトスタイル)
   * ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: var(--font-family-body);
  margin: 0;
  background-color: var(--background-color);
  color: var(--text-color);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  padding: 15px;
  line-height: 1.6;
}

.app-container {
  width: 100%;
  max-width: 650px;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.main-content {
  flex-grow: 1;
}

.mui-paper {
  background-color: var(--card-background-color);
  padding: 24px;
  border-radius: var(--card-border-radius);
  box-shadow: var(--card-shadow);
  width: 100%;
  margin-bottom: 24px;
}

#login-area {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

h1,
h2,
h3 {
  font-family: var(--font-family-headings);
  color: var(--text-color);
  margin-top: 0;
}

h2.section-title {
  font-size: 1.25rem;
  margin-top: 32px;
  margin-bottom: 16px;
  font-weight: 600;
  color: var(--text-color);
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

h3 {
  font-size: 1.25rem;
  margin-bottom: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
}

/* ==========================================================================
   *  3. Header & Footer (ヘッダーとフッター)
   * ========================================================================== */
.app-header {
  width: 100%;
  margin-bottom: 10px;
  padding: 10px 0;
  position: relative;
  z-index: 10;
}

.header-content {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  width: 100%;
}

.logo-container {
  display: flex;
  align-items: center;
  flex-shrink: 0; /* Prevent shrinking */
}

.header-content {
  display: flex;
  align-items: center; /* 垂直方向中央揃え */
  justify-content: center; /* ★★★ これを追加: Flexアイテムを水平方向中央に配置 */
  width: 100%;
  position: relative; /* ★★★ これを追加: 子要素の絶対配置の基準にする */
}

.app-title {
  font-size: clamp(1.6rem, 5vw, 2rem);
  margin: 0;
  font-weight: 700;
  color: var(--primary-color);
}

.app-title a {
  text-decoration: none; /* 下線を削除 */
  color: inherit; /* 親要素の色を継承 */
}

.app-title .header-icon {
  font-size: 1.1em;
  margin-right: 10px;
  vertical-align: middle;
}

.app-footer {
  width: 100%;
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.app-footer p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-light-color);
}

/* ==========================================================================
   *  4. Components (コンポーネント)
   * ========================================================================== */

/* --- Button --- */
.mui-button {
  font-family: var(--font-family-headings);
  background-color: var(--primary-color);
  color: white;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0.5px;
  transition:
    background-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.1s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-top: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.5;
}
.mui-button:hover {
  background-color: var(--primary-color-dark);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}
.mui-button:active {
  transform: translateY(1px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}
.mui-button.secondary {
  background-color: var(--secondary-color);
}
.mui-button.secondary:hover {
  background-color: var(--secondary-color-dark);
}
.mui-button.danger {
  background-color: var(--error-color);
}
.mui-button.danger:hover {
  background-color: #d32f2f;
}
.mui-button:disabled {
  background-color: #e0e0e0;
  color: #9e9e9e;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}
.mui-button.fullWidth {
  width: 100%;
}
.mui-button .button-icon {
  margin-right: 8px;
  font-size: 1.2em;
}

/* --- Quiz Options (PC/Tablet Radio Buttons) --- */
#quiz-length-options-container,
#quiz-algorithm-options-container,
#quiz-mode-options-container {
  /* ★追加 */
  display: none; /* Mobile-first: hidden by default */
  gap: 12px;
  margin-bottom: 24px;
}
#quiz-length-options-container label,
#quiz-algorithm-options-container label,
#quiz-mode-options-container label {
  /* ★追加 */
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px 18px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease;
  font-size: 0.95rem;
  white-space: nowrap;
}
#quiz-length-options-container label:hover,
#quiz-algorithm-options-container label:hover,
#quiz-mode-options-container label:hover {
  /* ★追加 */
  border-color: var(--primary-color-light);
  background-color: #f9f9f9;
}
#quiz-length-options-container input[type="radio"],
#quiz-algorithm-options-container input[type="radio"],
#quiz-mode-options-container input[type="radio"] {
  /* ★追加 */
  margin-right: 8px;
  accent-color: var(--primary-color);
  width: 1.1em;
  height: 1.1em;
}
#quiz-length-options-container input[type="radio"]:checked + span,
#quiz-algorithm-options-container input[type="radio"]:checked + span,
#quiz-mode-options-container input[type="radio"]:checked + span {
  /* ★追加 */
  font-weight: 700;
  color: var(--primary-color);
}

/* --- Quiz Options (Mobile Dropdown) --- */
#quiz-length-dropdown-container,
#quiz-algorithm-dropdown-container,
#quiz-mode-dropdown-container {
  /* ★追加 */
  position: relative;
  margin-bottom: 24px;
}
.mui-select {
  width: 100%;
  padding: 12px 40px 12px 16px;
  font-size: 1rem;
  font-family: var(--font-family-body);
  color: var(--text-color);
  background-color: #fff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}
#quiz-length-dropdown-container::after,
#quiz-algorithm-dropdown-container::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 16px;
  width: 8px;
  height: 8px;
  margin-top: -6px;
  border-style: solid;
  border-color: var(--text-color);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  pointer-events: none;
}
.mui-select:hover {
  border-color: var(--primary-color-light);
}
.mui-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(48, 79, 254, 0.25);
}

/* Style for the area selection button to look like a select dropdown */
.mui-select-like {
  width: 100%;
  padding: 12px 16px;
  font-size: 1rem;
  font-family: var(--font-family-body);
  color: var(--text-color);
  background-color: #fff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
}

.mui-select-like:hover {
  border-color: var(--primary-color-light);
}

/* --- Accordion --- */
#exam-accordion-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.accordion-item {
  border: 1px solid var(--border-color);
  border-radius: var(--card-border-radius);
  overflow: hidden;
}
.accordion-header {
  background-color: #f9f9f9;
  color: var(--text-color);
  cursor: pointer;
  padding: 15px 20px;
  width: 100%;
  border: none;
  text-align: left;
  outline: none;
  font-size: 1.1rem;
  font-weight: 600;
  transition: background-color 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.accordion-header:hover,
.accordion-header.active {
  background-color: #eef2f5;
}
.accordion-header .accordion-icon {
  margin-right: 10px;
  font-size: 1.5em;
  transition: transform 0.3s ease;
}
.accordion-title {
  flex-grow: 1;
}
.accordion-meta {
  font-size: 0.85rem;
  color: var(--text-light-color);
  margin-left: auto;
  padding-left: 15px;
  white-space: nowrap;
}
.accordion-header.active .accordion-icon {
  transform: rotate(180deg);
}
.accordion-panel {
  padding: 0 20px;
  background-color: white;
  max-height: 0;
  overflow: hidden;
  transition:
    max-height 0.3s ease-out,
    padding 0.3s ease-out;
}
.accordion-panel.active {
  padding: 20px;
}
.accordion-panel .accordion-description {
  font-size: 0.9rem;
  color: var(--text-light-color);
  margin-bottom: 16px;
  line-height: 1.5;
}
.accordion-panel .mui-button {
  width: 100%;
  margin-top: 12px;
}
.accordion-panel .mui-button:first-child {
  margin-top: 0;
}

/* --- Progress Bar --- */
.progress-bar-wrapper {
  margin-top: 24px;
}
.progress-bar-wrapper.top-progress {
  margin-top: 0;
  margin-bottom: 20px;
}
.progress-bar-wrapper.top-progress .progress-bar-container {
  height: 2px;
}
.progress-bar-wrapper.top-progress #top-progress-text {
  display: none;
}
.progress-bar-container {
  width: 100%;
  background-color: #e0e0e0;
  border-radius: 4px;
  height: 4px;
  overflow: hidden;
}
.progress-bar-fill {
  width: 0%;
  height: 100%;
  background-color: var(--accent-color);
  border-radius: 4px;
  transition: width 0.3s ease-in-out;
}
#progress-text {
  text-align: right;
  margin-top: 4px;
  font-size: 0.9rem;
  color: var(--text-light-color);
}

/* --- Question Elements --- */
.question-info-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
  font-size: 0.9rem;
}
.question-info-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.info-chip {
  background-color: #f0f2f5;
  padding: 6px 12px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  color: var(--text-light-color);
  font-weight: 500;
}
.info-chip .material-icons {
  font-size: 1.2em;
  margin-right: 6px;
  color: var(--secondary-color);
}
.info-chip strong {
  color: var(--text-color);
  font-weight: 700;
  margin-left: 4px;
}
.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag-item {
  background-color: #e8eaf6;
  color: #303f9f;
  padding: 5px 10px;
  border-radius: 16px;
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.4;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
#question-text {
  font-size: 1.1rem;
  line-height: 1.5;
  margin-bottom: 24px;
  font-weight: 600;
  word-break: break-word;
}

/* --- Feedback & Options --- */
.feedback-container {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  padding: 14px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1.05rem;
  border: 1px solid;
  word-break: break-word;
}
.feedback-icon {
  margin-right: 10px;
  font-size: 1.5em;
}
.feedback-container.correct {
  color: var(--success-color);
  background-color: var(--success-background-color);
  border-color: var(--success-border-color);
}
.feedback-container.incorrect {
  color: var(--error-color);
  background-color: var(--error-background-color);
  border-color: var(--error-border-color);
}
.options-list {
  margin: 0 0 24px 0;
  padding-left: 0;
  list-style-type: none;
}
.option-item {
  display: flex;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
  border-radius: 8px;
  margin-bottom: 10px;
  cursor: pointer;
}
.option-item:last-child {
  margin-bottom: 0;
}
.option-item:hover:not(.disabled-option) {
  background-color: #f9f9f9;
  border-color: var(--primary-color-light);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}
.option-item input[type="radio"] {
  margin-right: 12px;
  accent-color: var(--primary-color);
  width: 1.2em;
  height: 1.2em;
  margin-top: 0.3em;
}
.option-item label {
  font-size: 1rem;
  line-height: 1.3;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  cursor: inherit;
  word-break: break-word;
}
.option-item label .option-text-container {
  display: flex;
  align-items: baseline;
}
.option-item label .option-prefix {
  font-family: var(--font-family-headings);
  font-weight: 700;
  margin-right: 10px;
  color: var(--primary-color);
  min-width: 1.8em;
  text-align: left;
}
.option-item.correct-answer {
  background-color: var(--success-background-color);
  border-color: var(--success-color) !important;
}
.option-item.correct-answer label .option-text-container,
.option-item.correct-answer label .option-prefix {
  color: var(--success-color) !important;
  font-weight: 700;
}
.option-item.selected-incorrect {
  background-color: var(--error-background-color);
  border-color: var(--error-color) !important;
}
.option-item.selected-incorrect label .option-text-container {
  color: var(--error-color) !important;
  text-decoration: line-through;
}
.option-specific-explanation {
  font-size: 0.9rem;
  color: var(--text-light-color);
  margin-top: 8px;
  padding: 10px 12px;
  line-height: 1.5;
  background-color: #f0f2f5;
  border-radius: 6px;
  border-left: 3px solid var(--secondary-color);
  margin-left: calc(1.2em + 12px);
  word-break: break-word;
}

/* --- Explanations & Results --- */
#overall-explanation-container {
  margin-top: 28px;
  padding: 20px;
  background-color: #e9ecef;
  border-radius: var(--card-border-radius);
  border: 1px solid #ced4da;
}
#overall-explanation-container p {
  font-size: 0.95rem;
  line-height: 1.7;
  margin: 0;
  color: var(--text-color);
  word-break: break-word;
}
#result-area h2 {
  text-align: center;
  margin-bottom: 28px;
}
.chart-container {
  position: relative;
  width: 100%;
  max-width: 350px;
  min-height: 280px;
  margin: 0 auto 24px auto;
}
#area-chart-container {
  min-height: 300px;
  max-width: 500px;
}
#resultChart,
#areaResultChart {
  display: block;
  box-sizing: border-box;
  height: 100% !important;
  width: 100% !important;
}
#score-display {
  text-align: center;
  margin-bottom: 24px;
  padding: 20px;
  background-color: var(--background-color);
  border-radius: 8px;
}
#score-text {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 8px;
}
#accuracy-text {
  font-size: 1.2rem;
  color: var(--text-light-color);
  margin-bottom: 0;
}
.action-buttons-container {
  margin-top: 24px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.action-buttons-container .mui-button {
  flex-grow: 1;
}

/* --- Loading & Dialogs --- */
#loading-indicator {
  text-align: center;
  padding: 40px 20px;
}
#loading-indicator p {
  font-size: 1.1rem;
  color: var(--text-light-color);
}
.spinner {
  border: 5px solid rgba(0, 0, 0, 0.1);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border-left-color: var(--primary-color);
  animation: spin 0.8s linear infinite;
  margin: 0 auto 20px auto;
}
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
.custom-dialog {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}
.custom-dialog-content {
  padding: 24px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}
.custom-dialog-title {
  font-size: 1.4rem;
  margin-bottom: 16px;
  color: var(--primary-color);
}
.custom-dialog-message {
  font-size: 1rem;
  margin-bottom: 24px;
  line-height: 1.6;
  overflow-wrap: break-word;
  word-break: break-word;
}

.custom-dialog-message {
  font-size: 1rem;
  margin-bottom: 24px;
  line-height: 1.6;
  overflow-wrap: break-word;
  word-break: break-word;
}

.custom-dialog-body {
  margin-bottom: 24px;
  max-height: 60vh;
  overflow-y: auto;
}

.custom-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.custom-dialog-actions .mui-button {
  margin-top: 0;
  width: 140px; /* 固定幅を指定 */
}

.area-selection-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.area-selection-list label {
  display: flex;
  align-items: center;
  padding: 12px;
  border-radius: 8px;
  transition: background-color 0.2s ease;
  cursor: pointer;
}

.area-selection-list label:hover {
  background-color: #f5f5f5;
}

.area-selection-list input[type="checkbox"] {
  margin-right: 12px;
  width: 1.2em;
  height: 1.2em;
  accent-color: var(--primary-color);
}

/* ==========================================================================
  *  5. Utility & Animation Classes (ユーティリティとアニメーション)
  * ========================================================================== */
.hidden {
  display: none !important;
}
.animated {
  animation-duration: 0.5s;
  animation-fill-mode: both;
}
.fade-in {
  animation-name: fadeInKF;
}
@keyframes fadeInKF {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.question-element-appear {
  opacity: 0;
  transform: translateY(10px);
  animation: elementAppearKF 0.4s ease-out forwards;
}
@keyframes elementAppearKF {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.option-item-appear {
  opacity: 0;
  transform: translateX(-15px);
  animation: optionAppearKF 0.35s ease-out forwards;
}
@keyframes optionAppearKF {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
.feedback-pop-in {
  animation: feedbackPopKF 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55) forwards;
}
@keyframes feedbackPopKF {
  0% {
    transform: scale(0.7);
    opacity: 0;
  }
  70% {
    transform: scale(1.05);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* --- Custom Multi-Select Dropdown --- */
.custom-select-container {
  position: relative;
}

.custom-select-display {
  background-color: #f5f5f5;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.2s ease;
}

.custom-select-display:hover {
  background-color: #eeeeee;
}

.custom-select-display.open {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.custom-select-display .custom-select-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select-display .material-icons {
  transition: transform 0.3s ease;
}

.custom-select-display.open .material-icons {
  transform: rotate(180deg);
}

.custom-select-options {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: var(--card-background-color);
  border: 1px solid var(--border-color);
  border-top: none;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  z-index: 10;
  padding: 8px;
  box-sizing: border-box;
}

.custom-select-options.open {
  display: block;
  border-top: 1px solid var(--border-color);
}

.custom-select-option {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.custom-select-option:hover {
  background-color: #f5f5f5;
}

.custom-select-option input[type="checkbox"] {
  margin-right: 12px;
  width: 1.1em;
  height: 1.1em;
  accent-color: var(--primary-color);
}

/* ==========================================================================
   *  6. Responsive Styles (レスポンシブスタイル)
   * ========================================================================== */
@media (min-width: 576px) {
  #quiz-length-options-container,
  #quiz-algorithm-options-container,
  #quiz-mode-options-container {
    /* ★追加 */
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  }
  #quiz-length-dropdown-container,
  #quiz-algorithm-dropdown-container,
  #quiz-mode-dropdown-container {
    /* ★追加 */
    display: none;
  }
}
@media (max-width: 480px) {
  .mui-paper {
    padding: 18px;
  }
  h2.section-title {
    font-size: 1.15rem;
  }
  h3 {
    font-size: 1.1rem;
  }
}

/* ==========================================================================
   *  8. Flashcard Mode Styles (フラッシュカードモードのスタイル)
   * ========================================================================== */
.option-item.concealed {
  background-color: #f0f2f5; /* 非活性な背景色 */
  border-color: #e0e0e0;
  height: 70px; /* ★変更: 高さを固定 */
  overflow: hidden; /* ★追加: はみ出しを隠す */
  align-items: center; /* ★追加: 垂直方向の中央揃え */
}

.option-item.concealed .option-text-container {
  visibility: hidden; /* テキストを非表示にする */
}

.option-item.concealed:hover {
  cursor: pointer; /* クリックできることを示す */
  background-color: #e9ecef;
}

/* --- Quiz Area Selection --- */
.accordion-panel .quiz-area-container {
  margin-top: 16px;
  margin-bottom: 16px;
}

.accordion-panel .quiz-area-dropdown-container h3 {
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.accordion-panel .mui-select[multiple] {
  height: 150px;
  padding: 12px;
  background-color: #fdfdfd;
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.accordion-panel .mui-select[multiple] option {
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 4px;
  margin: 2px 0;
}

.accordion-panel .mui-select[multiple] option:checked {
  background-color: var(--primary-color);
  color: white;
  font-weight: 600;
}

#auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}
.auth-button {
  padding: 8px 10px;
  font-size: 0.9rem;
  margin-top: 0;
  display: flex;
  align-items: center;
  width: fit-content;
  max-width: 200px;
}
.auth-icon {
  width: 18px;
  height: 18px;
  margin-right: 8px;
}
#user-info {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-light-color);
  flex-grow: 1;
  text-align: center;
}

.login-prompt-text {
  text-align: center;
  margin-top: 15px;
  font-size: 1.1rem;
  color: var(--text-color);
}

#logged-in-view {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
}
#settings-button {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: var(--text-light-color);
  margin-left: 10px; /* ユーザー情報との間隔 */
}

#settings-button .material-icons {
  font-size: 1.6rem; /* Adjusted to match app-title's min font-size */
  vertical-align: middle; /* 追加 */
}

#settings-menu {
  position: absolute;
  top: 100%; /* ボタンの真下に配置 */
  right: 0;
  width: 200px;
  padding: 10px;
  z-index: 100;
  box-shadow: var(--card-shadow);
  border-radius: var(--card-border-radius);
  background-color: var(--card-background-color);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#settings-menu .menu-item {
  padding: 8px 0;
  font-size: 0.9rem;
  color: var(--text-color);
  border-bottom: 1px solid var(--border-color);
  margin: 0;
}

#settings-menu .menu-item:last-child {
  border-bottom: none;
}

#settings-menu #logout-button {
  margin-top: 0; /* mui-buttonのデフォルトmargin-topを上書き */
}
