/**
 * KURENAI ANIME - デザインシステム＆共通スタイル (日本語タイポグラフィ最適化)
 */

:root {
  --bg-primary: #0a0b10;
  --bg-surface: #12131d;
  --bg-surface-elevated: #1a1b29;
  --bg-card: rgba(22, 24, 38, 0.7);
  --bg-card-hover: rgba(30, 32, 52, 0.85);
  
  --accent-primary: #ff2a5f;
  --accent-primary-hover: #ff4777;
  --accent-secondary: #00f0ff;
  --accent-glow: rgba(255, 42, 95, 0.35);
  --cyan-glow: rgba(0, 240, 255, 0.3);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(255, 42, 95, 0.5);

  --glass-bg: rgba(18, 19, 29, 0.82);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-blur: blur(16px);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.6);
  --shadow-neon: 0 0 25px var(--accent-glow);

  --font-sans: 'Inter', 'Noto Sans JP', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif;
  --font-jp: 'Noto Sans JP', 'Hiragino Sans', sans-serif;
}

body.theme-neon-purple {
  --bg-primary: #0b0714;
  --bg-surface: #140d24;
  --bg-surface-elevated: #1e1336;
  --bg-card: rgba(25, 17, 43, 0.7);
  --bg-card-hover: rgba(38, 25, 66, 0.85);
  --accent-primary: #a855f7;
  --accent-primary-hover: #c084fc;
  --accent-secondary: #ec4899;
  --accent-glow: rgba(168, 85, 247, 0.4);
  --border-focus: rgba(168, 85, 247, 0.5);
}

body.theme-matrix-green {
  --bg-primary: #050d0a;
  --bg-surface: #0b1a14;
  --bg-surface-elevated: #12281e;
  --bg-card: rgba(15, 33, 26, 0.7);
  --bg-card-hover: rgba(22, 48, 38, 0.85);
  --accent-primary: #10b981;
  --accent-primary-hover: #34d399;
  --accent-secondary: #06b6d4;
  --accent-glow: rgba(168, 85, 247, 0.4);
  --border-focus: rgba(16, 185, 129, 0.5);
}

body.theme-oled-dark {
  --bg-primary: #000000;
  --bg-surface: #0a0a0a;
  --bg-surface-elevated: #141414;
  --bg-card: rgba(18, 18, 18, 0.85);
  --bg-card-hover: rgba(28, 28, 28, 0.95);
  --accent-primary: #ffffff;
  --accent-primary-hover: #e2e8f0;
  --accent-secondary: #38bdf8;
  --accent-glow: rgba(255, 255, 255, 0.25);
  --border-focus: rgba(255, 255, 255, 0.4);
}

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

html {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 10%, rgba(255, 42, 95, 0.04) 0%, transparent 40%),
    radial-gradient(circle at 85% 60%, rgba(0, 240, 255, 0.03) 0%, transparent 45%),
    linear-gradient(to bottom, var(--bg-primary), #07080c);
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-full);
  border: 2px solid var(--bg-primary);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-jp);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

p {
  line-height: 1.75;
}

.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent-primary); }
.text-cyan { color: var(--accent-secondary); }
.text-glow {
  text-shadow: 0 0 16px var(--accent-glow);
}

.container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
}

.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.text-center { text-align: center; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  font-family: var(--font-jp);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  user-select: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), #d91b4c);
  color: #ffffff;
  box-shadow: 0 4px 18px var(--accent-glow);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-primary-hover), #e62254);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px var(--accent-glow);
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.btn-accent {
  background: rgba(255, 42, 95, 0.15);
  color: var(--accent-primary);
  border-color: rgba(255, 42, 95, 0.3);
}
.btn-accent:hover {
  background: var(--accent-primary);
  color: #fff;
  box-shadow: 0 0 18px var(--accent-glow);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 14px 30px;
  font-size: 1.05rem;
  border-radius: var(--radius-md);
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-icon:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  box-shadow: 0 0 12px var(--accent-glow);
}

.input-theme, .select-theme, .textarea-theme {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s ease;
}
.input-theme:focus, .select-theme:focus, .textarea-theme:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.textarea-theme {
  width: 100%;
  min-height: 100px;
  resize: vertical;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-family: var(--font-jp);
}

.badge-accent {
  background: linear-gradient(135deg, var(--accent-primary), #ff6b8b);
  color: #fff;
  box-shadow: 0 2px 8px var(--accent-glow);
}

.badge-cyan {
  background: rgba(0, 240, 255, 0.15);
  color: var(--accent-secondary);
  border: 1px solid rgba(0, 240, 255, 0.3);
}

.badge-age {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.badge-status {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.genre-pill {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-family: var(--font-jp);
  transition: all 0.2s ease;
}
.genre-pill:hover {
  background: rgba(255, 42, 95, 0.12);
  color: var(--accent-primary);
  border-color: rgba(255, 42, 95, 0.3);
}

.view-section {
  display: none;
  animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.view-section.is-active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.toast-container {
  position: fixed;
  bottom: 30px;
  right: 30px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 99999;
  pointer-events: none;
}

.toast {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--accent-primary);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  backdrop-filter: var(--glass-blur);
  opacity: 0;
  transform: translateX(30px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
  max-width: 380px;
  font-family: var(--font-jp);
}
.toast.is-visible {
  opacity: 1;
  transform: translateX(0);
}
.toast-content {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 500;
}
.toast-icon {
  color: var(--accent-primary);
  font-weight: bold;
}
.toast-success {
  border-left-color: #10b981;
}
.toast-success .toast-icon {
  color: #10b981;
}
.toast-error {
  border-left-color: #ef4444;
}
.toast-error .toast-icon {
  color: #ef4444;
}
