/* 基本スタイル */
:root {
  --primary-color: #3452a5;
  --primary-dark: #29408f;
  --primary-light: #eef0f7;
  --secondary-color: #f8f9fa;
  --text-color: #333333;
  --text-light: #6c757d;
  --bg-color: #f5f7fa;
  --border-radius: 6px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --transition: all 0.1s ease-in-out;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Noto Sans JP', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* コンテナとレイアウト */
.container {
  width: 100%;
  padding: 1rem;
  margin: 0 auto;
}

.header {
  text-align: center;
  margin-bottom: 1.5rem;
  padding-top: 1rem;
}

.main-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.app-title {
  color: var(--primary-color);
  font-weight: 700;
  font-size: 1.6rem;
  margin-bottom: 0.25rem;
  letter-spacing: -0.5px;
}

.subtitle {
  color: var(--text-light);
  font-size: 0.875rem;
}

/* タブスライダー */
.tab-slider {
  position: relative;
  display: flex;
  background: white;
  border-radius: 30px;
  padding: 0.25rem;
  box-shadow: var(--shadow-sm);
  margin: 0 auto;
  max-width: 100%;
  width: 100%;
  overflow: hidden;
  z-index: 1;
  margin-bottom: 0.5rem;
}

.tab-indicator {
  position: absolute;
  top: 0.25rem;
  left: 0;
  width: 50%;
  height: calc(100% - 0.5rem);
  background: var(--primary-color);
  border-radius: 30px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: -1;
}

.tab-button {
  flex: 1;
  padding: 0.75rem 0;
  text-align: center;
  color: var(--text-light);
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 30px;
  font-weight: 500;
  font-size: 0.875rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 2;
  white-space: nowrap;
}

.tab-button.active {
  color: white;
  font-weight: 600;
  font-size: 1.05rem;
}

/* スワイプヒント */
.swipe-hint {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
  opacity: 0.6;
}

.swipe-icon {
  font-size: 0.75rem;
  color: var(--text-light);
  animation: fadeInOut 3s infinite;
  padding: 0.25rem 0.75rem;
  background-color: rgba(255, 255, 255, 0.7);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
}

@keyframes fadeInOut {
  0% { opacity: 0.2; }
  50% { opacity: 0.8; }
  100% { opacity: 0.2; }
}

/* タブビューコンテナ */
.tab-view-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  margin-bottom: 1.5rem;
}

/* 
 * 注：以下はCSSモジュールと競合するため無効化
 * CSSモジュール (.tabContentWrapper) を使用すること
 */
/*
.tab-content-wrapper {
  display: flex;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  width: 200%;
  transform: translateX(0);
}
*/

/* 
 * 注：以下はCSSモジュールと競合するため無効化
 * CSSモジュール (.tabContent) を使用すること
 */
/*
.tab-content {
  width: 100%;
  flex-shrink: 0;
  padding: 1.25rem;
  opacity: 0.5;
  transform: scale(0.9);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-content.active {
  opacity: 1;
  transform: scale(1);
}
*/

/* フォーム要素 */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--text-light);
}

.input-field {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 1rem;
  background-color: #f9fafb;
  transition: var(--transition);
}

.input-field:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(52, 82, 165, 0.1);
  border-color: var(--primary-color);
  background-color: white;
}

/* 結果表示 */
.result {
  margin-top: 1.25rem;
}

.result h5 {
  margin-bottom: 0.75rem;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-light);
}

.result-box {
  background: white;
  border-radius: var(--border-radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid #eef0f2;
  transition: var(--transition);
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.result-item {
  display: flex;
  flex-direction: column;
}

.result-label {
  font-weight: 500;
  color: var(--text-light);
  margin-bottom: 0.25rem;
  font-size: 0.75rem;
}

.result-value {
  font-weight: 700;
  color: var(--primary-color);
  font-size: 1.1rem;
}

/* 早見表 */
.era-table-container {
  width: 100%;
  margin-top: 1rem;
  overflow: hidden;
  border-radius: var(--border-radius);
}

.era-table {
  background: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.era-table h4 {
  background-color: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 600;
  padding: 1rem;
  margin: 0;
  font-size: 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  position: relative;
  display: flex;
  align-items: center;
}

.continuous-years-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.5rem;
}

/* 情報アイコン */
.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary-dark);
  color: white;
  font-size: 0.75rem;
  font-weight: bold;
  margin-left: 0.5rem;
  cursor: pointer;
  position: relative;
}

.tooltip-content {
  display: none;
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  background: white;
  box-shadow: var(--shadow-md);
  border-radius: var(--border-radius);
  padding: 1rem;
  width: 250px;
  z-index: 100;
  font-weight: normal;
  text-align: left;
  font-size: 0.85rem;
}

.info-icon:hover .tooltip-content {
  display: block;
}

.tooltip-content h5 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: var(--primary-dark);
}

.tooltip-item {
  margin-bottom: 0.3rem;
  font-size: 0.8rem;
}

/* 連続表示テーブル */
.continuous-era-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  white-space: nowrap;
}

