/* ================================================
   UCHU ADDON - UNIFIED DESIGN SYSTEM
   White Refined Edition
   ================================================ */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap");

:root {
  /* Brand Colors - Refined White Theme */
  --uchu-primary: #5b6cf6; /* Indigo */
  --uchu-secondary: #3b82f6; /* Blue */
  --uchu-accent: #5b6cf6; /* Indigo */
  --uchu-danger: #ef4444;
  --uchu-success: #22c55e;
  --uchu-warning: #f59e0b;

  /* Neutral Colors */
  --uchu-bg-dark: #0d1117; /* Deep navy - header / footer */
  --uchu-bg-mid: #f4f6fa; /* Page background */
  --uchu-bg-light: #ffffff; /* Card / panel background */
  --uchu-surface: #ffffff;
  --uchu-border: #e2e8f0;

  /* Text Colors */
  --uchu-text-primary: #0f172a;
  --uchu-text-secondary: #475569;
  --uchu-text-muted: #94a3b8;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #5b6cf6 0%, #3b82f6 100%);
  --gradient-accent: linear-gradient(135deg, #5b6cf6 0%, #8b5cf6 100%);
  --gradient-danger: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
  --gradient-cosmic: linear-gradient(
    135deg,
    #5b6cf6 0%,
    #3b82f6 50%,
    #8b5cf6 100%
  );

  /* Typography */
  --font-display: "Inter", sans-serif;
  --font-heading: "Inter", sans-serif;
  --font-body: "Inter", sans-serif;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;

  /* Effects */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.1), 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-glow: 0 0 20px rgba(91, 108, 246, 0.2);

  --blur-glass: blur(8px);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

/* ================================================
   DARK MODE VARIABLES
   ================================================ */

[data-theme="dark"] {
  --uchu-bg-mid:   #0d1117;
  --uchu-bg-light: #161b22;
  --uchu-surface:  #161b22;
  --uchu-border:   #30363d;
  --uchu-text-primary:   #e6edf3;
  --uchu-text-secondary: #8b949e;
  --uchu-text-muted:     #6e7681;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.5), 0 2px 6px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.6), 0 4px 12px rgba(0,0,0,0.4);
}

/* ---- ダークモード: ヘッダー・フッターを明転 ---- */
[data-theme="dark"] .uchu-header {
  background: #f4f6fa;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .uchu-nav-link {
  color: rgba(0, 0, 0, 0.55);
}

[data-theme="dark"] .uchu-nav-link:hover {
  color: #0f172a;
  background: rgba(0, 0, 0, 0.07);
}

[data-theme="dark"] .uchu-nav-link.active {
  background: var(--uchu-primary);
  color: #ffffff;
}

[data-theme="dark"] .theme-toggle {
  border-color: rgba(0, 0, 0, 0.2);
  color: #0f172a;
}

[data-theme="dark"] .theme-toggle:hover {
  color: #0f172a;
}

[data-theme="dark"] .uchu-footer {
  background: #f4f6fa;
  --uchu-text-secondary: rgba(0, 0, 0, 0.55);
  --uchu-text-muted:     rgba(0, 0, 0, 0.35);
  --uchu-accent:         rgba(0, 0, 0, 0.7);
}

[data-theme="dark"] .uchu-footer-section h3 {
  color: #0f172a;
}

[data-theme="dark"] .uchu-footer-section p {
  color: rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .uchu-footer-links a {
  color: rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .uchu-footer-links a:hover {
  color: #0f172a;
}

[data-theme="dark"] .uchu-footer-bottom {
  border-top-color: rgba(0, 0, 0, 0.1);
  color: rgba(0, 0, 0, 0.35);
}

/* ================================================
   RESET & BASE STYLES
   ================================================ */

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

body {
  font-family: var(--font-body);
  background: var(--uchu-bg-mid);
  color: var(--uchu-text-primary);
  min-height: 100vh;
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ================================================
   TYPOGRAPHY
   ================================================ */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--uchu-text-primary);
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  text-transform: uppercase;
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
}

h3 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-glow {
  color: var(--uchu-primary);
}

/* ================================================
   HEADER COMPONENT
   ================================================ */

.uchu-header {
  background: var(--uchu-bg-dark);
  border-bottom: none;
  padding: var(--space-md) 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.3);
}


.uchu-nav {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 var(--space-xl);
}

.uchu-logo {
  height: 50px;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.uchu-logo:hover {
  transform: scale(1.05);
}

.uchu-nav-links {
  display: flex;
  gap: var(--space-xs);
  list-style: none;
  align-items: center;
}

.uchu-nav-link {
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  font-weight: 600;
  font-family: var(--font-heading);
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  font-size: 0.875rem;
  letter-spacing: 0.3px;
}

.uchu-nav-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.uchu-nav-link.active {
  background: var(--uchu-primary);
  color: #ffffff;
}

/* Dropdown */
.uchu-dropdown {
  position: relative;
}

.uchu-dropdown-content {
  display: none;
  position: absolute;
  top: calc(100% + var(--space-sm));
  left: 0;
  background: #1a2235;
  min-width: 220px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  animation: dropdownSlide 0.2s ease;
}

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

.uchu-dropdown:hover .uchu-dropdown-content {
  display: block;
}

.uchu-dropdown-content a {
  display: block;
  padding: var(--space-md) var(--space-lg);
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  transition: all 0.15s ease;
  font-weight: 500;
  font-size: 0.875rem;
}

.uchu-dropdown-content a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  padding-left: calc(var(--space-lg) + 6px);
}

/* Dark Mode Toggle Button */
.theme-toggle {
  background: transparent;
  border: 1px solid var(--uchu-border);
  color: #ffffff;
  font-size: 0.9rem;
  padding: 4px 10px;
  border-radius: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
  line-height: 1;
}

.theme-toggle:hover {
  color: #ffffff;
}

/* Mobile Menu Toggle */
.uchu-menu-toggle {
  display: none;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.3rem;
  padding: var(--space-sm);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.uchu-menu-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.4);
  color: #ffffff;
}

