/* ========================================
   Base Styles - CSS Variables & Fonts
   ======================================== */

/* === Global CSS Variables === */
:root {
  /* Color variables - All colors centralized */
  --text-dark: #000000;
  --text-white: #ffffff;
  --text-muted: #6c757d;

  /* Theme base - Pastel Light Blue */
  --theme-base: #b3d9f2;
  /* パステルライトブルー（メインテーマ色） */
  --theme-base-rgb: 179, 217, 242;
  --theme-light: #e6f3f9;
  /* 非常に薄いブルー（背景用） */
  --theme-lighter: #f0f8fc;
  /* さらに薄いブルー */
  --theme-soft: #c7e2f5;
  /* ソフトなブルー */
  --theme-muted: #5d9cbe;
  /* くすんだブルー（アクセント用） */
  --theme-dark: #4a7c9a;
  /* 濃いブルー */

  /* Semantic colors */
  --theme-success-bg: #0d9488;
  /* ティール系（背景用） */
  --theme-success-text: #ffffff;
  /* テキスト用 */
  --theme-success-rgb: 13, 148, 136;
  --theme-danger-bg: #e63946;
  /* やや暗めの赤（背景用） */
  --theme-danger-text: #ffffff;
  --theme-danger-rgb: 230, 57, 70;
  --theme-warning-bg: #f59e0b;
  /* アンバー（背景用） */
  --theme-warning-text: #121212;
  --theme-warning-rgb: 245, 158, 11;
  --theme-info-bg: #3b82f6;
  /* ブライトブルー（背景用） */
  --theme-info-text: #ffffff;
  --theme-info-rgb: 59, 130, 246;

  --theme-base-bg: #005bbb;
  --theme-base-text: #ffffff;
  --theme-muted-bg: #6c8fbe;
  --theme-muted-text: #ffffff;
  --theme-light-bg: #e8f2ff;
  --theme-light-text: #121212;
  --theme-dark-bg: #0f3d73;
  --theme-dark-text: #ffffff;

  /* Component colors */
  --card-bg: #ffffff;
  --card-border: #e9ecef;
  --navbar-bg: var(--theme-base-bg);
  --footer-bg: var(--theme-light-bg);
  --body-bg: #f7f9fc;
  --text-dark: #121212;
  --text-muted: #4a4a4a;
  --text-on-dark: #eeeeee;
  /* 暗背景上の非選択テキスト */
  --input-border: #e2e8f0;
  --input-focus-border: var(--theme-base-bg);

  /* Dark mode variables */
  --body-bg-dark: #121212;
  --card-bg-dark: #1e1e1e;
  --text-light: #e7ebf0;

  /* Shadows */
  --card-shadow: 0 4px 12px rgba(93, 156, 190, 0.12);
  --card-hover-shadow: 0 6px 20px rgba(93, 156, 190, 0.18);
  --button-shadow: 0 2px 8px rgba(93, 156, 190, 0.15);

  /* Gradients */
  --primary-gradient: var(--theme-base-bg);
  --accent-gradient: var(--theme-light-bg);
  --success-gradient: var(--theme-success-bg);

  /* Bootstrap overrides */
  --bs-primary: var(--theme-base-bg);
  --bs-primary-rgb: var(--theme-base-rgb);
  --bs-secondary: #6c757d;
  --bs-secondary-rgb: 108, 117, 125;
  --bs-success: var(--theme-success-bg);
  --bs-success-rgb: var(--theme-success-rgb);
  --bs-info: var(--theme-info-bg);
  --bs-info-rgb: var(--theme-info-rgb);
  --bs-warning: var(--theme-warning-bg);
  --bs-warning-rgb: var(--theme-warning-rgb);
  --bs-danger: var(--theme-danger-bg);
  --bs-danger-rgb: var(--theme-danger-rgb);
  --bs-light: #f8f9fa;
  --bs-light-rgb: 248, 249, 250;
  --bs-dark: #343a40;
  --bs-dark-rgb: 52, 58, 64;

  /* Accessible variants for use on dark backgrounds */
  --theme-base-on-dark: #93c5fd;
  --theme-info-on-dark: #93c5fd;
  --theme-success-on-dark: #7dd3c1;
  --theme-danger-on-dark: #fb7185;
  --theme-warning-on-dark: #fbbf24;
}

/* === Custom Font: LINE SEED === */
@font-face {
  font-family: 'LINESEEDJP';
  src: url('/assets/fonts/LINESeedJP_OTF_Th.woff2') format('woff2');
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'LINESEEDJP';
  src: url('/assets/fonts/LINESeedJP_OTF_Rg.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'LINESEEDJP';
  src: url('/assets/fonts/LINESeedJP_OTF_Bd.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'LINESEEDJP';
  src: url('/assets/fonts/LINESeedJP_OTF_Eb.woff2') format('woff2');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

/* === Base HTML & Body Styles === */
html,
body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  padding-top: 70px;
  background: var(--body-bg);
  color: var(--text-dark);
  min-height: 100vh;
  min-width: 300px;
  overflow-x: auto;
  font-family: 'LINESEEDJP', 'Noto Sans JP', 'Yu Gothic', 'Meiryo', -apple-system,
    BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* === Font Rendering & Typography === */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-weight: 400;
}

/* Headings */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

/* Small UI text */
small,
.small,
.text-sm {
  font-weight: 400;
  -webkit-font-smoothing: auto;
}

/* Buttons and badges */
.btn,
.badge {
  font-weight: 600;
}

/* Compact labels */
.badge,
.btn-sm,
.form-label {
  letter-spacing: 0.01em;
}

/* Input fields */
input,
textarea,
select {
  font-weight: 400;
}

/* Fallback for Latin symbols */
.use-system-font {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif !important;
}

/* === Icon Font Fixes === */
.fa,
.fas,
.far,
.fal,
.fab {
  font-family: 'Font Awesome 6 Free', 'Font Awesome 6 Pro', 'Font Awesome 6 Brands' !important;
  font-weight: 900;
}

.far {
  font-weight: 400;
}

.fab {
  font-family: 'Font Awesome 6 Brands' !important;
}

/* Emoji/icon helper */
.emoji-icon {
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
  font-style: normal;
}

/* === Color Utility Overrides === */
.bg-warning,
.badge-warning,
.btn-warning {
  background-color: var(--bs-warning) !important;
  color: var(--text-dark) !important;
}

.bg-warning .text-white,
.badge-warning .text-white,
.btn-warning .text-white {
  color: var(--text-dark) !important;
}

.text-warning {
  color: var(--theme-warning-text) !important;
}

.admin-header .badge-warning {
  background-color: var(--bs-warning) !important;
  color: var(--theme-warning-text) !important;
}
