/* ========================================
   TypeSync - 共通スタイルシート
   デザイン: ホワイト×ネイビー SaaS風クリーンUI
   ======================================== */

/* ---- Google Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

/* ---- CSS変数（デザイントークン） ---- */
:root {
  /* カラーパレット */
  --navy-900: #0f1f3d;
  --navy-800: #1b3a6b;
  --navy-700: #1e4080;
  --navy-600: #2952a8;
  --blue-500: #3b82f6;
  --blue-400: #60a5fa;
  --blue-100: #dbeafe;
  --blue-50:  #eff6ff;
  --gray-900: #111827;
  --gray-700: #374151;
  --gray-500: #6b7280;
  --gray-300: #d1d5db;
  --gray-100: #f3f4f6;
  --gray-50:  #f9fafb;
  --white:    #ffffff;
  --red-500:  #ef4444;
  --red-50:   #fef2f2;
  --amber-500: #f59e0b;
  --amber-50:  #fffbeb;
  --green-500: #22c55e;
  --green-50:  #f0fdf4;

  /* タイポグラフィ */
  --font-sans: 'Noto Sans JP', 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;

  /* スペーシング */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* 角丸 */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* シャドウ */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.08), 0 4px 6px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 25px rgba(0,0,0,0.10), 0 8px 10px rgba(0,0,0,0.04);
  --shadow-blue: 0 4px 14px rgba(59,130,246,0.25);

  /* トランジション */
  --transition: 0.2s ease;
  --transition-slow: 0.35s ease;
}

/* ---- リセット & ベース ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  color: var(--gray-900);
  background-color: var(--white);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--blue-500);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--navy-800);
}

ul, ol {
  list-style: none;
}

/* ---- レイアウト ---- */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.container--narrow {
  max-width: 800px;
}

.container--wide {
  max-width: 1280px;
}

main {
  flex: 1;
}

/* ---- ヘッダー ---- */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-100);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
}

.site-logo__icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--navy-800), var(--blue-500));
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 1rem;
  font-weight: 700;
}

.site-logo__text {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--navy-800);
  letter-spacing: -0.02em;
}

.site-logo__badge {
  font-size: 0.65rem;
  background: var(--blue-100);
  color: var(--blue-500);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.site-nav a {
  color: var(--gray-700);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color var(--transition);
}

.site-nav a:hover {
  color: var(--navy-800);
}

.header-cta {
  background: var(--navy-800);
  color: var(--white) !important;
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  transition: background var(--transition), transform var(--transition) !important;
}

.header-cta:hover {
  background: var(--navy-700) !important;
  color: var(--white) !important;
  transform: translateY(-1px);
}

/* ---- フッター ---- */
.site-footer {
  background: var(--navy-900);
  color: rgba(255,255,255,0.7);
  padding: var(--space-16) 0 var(--space-8);
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-12);
  margin-bottom: var(--space-12);
}

.footer-brand__logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.footer-brand__logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--navy-600), var(--blue-400));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 0.875rem;
  font-weight: 700;
}

.footer-brand__logo-text {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--white);
}

.footer-brand__desc {
  font-size: 0.875rem;
  line-height: 1.7;
  color: rgba(255,255,255,0.5);
}

.footer-col__title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-bottom: var(--space-4);
}

.footer-col__links li {
  margin-bottom: var(--space-2);
}

.footer-col__links a {
  color: rgba(255,255,255,0.6);
  font-size: 0.875rem;
  transition: color var(--transition);
}

.footer-col__links a:hover {
  color: var(--white);
}

.site-footer__bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: var(--space-8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.3);
}

/* ---- ボタン ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn--primary {
  background: var(--navy-800);
  color: var(--white);
}

.btn--primary:hover {
  background: var(--navy-700);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn--blue {
  background: var(--blue-500);
  color: var(--white);
  box-shadow: var(--shadow-blue);
}

.btn--blue:hover {
  background: var(--navy-800);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.btn--ghost {
  background: transparent;
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
}

.btn--ghost:hover {
  background: var(--gray-50);
  color: var(--gray-900);
}

.btn--lg {
  padding: var(--space-4) var(--space-8);
  font-size: 1rem;
  border-radius: var(--radius-lg);
}

.btn--full {
  width: 100%;
}

/* ---- タイプバッジ ---- */
.type-badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: var(--navy-800);
  color: var(--white);
}

.type-badge--outline {
  background: transparent;
  border: 1.5px solid var(--navy-800);
  color: var(--navy-800);
}

/* ---- セクション共通 ---- */
.section {
  padding: var(--space-16) 0;
}

.section--gray {
  background: var(--gray-50);
}

.section--navy {
  background: var(--navy-900);
  color: var(--white);
}

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

.section-eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue-500);
  margin-bottom: var(--space-3);
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--gray-900);
  letter-spacing: -0.02em;
}

.section-desc {
  margin-top: var(--space-4);
  font-size: 1rem;
  color: var(--gray-500);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ---- カード ---- */
.card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-md);
  transition: box-shadow var(--transition), transform var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

/* ---- アラートバナー ---- */
.alert {
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius-lg);
  border-left: 4px solid;
  font-size: 0.9rem;
}

.alert--warning {
  background: var(--amber-50);
  border-color: var(--amber-500);
  color: #92400e;
}

.alert--danger {
  background: var(--red-50);
  border-color: var(--red-500);
  color: #991b1b;
}

.alert--info {
  background: var(--blue-50);
  border-color: var(--blue-500);
  color: #1e40af;
}

