/* ============================================
   Suno Prompt Maker - Tailwind 用カスタムCSS
   ============================================ */

/* --- Tailwind カラーカスタム --- */
@layer base {
  :root {
    --bg: #f5f5f8;
    --surface: #ffffff;
    --surface2: #e8e8ef;
    --border: #d0d0da;
    --text: #1a1a24;
    --text-dim: #6a6a80;
    --accent: #6a4cff;
    --accent-hover: #8566ff;
    --danger: #e04040;
    --tag-bg: #e8e8f0;
    --tag-active: #6a4cff;
  }

  body.dark {
    --bg: #0f0f14;
    --surface: #1a1a24;
    --surface2: #242432;
    --border: #2e2e3e;
    --text: #e0e0e8;
    --text-dim: #8888a0;
    --accent: #7c5cff;
    --accent-hover: #9a7dff;
    --danger: #ff5c5c;
    --tag-bg: #2a2a3a;
    --tag-active: #7c5cff;
  }
}

/* --- テーマ切替アイコン --- */
body.dark .icon-bulb-on { display: none; }
body.dark .icon-bulb-off { display: inline !important; }

/* --- タブ切替 --- */
.tab-content { display: none; }
.tab-content.active { display: block; }

/* --- スライダー（カスタム外観） --- */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: none;
}

/* --- タグ --- */
.tag {
  background: var(--tag-bg);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 0.3rem 0.7rem;
  border-radius: 20px;
  font-size: 0.8rem;
  user-select: none;
  transition: background 0.15s, border-color 0.15s;
}
.tag.active {
  background: var(--tag-active);
  border-color: var(--tag-active);
  color: #fff;
}

/* --- コピー Button --- */
.card-copy-btn {
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
}
.template-card:hover .card-copy-btn,
.history-card:hover .card-copy-btn {
  opacity: 1;
}

/* --- アニメーション --- */
@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(10px); }
}
@keyframes dialog-in {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
.toast { animation: toast-in 0.2s ease-out; }
.toast.removing { animation: toast-out 0.2s ease-in forwards; }
dialog[open] { animation: dialog-in 0.15s ease-out; }
dialog::backdrop { background: rgba(0, 0, 0, 0.5); }

/* --- チャット文字数カウンター --- */
.char-count.near { color: #2e8b57; }
.char-count.over { color: var(--danger); }
body.dark .char-count.near { color: #4caf50; }

/* --- タグセレクト表示専用 --- */
.tag-select {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* --- テンプレートサブタブ --- */
.template-subtab-content { display: none; }
.template-subtab-content.active { display: block; }

/* --- 折りたたみ要素 --- */
details summary::-webkit-details-marker { display: none; }
details summary::marker { display: none; content: ''; }
details summary {
  list-style: none;
  position: relative;
}
details summary::before {
  content: '▶';
  position: absolute;
  right: 1rem;
  transition: transform 0.2s;
}
details[open] summary::before {
  transform: rotate(90deg);
}
