/* ====================
 * 1. カスタムプロパティ (変数)
 * ==================== */
:root {
  --border-light: rgba(11, 18, 32, 0.06);
  --header-bg: rgba(255, 255, 255, 0.9);

  --color-primary: #0b1220;
  --color-secondary: #07102a;
  --color-muted: #6b7280;

  --accent: #5865f2;
  --accent-light: #3aa0ff;
  --accent-white: #fff;
}

/* ====================
 * 2. リセットと基本スタイル
 * ==================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial;
  background: rgb(224, 227, 255);
  color: var(--color-primary);
  font-weight: 600; /* ここで全体を太字にして統一 */
}

/* ====================
 * 3. ヘッダー
 * ==================== */
.header {
  height: 60px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border-light);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  position: sticky;
  top: 0;
  z-index: 10;
}

.logo {
  height: 40px;
  width: auto;
  margin-left: 20%;
}

.login-text {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 20%;
  font-weight: 600;
  font-size: 0.9em;
  cursor: pointer;
}

.login-text:hover {
  opacity: 0.8;
}

.login-icon-default {
  width: 20px;
  height: auto;
}

.login-icon-user {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

/* ====================
 * 4. サブヘッダー
 * ==================== */
.sub-header {
  height: 40px;
  display: flex;
  align-items: center;
  padding-left: 20%;
  background: #fff;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

.sub-nav {
  display: flex;
  gap: 24px;
}

.sub-nav-item {
  color: var(--color-muted);
  font-size: 0.9em;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  padding-bottom: 4px;
  transition: color 0.2s, border-bottom 0.2s;
}

.sub-nav-item:hover {
  color: var(--accent);
}

.sub-nav-item.active {
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
}

/* ====================
 * 5. Discordユーザー表示BOX
 * ==================== */
.discord-user-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  margin: 20px auto;
  width: 60%;
  max-width: 600px;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.discord-user-box img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.discord-user-box span {
  font-weight: 600;
  font-size: 1.2em;
  color: var(--color-primary);
}

/* ====================
 * 6. 投稿フォームBOX
 * ==================== */
.post-form-box {
  margin-left: calc(20% + 20px);
  margin-right: calc(20% + 20px);
  margin-top: 20px;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.post-form-box textarea {
  width: 100%;
  height: 150px;
  padding: 10px;
  font-size: 1em;
  font-weight: 600; /* 入力文字も太字に統一 */
  border: 1px solid #ccc;
  border-radius: 8px;
  resize: vertical;
}

.post-form-box button {
  align-self: flex-end;
  padding: 8px 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: filter 0.2s;
}

.post-form-box button:hover {
  filter: brightness(0.9);
}

/* ====================
 * 7. タグ入力
 * ==================== */
.tag-section,
.name-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.tag-label,
.name-label {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
  font-size: 0.95em;
  color: var(--color-primary);
}

.tag-input-container,
.name-input-container {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px 8px;
  border: 1px solid var(--border-light);
  border-radius: 0;
  min-height: 40px;
  background: #fff;
}

#tag-input,
.name-input-container input {
  flex: 1;
  border: none;
  outline: none;
  min-width: 80px;
  font-size: 0.95em;
  font-weight: 600; /* 入力文字も太字に統一 */
}

.tag {
  background: #a3c4ff;
  color: #0b1220;
  padding: 4px 8px;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  margin: 2px 2px;
}

.tag-description,
.name-description {
  font-size: 0.85em;
  color: #bbb;
  margin-top: 4px;
  display: block;
}

.gender-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 20px;
}

.gender-label {
  font-weight: 600;
  font-size: 0.95em;
  color: var(--color-primary);
}

.gender-input-container {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 6px 8px;
  border: 1px solid var(--border-light);
  border-radius: 0;
  min-height: 40px;
  background: #fff;
}

.gender-input-container label {
  font-weight: 600;
  color: #333;
  cursor: pointer;
}

.gender-input-container input[type="radio"] {
  margin-right: 4px;
  accent-color: var(--accent); /* チェック色をDiscord風に */
}

/* ====================
 * 8. 入力欄・プレースホルダー・性別文字色調整（太字解除）
 * ==================== */

/* 入力中の文字色を薄く・太字解除 */
#tag-input,
.name-input-container input {
  color: #555;        /* 濃すぎない文字色 */
  font-weight: 400;   /* 太字を解除 */
}

/* プレースホルダー文字を薄めの黒に統一（タグ・名前・タイトル共通） */
#tag-input::placeholder,
.name-input-container input::placeholder,
.title-input-container input::placeholder,
#post-content::placeholder {
  color: rgba(0,0,0,0.35); /* 薄めの黒 */
  font-weight: 400;         /* 標準の太さ */
}


/* 性別ラベル文字色を薄く・太字解除 */
.gender-input-container label {
  color: #555;
  font-weight: 400;
}

/* ====================
 * 以下省略（既存のコードを維持）
 * ==================== */
.voice-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}

.voice-label {
  font-weight: 400;
  color: #555;
}

.voice-controls button {
  margin-right: 8px;
  padding: 6px 12px;
  border: 1px solid var(--border-light);
  background: #f0f0f0;
  border-radius: 6px;
  cursor: pointer;
}

.voice-controls button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.voice-description {
  font-size: 0.85em;
  color: #aaa;
}

.record-section {
  margin-top: 20px;
  padding: 15px 18px;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.7);
  border-radius: 8px;
}

.record-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 0.95em;
  color: var(--color-primary);
}

.record-buttons {
  display: flex;
  gap: 10px;
}

#start-recording:hover,
#stop-recording:hover {
  opacity: 0.85;
}

#start-recording,
#stop-recording {
  padding: 10px 16px;
  font-size: 15px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.mic-btn {
  background: #28a745;
  border-radius: 50%;
  padding: 12px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mic-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 12px rgba(0,0,0,0.3);
}

.stop-btn {
  background: #dc3545;
  border-radius: 50%;
  padding: 12px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stop-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 12px rgba(0,0,0,0.3);
}

#stop-recording {
  background-color: #333;
  color: #fff;
}

#start-recording:hover,
#stop-recording:hover {
  filter: brightness(1.1);
}

.record-limit-text {
  font-size: 0.9em;
  color: #555;
  margin-right: 12px;
  align-self: center;
}

/* ====================
 * タイトル入力
 * ==================== */
.title-section,
.content-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}

.title-label,
.content-label {
  font-weight: 600;
  font-size: 0.95em;
  color: var(--color-primary);
  display: block;
}

.title-input-container,
#post-content {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-light);
  border-radius: 0;
  background: #fff;
  padding: 6px 8px;
  min-height: 40px;
}

.title-input-container input,
#post-content {
  flex: 1;
  border: none;
  outline: none;
  width: 100%;
  font-size: 0.95em;
  font-weight: 400;
  color: #555;
}

/* ====================
 * 入力欄フォーカス時の枠全体光らせ（薄め）
 * ==================== */
.tag-input-container:focus-within,
.name-input-container:focus-within,
.title-input-container:focus-within,
#post-content:focus,
.gender-input-container:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(88, 101, 242, 0.3);
  outline: none;
}
