/*
 * Focus Mixer
 * Copyright (c) 2026 AliceIndex. All rights reserved.
 * Unauthorized copying of this file, via any medium is strictly prohibited.
 */

/* ダークモードのカラーパレット定義 */
:root {
  --bg-color: #121212;
  --surface-color: #1e1e1e;
  --primary-color: #64ffda;
  /* アクセントカラー */
  --text-main: #e0e0e0;
  --text-muted: #9e9e9e;
  --ad-bg: #2a2a2a;
}

/* =========================================
   ライトモードのカラーパレット（色の上書き）
   ========================================= */
body.light-mode {
  --bg-color: #f5f5f5;
  --surface-color: #ffffff;
  --primary-color: #00bfa5;
  /* 白背景でも見やすいように、少し濃いミントグリーンに変更 */
  --text-main: #333333;
  --text-muted: #757575;
  --ad-bg: #e0e0e0;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

header {
  text-align: center;
  padding: 20px 0;
  background-color: var(--surface-color);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

h1 {
  font-size: 1.8rem;
  color: var(--primary-color);
  letter-spacing: 2px;
}

/* 通知コンテナの配置 */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 通知バブルのスタイル */
.toast {
  background-color: var(--bg-color);
  /* 既存のカード背景色 */
  color: var(--primary-color);
  /* 既存のアクセントカラー */
  border: 1px solid var(--primary-color);
  padding: 12px 24px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  font-size: 0.9rem;
  min-width: 200px;
  animation: slideIn 0.3s ease-out, fadeOut 0.3s ease-in 2.7s forwards;
  pointer-events: none;
}

/* アニメーション：右からスライドイン */
@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* アニメーション：フェードアウト */
@keyframes fadeOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

/* メインレイアウト（中央コンテンツ＋両サイド広告） */
.layout-wrapper {
  display: flex;
  flex: 1;
  justify-content: center;
  padding: 30px 20px;
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.main-content {
  flex: 0 1 600px;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

/* 各セクションのカードデザイン */
section {
  background-color: var(--surface-color);
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  text-align: center;
}

h2 {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* ポモドーロタイマー */
.time-display {
  font-size: 4.5rem;
  font-weight: bold;
  font-variant-numeric: tabular-nums;
  /* 等幅の数字表示 */
  margin: 10px 0 30px;
  color: var(--primary-color);
  text-shadow: 0 0 15px rgba(100, 255, 218, 0.15);
}

.timer-controls button,
.preset-btn {
  background-color: transparent;
  color: var(--text-main);
  border: 1px solid var(--primary-color);
  padding: 10px 20px;
  margin: 5px 5px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
  text-decoration: none;
}

.timer-controls button:hover,
.preset-btn:hover {
  background-color: var(--primary-color);
  color: var(--bg-color);
  font-weight: bold;
}

.danger-btn {
  background-color: rgba(255, 82, 82, 0.15);
  /* 控えめな赤色 */
  border: 1px solid #ff5252;
  color: #ff5252;
}

.danger-btn:hover {
  background-color: #ff5252;
  color: #fff;
}

.mixer-viewport {
  width: 100%;
  max-width: 400px;
  /* 1ページ分の幅 */
  margin: 0 auto;
  overflow: hidden;
  /* はみ出た分を隠す */
  position: relative;
}

.mixer-slider {
  display: flex;
  width: 300%;
  /* 3ページ分なので300% */
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  /* 滑らかな加速・減速 */
}

.sound-page {
  width: 33.333%;
  /* 1ページは全体の3分の1 */
  padding: 20px;
  box-sizing: border-box;
}

.sound-page h2 {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* ナビゲーション周り */
.nav-btn {
  color: var(--text-main);
  background: none;
  size: 1.0rem;
}

.slider-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
}

.page-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}


.dot {
  width: 10px;
  height: 10px;
  background: var(--text-muted);
  border-radius: 50%;
  display: inline-block;
  transition: 0.3s;
}

.dot.active {
  background: var(--primary-color);
  transform: scale(1.3);
}

.sound-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.sound-item label {
  font-size: 1.1rem;
}

input[type="range"] {
  width: 85%;
  accent-color: var(--primary-color);
  cursor: pointer;
}

.input-pair span {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* 広告枠のデザイン（仮置き） */
.ad-space {
  flex: 0 0 160px;
  /* display: flex; */
  display: none;
}

.ad-placeholder {
  width: 100%;
  background-color: var(--ad-bg);
  border: 2px dashed #444;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: 8px;
  font-size: 0.9rem;
  min-height: 600px;
}

.bottom-ad {
  padding: 20px;
  /* display: flex; */
  display: none;
  justify-content: center;
  background-color: var(--bg-color);
}

.bottom-ad .ad-placeholder {
  width: 100%;
  max-width: 728px;
  min-height: 90px;
}

/* フッターのスタイル */
.app-footer {
  margin-top: 40px;
  padding: 20px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.link-btn {
  background: none;
  border: none;
  color: var(--primary-color);
  text-decoration: underline;
  cursor: pointer;
}

/* レスポンシブ対応（画面幅が狭い場合） */
@media (max-width: 950px) {
  .layout-wrapper {
    flex-direction: column;
    align-items: center;
  }

  .ad-space {
    display: none;
    /* スマホやタブレットでは両サイドの広告を非表示 */
  }
}

/* =========================================
   ヘッダーとボタンのレイアウト調整
   ========================================= */
header {
  position: relative;
  /* ボタンの配置基準にするため追記 */
  /* text-align: center; 等の既存スタイルはそのまま */
}

/* テーマ切り替えボタンのデザイン */
.theme-btn {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  /* 縦方向のド真ん中に配置 */
  background: transparent;
  border: 1px solid var(--text-main);
  color: var(--text-main);
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.theme-btn:hover {
  background-color: var(--text-main);
  color: var(--bg-color);
}

/* =========================================
   モーダルウィンドウのデザイン
   ========================================= */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.7);
  /* 背景を半透明の黒に */
  backdrop-filter: blur(3px);
  /* 背景を少しぼかす（お洒落ポイント） */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  /* 一番手前に表示 */
  opacity: 1;
  transition: opacity 0.3s ease;
}

/* 非表示状態 */
.modal-overlay.hidden {
  opacity: 0;
  pointer-events: none;
  /* クリック判定を消す */
  display: flex;
  /* settings-panelの hidden(display:none) を上書き */
}

.modal-content {
  background-color: var(--surface-color);
  padding: 40px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--primary-color);
  transform: translateY(0);
  transition: transform 0.3s ease;
  min-width: 300px;
}

/* 非表示状態の時は少し上にずらしておく（ふわっと下りてくる演出） */
.modal-overlay.hidden .modal-content {
  transform: translateY(-20px);
}

.modal-content h3 {
  color: var(--primary-color);
  font-size: 1.5rem;
  margin-bottom: 10px;
}

.modal-content p {
  margin-bottom: 25px;
  font-size: 1.1rem;
}

/* 設定モーダル内のレイアウト */
.settings-grid {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin: 20px 0;
}

.setting-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.timer-input {
  color: var(--text-main);
  background: var(--surface-color);
  padding: 10px;
  border-radius: 5px;
  border: 1px solid var(--primary-color);
}

/* 規約モーダルのスクロール対応 */
.legal-content {
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  /* 規約は左寄せが読みやすい */
}

.legal-content h4 {
  color: var(--primary-color);
  margin: 15px 0 5px 0;
}

.legal-content p {
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 10px;
  text-align: left;
}

.legal-text-card {
  margin-bottom: 10px;
}

/* クッキーバナーのスタイル */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: var(--bg-color);
  border-top: 2px solid var(--primary-color);
  padding: 20px;
  z-index: 10001;
  /* モーダルや通知よりも手前に表示 */
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
  transition: transform 0.4s ease-in-out;
}

.cookie-banner.hidden {
  transform: translateY(100%);
  display: none;
  /* 完全に消す場合はこれ */
}

.cookie-content {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.cookie-content p {
  font-size: 0.85rem;
  line-height: 1.5;
  margin: 0;
}

/* 同意するボタン */
.primary-btn {
  background: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: 0.3s;
}

.primary-btn:hover {
  border-color: var(--bg-color);
  color: var(--bg-color);
  background: var(--primary-color);
}

/* 同意しないボタン */
.secondary-btn {
  background: transparent;
  border: 1px solid var(--text-muted);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: 0.3s;
}

.secondary-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* ボタン同士の余白 */
.cookie-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.inline-link {
  background: none;
  border: none;
  color: var(--primary-color);
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  font: inherit;
}

.cookie-actions {
  flex-shrink: 0;
}

/* スマホ対応：縦並びにする */
@media (max-width: 600px) {
  .cookie-content {
    flex-direction: column;
    text-align: center;
  }
}