.continuous-era-table th,
.continuous-era-table td {
  padding: 0.35rem 0.25rem;
  text-align: center;
  border-right: 1px solid rgba(0,0,0,0.05);
}

.continuous-era-table th {
  background-color: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 600;
  font-size: 0.8rem;
  padding: 0.5rem 0.25rem;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}

.continuous-era-table td {
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.continuous-era-table td.era-year {
  text-align: right;
  padding-right: 0.1rem;
  width: 40px;
}

.continuous-era-table td.western-year {
  text-align: left;
  padding-left: 0.1rem;
  border-right: 1px solid rgba(0,0,0,0.1);
  width: 40px;
}

.continuous-era-table td.current-year {
  background-color: rgba(52, 82, 165, 0.08);
  font-weight: 700;
  color: var(--primary-color);
}

/* アニメーション */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* レスポンシブ対応 */
@media (min-width: 480px) {
  .container {
    padding: 1.5rem;
  }
  
  .header {
    margin-bottom: 2rem;
  }
  
  .app-title {
    font-size: 1.8rem;
  }
  
  .tab-button {
    font-size: 1rem;
    padding: 0.8rem 0;
  }
  
  .tab-button.active {
    font-size: 1.2rem;
  }
  
  .tab-content {
    padding: 1.5rem;
  }
  
  .swipe-icon {
    font-size: 0.8rem;
  }
}

@media (min-width: 768px) {
  .container {
    max-width: 720px;
    padding: 2rem;
  }
  
  .app-title {
    font-size: 2rem;
  }
  
  .tab-slider {
    max-width: 500px;
  }
  
  .tab-content {
    padding: 1.75rem;
  }
  
  .result-value {
    font-size: 1.25rem;
  }
  
  .continuous-era-table {
    font-size: 0.9rem;
  }
  
  .continuous-era-table th {
    font-size: 0.85rem;
    padding: 0.6rem 0.3rem;
  }
  
  .continuous-era-table td {
    padding: 0.4rem 0.3rem;
  }
  
  /* タブレット以上ではスワイプヒントを非表示 */
  .swipe-hint {
    display: none;
  }
}

@media (min-width: 992px) {
  .container {
    max-width: 960px;
    padding: 2.5rem;
  }
  
  .app-title {
    font-size: 2.25rem;
  }
  
  .subtitle {
    font-size: 1rem;
  }
  
  .tab-slider {
    max-width: 600px;
  }
  
  .tab-content {
    padding: 2rem;
  }
}

/* ダークモード対応 - Material Design 3準拠 */
@media (prefers-color-scheme: dark) {
  :root {
    /* ダークモード用CSS変数オーバーライド */
    --primary-color: #7bb3ff;
    --primary-dark: #9ac5ff;
    --primary-light: #242424;
    --secondary-color: #1e1e1e;
    --text-color: #e1e3e6;
    --text-light: #bdc1c6;
    --bg-color: #121212;
    --border-radius: 8px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.6);
    --transition: all 0.1s ease-in-out;
    
    /* ダークモード専用変数 */
    --dark-bg-primary: #121212;
    --dark-bg-secondary: #1e1e1e;
    --dark-bg-tertiary: #2d2d2d;
    --dark-surface: #242424;
    --dark-border: #3c4043;
    --dark-text: #e1e3e6;
    --dark-text-secondary: #bdc1c6;
  }
  
  body {
    background-color: var(--dark-bg-primary);
    color: var(--dark-text);
  }
  
  /* タブスライダー */
  .tab-slider {
    background-color: var(--dark-bg-secondary);
    border: 1px solid var(--dark-border);
  }
  
  .tab-indicator {
    background: var(--primary-color);
  }
  
  .tab-button {
    color: var(--dark-text-secondary);
  }
  
  .tab-button.active {
    color: white;
  }
  
  /* コンテンツエリア */
  .tab-view-container {
    background-color: var(--dark-bg-secondary);
    border: 1px solid var(--dark-border);
  }
  
  /* 入力フィールド */
  .input-field {
    background-color: var(--dark-bg-tertiary);
    border-color: var(--dark-border);
    color: var(--dark-text);
  }
  
  .input-field:focus {
    background-color: var(--dark-bg-secondary);
    border-color: var(--primary-color);
  }
  
  /* 結果表示 */
  .result-box {
    background-color: var(--dark-bg-secondary);
    border: 1px solid var(--dark-border);
  }
  
  /* テーブル */
  .era-table {
    background-color: var(--dark-bg-secondary);
    border: 1px solid var(--dark-border);
  }
  
  .continuous-era-table th {
    background-color: var(--dark-surface);
    color: var(--primary-color);
  }
  
  .continuous-era-table td.current-year {
    background-color: rgba(123, 179, 255, 0.15);
    color: var(--primary-color);
  }
  
  /* ツールチップ */
  .tooltip-content {
    background-color: var(--dark-bg-secondary);
    border: 1px solid var(--dark-border);
    color: var(--dark-text);
  }
  
  .tooltip-content h5 {
    color: var(--primary-color);
  }
  
  /* スワイプアイコン */
  .swipe-icon {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--dark-text-secondary);
  }
} 