/* 仮名 - リーダー画面 M1 */

/* フォント読み込み - Google Fontsから */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500&family=Noto+Sans+JP:wght@400;500&family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@24,400,0,0&display=swap');

/* リセット・基本設定 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* 色 */
  --bg-primary: #FFFFFF;
  --bg-secondary: #F8F9FA;
  --bg-input: #F1F3F4;
  --border: #DADCE0;
  --text-primary: #202124;
  --text-secondary: #5F6368;
  --text-disabled: #80868B;
  --blue-primary: #1A73E8;
  --blue-light: #E8F0FE;
  --blue-dark: #174EA6;
  --green-primary: #1E8E3E;
  --green-light: #E6F4EA;
  --red-primary: #D93025;
  --red-light: #FCE8E6;
  --yellow-primary: #F9AB00;
  --yellow-light: #FEF7E0;
  
  /* Gemini グラデーション */
  --gradient-gemini: linear-gradient(110deg, #E8F0FE, #F3E8FD, #FCE8F3);
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Inter', 'Noto Sans JP', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-secondary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Material Symbols アイコン */
.icon {
  font-family: 'Material Symbols Rounded';
  font-weight: 400;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

/* タイポグラフィ */
h1 {
  font-size: 28px;
  line-height: 36px;
  font-weight: 400;
  margin: 0;
}

h2 {
  font-size: 22px;
  line-height: 28px;
  font-weight: 500;
  margin: 0;
}

h3 {
  font-size: 16px;
  line-height: 24px;
  font-weight: 500;
  margin: 0;
}

.text-secondary {
  color: var(--text-secondary);
}

.text-small {
  font-size: 14px;
  line-height: 20px;
}

.text-tiny {
  font-size: 12px;
  line-height: 16px;
}

/* 数字の表示 */
.tabular {
  font-variant-numeric: tabular-nums;
}

/* レイアウト */
#app {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* ヘッダーバー */
.header {
  height: 64px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  font-size: 22px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue-primary);
}

.facility-name {
  font-size: 16px;
  color: var(--text-secondary);
  margin-left: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  background: var(--bg-input);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* メインコンテナ */
.main-container {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* 左ナビゲーション */
.left-nav {
  width: 80px;
  background: var(--bg-primary);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 24px;
  gap: 16px;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 8px;
  border-radius: 999px;
  cursor: pointer;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  transition: background 200ms, color 200ms;
  width: 64px;
  height: auto;
}

.nav-item:hover {
  background: var(--blue-light);
}

.nav-item.active {
  background: var(--blue-light);
  color: var(--blue-primary);
}

.nav-label {
  font-size: 12px;
  font-weight: 500;
  text-align: center;
}

/* 中央・右ペイン */
.content-area {
  flex: 1;
  display: flex;
  gap: 24px;
  padding: 24px;
  overflow: hidden;
  min-width: 0;
}

.center-pane {
  flex: 1;
  background: var(--bg-primary);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 560px;
}

.right-pane {
  width: 360px;
  background: var(--bg-primary);
  border-radius: 16px;
  padding: 24px;
  overflow-y: auto;
  flex-shrink: 0;
}

/* タブ */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.tab {
  padding: 16px 24px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 200ms, border-color 200ms;
}

.tab:hover {
  color: var(--text-primary);
}

.tab.active {
  color: var(--blue-primary);
  border-bottom-color: var(--blue-primary);
}

/* タブコンテンツ */
.tab-content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* カレンダー */
.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.calendar-day-header {
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 8px;
}

.calendar-day {
  aspect-ratio: 1;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  cursor: pointer;
  background: var(--bg-primary);
  transition: background 200ms;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
}

.calendar-day:hover {
  background: var(--bg-secondary);
}

.calendar-day.has-vacancy {
  background: var(--red-light);
  border-color: var(--red-primary);
}

.calendar-day.selected {
  background: var(--blue-light);
  border-color: var(--blue-primary);
}

.day-number {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.day-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--red-primary);
  color: white;
  text-align: center;
}

/* タイムライン */
.timeline-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.interval-selector {
  display: flex;
  gap: 8px;
}

.interval-btn {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 200ms, border-color 200ms;
}

.interval-btn:hover {
  background: var(--bg-secondary);
}

.interval-btn.active {
  background: var(--blue-light);
  border-color: var(--blue-primary);
  color: var(--blue-primary);
}

.timeline-grid {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.timeline-header,
.timeline-cell {
  background: var(--bg-primary);
  padding: 12px;
  font-size: 14px;
}

.timeline-header {
  font-weight: 500;
  background: var(--bg-secondary);
}

.timeline-row {
  display: contents;
}

.timeline-bar {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}

.staff-block {
  padding: 4px 12px;
  border-radius: 8px;
  background: var(--blue-light);
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 500;
}

.vacancy-block {
  padding: 4px 12px;
  border-radius: 8px;
  background: var(--red-light);
  color: var(--red-primary);
  font-size: 12px;
  font-weight: 500;
}

.warning-indicator {
  padding: 4px 12px;
  border-radius: 8px;
  background: var(--yellow-light);
  color: var(--yellow-primary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

/* 右パネル */
.detail-section {
  margin-bottom: 24px;
}

.detail-section:last-child {
  margin-bottom: 0;
}

.section-title {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 12px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  color: var(--text-secondary);
}

.info-value {
  font-weight: 500;
  text-align: right;
}

/* AIカード */
.ai-card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  position: relative;
  overflow: hidden;
}

.ai-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--gradient-gemini);
  opacity: 0.6;
  z-index: 0;
}

.ai-card-content {
  position: relative;
  z-index: 1;
}

.ai-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.ai-label .icon {
  font-size: 18px;
  background: linear-gradient(120deg, #4285F4, #A368D9, #D36AB0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.ai-reason {
  font-size: 14px;
  line-height: 20px;
  margin: 12px 0;
}

.constraint-list {
  list-style: none;
  margin: 12px 0;
}

.constraint-list li {
  display: flex;
  align-items: start;
  gap: 8px;
  font-size: 14px;
  line-height: 20px;
  margin-bottom: 8px;
}

.constraint-list li:last-child {
  margin-bottom: 0;
}

.constraint-list .icon {
  font-size: 18px;
  color: var(--blue-primary);
  flex-shrink: 0;
}

/* ボタン */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 200ms, opacity 200ms;
  border: none;
  min-height: 40px;
}

.button-primary {
  background: var(--blue-primary);
  color: white;
}

.button-primary:hover {
  opacity: 0.9;
}

.button-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.button-outline {
  background: transparent;
  color: var(--blue-primary);
  border: 1px solid var(--border);
}

.button-outline:hover {
  background: var(--blue-light);
}

.button-text {
  background: transparent;
  color: var(--blue-primary);
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.button-text:hover {
  background: var(--blue-light);
}

/* デモリセットボタン */
.demo-reset {
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 200ms, color 200ms;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.demo-reset:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.button-group {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

/* 候補リスト */
.candidate-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.candidate-card {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: background 200ms;
}

.candidate-card:hover {
  background: var(--bg-secondary);
}

.candidate-card.selected {
  background: var(--blue-light);
  border-color: var(--blue-primary);
}

.candidate-card.unavailable {
  opacity: 0.5;
  cursor: not-allowed;
}

.candidate-name {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 4px;
}

.candidate-reason {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 20px;
}

/* ユーティリティ */
.mt-24 {
  margin-top: 24px;
}

.mb-12 {
  margin-bottom: 12px;
}

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

/* 空状態・案内カード */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-secondary);
}

.empty-state .icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.guidance-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
}

.guidance-card .icon {
  font-size: 48px;
  color: var(--blue-primary);
  margin-bottom: 16px;
  opacity: 0.8;
}

.guidance-card h3 {
  margin-bottom: 12px;
}

.guidance-card p {
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 24px;
}

/* ステッパー */
.stepper {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: 12px;
}

.stepper-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-secondary);
  position: relative;
}

.stepper-step::after {
  content: '';
  position: absolute;
  top: 12px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--border);
  z-index: 0;
}

.stepper-step:last-child::after {
  display: none;
}

.stepper-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  transition: all 200ms;
}

.stepper-step.active .stepper-dot {
  background: var(--blue-primary);
  border-color: var(--blue-primary);
}

.stepper-step.active {
  color: var(--blue-primary);
  font-weight: 500;
}

.stepper-step.completed .stepper-dot {
  background: var(--green-light);
  border-color: var(--green-primary);
}

.stepper-step.completed::after {
  background: var(--green-primary);
}

.stepper-step.completed .icon {
  font-size: 14px;
  color: var(--green-primary);
}

/* スクロールバー */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-disabled);
}

/* アニメーション */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 300ms ease-out;
}