.alert--success {
  background: var(--green-50);
  border-color: var(--green-500);
  color: #166534;
}

/* ---- ユーティリティ ---- */
.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }
.font-bold   { font-weight: 700; }
.font-medium { font-weight: 500; }
.text-sm     { font-size: 0.875rem; }
.text-xs     { font-size: 0.75rem; }
.text-lg     { font-size: 1.125rem; }
.text-xl     { font-size: 1.25rem; }
.text-2xl    { font-size: 1.5rem; }
.text-3xl    { font-size: 1.875rem; }
.text-navy   { color: var(--navy-800); }
.text-blue   { color: var(--blue-500); }
.text-gray   { color: var(--gray-500); }
.text-white  { color: var(--white); }
.mt-2  { margin-top: var(--space-2); }
.mt-4  { margin-top: var(--space-4); }
.mt-6  { margin-top: var(--space-6); }
.mt-8  { margin-top: var(--space-8); }
.mb-2  { margin-bottom: var(--space-2); }
.mb-4  { margin-bottom: var(--space-4); }
.mb-6  { margin-bottom: var(--space-6); }
.mb-8  { margin-bottom: var(--space-8); }
.flex  { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.hidden { display: none; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ---- レスポンシブ ---- */
@media (max-width: 768px) {
  .container {
    padding: 0 var(--space-4);
  }

  .site-header__inner {
    height: 56px;
  }

  .site-nav {
    display: none;
  }

  .site-footer__grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .site-footer__bottom {
    flex-direction: column;
    gap: var(--space-2);
    text-align: center;
  }

  .section {
    padding: var(--space-12) 0;
  }

  .section-title {
    font-size: 1.5rem;
  }
}

/* ---- UGC投稿フォーム ---- */
.ugc-submit-form {
  margin-top: var(--space-8);
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--gray-200);
  overflow: hidden;
}

.ugc-submit-form__header {
  background: var(--navy-50);
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--gray-200);
}

.ugc-submit-form__title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--navy-800);
  margin-bottom: var(--space-1);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.ugc-submit-form__icon {
  font-size: 1.25rem;
}

.ugc-submit-form__desc {
  font-size: 0.875rem;
  color: var(--gray-600);
  margin: 0;
}

.ugc-submit-form form {
  padding: var(--space-6);
}

.ugc-submit-form__input-wrapper {
  position: relative;
}

.ugc-submit-form textarea {
  width: 100%;
  padding: var(--space-4);
  background: var(--gray-50);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.6;
  resize: vertical;
  min-height: 120px;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.ugc-submit-form textarea:focus {
  outline: none;
  background: white;
  border-color: var(--blue-500);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.ugc-submit-form__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-4);
}

.ugc-submit-form__counter {
  font-size: 0.875rem;
  color: var(--gray-500);
  font-weight: 500;
}

.ugc-submit-result {
  margin: 0 var(--space-6) var(--space-6) var(--space-6);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
}

.ugc-submit-result.success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.ugc-submit-result.error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* ---- UGC削除ボタン ---- */
.ugc-item {
  position: relative;
  transition: opacity 0.3s ease;
}

.ugc-delete-btn {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  background: white;
  border: 1px solid var(--gray-200);
  color: var(--gray-500);
  border-radius: var(--radius-sm);
  padding: 4px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.ugc-delete-btn:hover {
  background: var(--red-50);
  border-color: var(--red-200);
  color: var(--red-600);
}

/* ---- 労働錯覚ローディング (Labor Illusion UI) ---- */
.analyzer-loading {
  padding: var(--space-16) 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 250px;
}
.analyzer-loading.hidden {
  display: none !important;
}
.analyzer-loading__content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  animation: fadeIn 0.4s ease-out forwards;
}
.analyzer-loading__spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--gray-100);
  border-top-color: var(--blue-500);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: var(--space-2);
}
.analyzer-loading__text {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--navy-800);
  margin: 0;
  transition: opacity 0.3s ease;
}
.analyzer-loading__subtext {
  font-size: 0.85rem;
  color: var(--gray-500);
  margin: 0;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ========== Bottom Navigation (Mobile Only) ========== */
.bottom-nav {
  display: none;
}

@media (max-width: 768px) {
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-top: 1px solid var(--gray-200);
    box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
    z-index: 999;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .bottom-nav__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 0;
    color: var(--gray-500);
    text-decoration: none;
    font-size: 0.65rem;
    font-weight: 700;
    transition: all 0.2s ease;
    border-right: 1px solid var(--gray-100);
  }

  .bottom-nav__item:last-child {
    border-right: none;
  }

  .bottom-nav__item:active {
    background: var(--gray-50);
  }

  /* 選択時・ホバー時の基本色 */
  .bottom-nav__item:hover {
    color: var(--navy-800);
  }

  /* CTAボタンの色味（洗練されたブルーとレッド） */
  .bottom-nav__item--primary {
    color: var(--blue-600);
  }
  .bottom-nav__item--primary:hover {
    color: var(--blue-800);
    background: var(--blue-50);
  }

  .bottom-nav__item--danger {
    color: var(--red-500);
  }
  .bottom-nav__item--danger:hover {
    color: var(--red-700);
    background: #fef2f2;
  }

  .bottom-nav__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
    height: 24px;
  }
  
  /* SVGの色は親要素のcolorを引き継ぐ */
  .bottom-nav__icon svg {
    stroke: currentColor;
  }

  .bottom-nav-spacer {
    display: block;
    height: calc(60px + env(safe-area-inset-bottom));
  }
}