/* ================================================
   FOOTER COMPONENT
   ================================================ */

/* フッターを画面下部に固定するためのフレックスアイテム設定 */
#footer {
  margin-top: auto;
}

.uchu-footer {
  background: var(--uchu-bg-dark);
  border-top: none;
  padding: var(--space-2xl) var(--space-xl);
  position: relative;
  /* Scope text color variables for dark bg */
  --uchu-text-secondary: rgba(255, 255, 255, 0.5);
  --uchu-text-muted: rgba(255, 255, 255, 0.3);
  --uchu-accent: rgba(255, 255, 255, 0.75);
}

.uchu-footer-content {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-xl);
}

.uchu-footer-section h3 {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: var(--space-md);
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.uchu-footer-links {
  list-style: none;
}

.uchu-footer-links li {
  margin-bottom: var(--space-sm);
}

.uchu-footer-links a {
  color: rgba(255, 255, 255, 0.45);
  text-decoration: none;
  transition: color 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.875rem;
}

.uchu-footer-links a:hover {
  color: #ffffff;
}

.uchu-footer-bottom {
  text-align: center;
  margin-top: var(--space-2xl);
  padding-top: var(--space-lg);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.25);
  font-size: 0.825rem;
}

/* ================================================
   BUTTON COMPONENTS
   ================================================ */

.uchu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.3px;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.uchu-btn-primary {
  background: var(--gradient-primary);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.uchu-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  opacity: 0.92;
}

.uchu-btn-secondary {
  background: transparent;
  border: 1.5px solid var(--uchu-border);
  color: var(--uchu-text-secondary);
}

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

/* ================================================
   CARD COMPONENTS
   ================================================ */

.uchu-card {
  background: var(--uchu-bg-light);
  border: 1px solid var(--uchu-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.uchu-card:hover {
  transform: translateY(-4px);
  border-color: rgba(91, 108, 246, 0.25);
  box-shadow: var(--shadow-md);
}

/* ================================================
   SECTION COMPONENTS
   ================================================ */

.uchu-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-xl);
  position: relative;
  z-index: 1;
}

.uchu-section-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.uchu-section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 900;
  margin-bottom: var(--space-md);
  color: var(--uchu-text-primary);
  letter-spacing: -0.5px;
}

.uchu-section-subtitle {
  font-size: clamp(1rem, 2vw, 1.1rem);
  color: var(--uchu-text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* ================================================
   RESPONSIVE
   ================================================ */

@media (max-width: 1024px) {
  .uchu-nav {
    padding: 0 var(--space-lg);
  }

  .uchu-section {
    padding: var(--space-xl) var(--space-lg);
  }
}

@media (max-width: 768px) {
  .uchu-nav {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md);
  }

  .uchu-logo {
    height: 40px;
  }

  .uchu-nav-links {
    flex-direction: column;
    align-items: flex-end;
    gap: var(--space-xs);
    width: auto;
  }

  .uchu-nav-link {
    text-align: right;
    padding: var(--space-sm) var(--space-md);
    font-size: 0.85rem;
    width: auto;
  }

  .uchu-dropdown-content {
    position: static;
    display: none;
    margin-top: var(--space-sm);
    border-left: 3px solid var(--uchu-primary);
    padding-left: var(--space-md);
    background: rgba(255, 255, 255, 0.04);
    text-align: right;
    box-shadow: none;
  }

  .uchu-dropdown.active .uchu-dropdown-content {
    display: block;
  }

  .uchu-footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

/* ================================================
   UTILITY CLASSES
   ================================================ */

.text-center {
  text-align: center;
}
.text-left {
  text-align: left;
}
.text-right {
  text-align: right;
}

.mt-sm {
  margin-top: var(--space-sm);
}
.mt-md {
  margin-top: var(--space-md);
}
.mt-lg {
  margin-top: var(--space-lg);
}
.mt-xl {
  margin-top: var(--space-xl);
}

.mb-sm {
  margin-bottom: var(--space-sm);
}
.mb-md {
  margin-bottom: var(--space-md);
}
.mb-lg {
  margin-bottom: var(--space-lg);
}
.mb-xl {
  margin-bottom: var(--space-xl);
}

.gap-sm {
  gap: var(--space-sm);
}
.gap-md {
  gap: var(--space-md);
}
.gap-lg {
  gap: var(--space-lg);
}

.flex {
  display: flex;
}
.flex-col {
  flex-direction: column;
}
.items-center {
  align-items: center;
}
.justify-center {
  justify-content: center;
}
.justify-between {
  justify-content: space-between;
}

.grid {
  display: grid;
}
.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}
.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}
.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 768px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* ================================================
   LANGUAGE SWITCHER (JP / EN) - header right
   ================================================ */
.lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: transparent;
  border: 1px solid var(--uchu-border);
  border-radius: 100px;
  padding: 2px;
  margin-left: var(--space-sm);
}

.lang-switch-btn {
  background: transparent;
  border: none;
  color: var(--uchu-text-secondary);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 100px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  line-height: 1;
}

.lang-switch-btn:hover {
  color: var(--uchu-text-primary);
}

.lang-switch-btn.active {
  background: var(--uchu-text-primary);
  color: var(--uchu-bg-light);
}

[data-theme="dark"] .lang-switcher {
  border-color: var(--uchu-border);
}

[data-theme="dark"] .lang-switch-btn.active {
  background: var(--uchu-text-primary);
  color: var(--uchu-bg-dark);
}
