/* Excel処理専用スタイル */

/* コンテナ */
.excel-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

/* グリッドレイアウト */
.excel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

@media (max-width: 768px) {
  .excel-grid {
    grid-template-columns: 1fr;
  }
}

/* カード */
.excel-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

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

.excel-card h3 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 600;
}

/* ファイルアップロードエリア */
.file-upload-area {
  border: 2px dashed var(--gray-color);
  border-radius: var(--radius);
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 1.5rem;
  background: rgba(255, 255, 255, 0.5);
}

.file-upload-area:hover {
  border-color: var(--primary-color);
  background: rgba(102, 126, 234, 0.1);
}

.file-upload-area.drag-over {
  border-color: var(--primary-color);
  background: rgba(102, 126, 234, 0.15);
  transform: scale(1.02);
}

.file-upload-area i {
  font-size: 3rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
  display: block;
}

.file-upload-area p {
  font-size: 1.125rem;
  color: var(--text-color);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.file-upload-area span {
  display: block;
  color: var(--text-secondary);
  margin: 0.5rem 0;
}

/* ファイル情報 */
.file-info {
  display: none;
  background: linear-gradient(135deg, rgba(72, 187, 120, 0.1) 0%, rgba(56, 161, 105, 0.1) 100%);
  padding: 1rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  align-items: center;
  gap: 1rem;
  border: 1px solid rgba(72, 187, 120, 0.3);
}

.file-info.visible {
  display: flex;
}

.file-info i {
  font-size: 2rem;
  color: var(--success-color);
}

.file-name {
  flex: 1;
  font-weight: 500;
  color: var(--text-color);
  word-break: break-all;
}

/* スプレッドシート */
.spreadsheet-container {
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--gray-color);
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow-sm);
}

.spreadsheet-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

.spreadsheet-table th,
.spreadsheet-table td {
  border: 1px solid var(--light-tertiary);
  padding: 0.5rem;
  min-width: 100px;
}

.spreadsheet-table th {
  background: linear-gradient(180deg, var(--light-secondary) 0%, var(--light-tertiary) 100%);
  font-weight: 600;
  text-align: center;
  color: var(--text-color);
  font-size: 0.875rem;
  position: sticky;
  top: 0;
  z-index: 10;
}

.spreadsheet-table td:first-child {
  background: linear-gradient(90deg, var(--light-secondary) 0%, var(--light-tertiary) 100%);
  text-align: center;
  font-weight: 600;
  min-width: 50px;
  color: var(--text-secondary);
  position: sticky;
  left: 0;
  z-index: 5;
}

.cell-input {
  width: 100%;
  border: none;
  padding: 0.5rem;
  font-family: inherit;
  font-size: 0.875rem;
  background: transparent;
  transition: var(--transition-fast);
}

.cell-input:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: -2px;
  background: rgba(102, 126, 234, 0.05);
}

.active-cell {
  background: rgba(102, 126, 234, 0.1) !important;
  box-shadow: inset 0 0 0 2px var(--primary-color);
}

/* スプレッドシートコントロール */
.spreadsheet-controls {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.control-group {
  display: flex;
  gap: 0.5rem;
}

/* 結果セクション */
.result-section {
  margin-top: 2rem;
  display: none;
  animation: fadeInUp 0.5s ease-out;
}

.result-section.visible {
  display: block;
}

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

/* CSVプレビュー */
.csv-preview {
  overflow-x: auto;
  max-height: 400px;
  border: 1px solid var(--gray-color);
  border-radius: var(--radius);
  margin-top: 1rem;
  background: white;
  box-shadow: var(--shadow-sm);
}

.csv-preview table {
  width: 100%;
  border-collapse: collapse;
}

.csv-preview th,
.csv-preview td {
  border: 1px solid var(--light-tertiary);
  padding: 0.75rem;
  text-align: left;
  font-size: 0.875rem;
}

.csv-preview th {
  background: linear-gradient(180deg, var(--light-secondary) 0%, var(--light-tertiary) 100%);
  font-weight: 600;
  position: sticky;
  top: 0;
  color: var(--text-color);
  z-index: 10;
}

.csv-preview td {
  color: var(--text-color);
}

.csv-preview tbody tr:nth-child(even) {
  background: rgba(102, 126, 234, 0.03);
}

.csv-preview tbody tr:hover {
  background: rgba(102, 126, 234, 0.08);
}

/* チャートコンテナ */
.chart-container {
  position: relative;
  height: 300px;
  margin: 1.5rem 0;
  background: white;
  padding: 1rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

/* アコーディオン */
.accordion-item {
  border: 1px solid var(--gray-color);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  overflow: hidden;
  background: white;
  transition: var(--transition);
}

.accordion-item:hover {
  box-shadow: var(--shadow-sm);
}

.accordion-header {
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(159, 122, 234, 0.05) 100%);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
  user-select: none;
}

.accordion-header:hover {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(159, 122, 234, 0.1) 100%);
}

.accordion-header h4 {
  margin: 0;
  font-size: 1rem;
  color: var(--text-color);
  font-weight: 600;
}

.accordion-header i {
  color: var(--primary-color);
  transition: var(--transition);
}

.accordion-content {
  padding: 0 1.5rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out, padding 0.3s ease-out;
}

.accordion-item.active .accordion-content {
  max-height: 500px;
  padding: 1rem 1.5rem;
}

.accordion-item.active .accordion-header {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(159, 122, 234, 0.15) 100%);
}

.accordion-item.active .accordion-header i {
  transform: rotate(180deg);
}

.accordion-content p {
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ヘルプステップ */
.help-steps {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.help-step {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  border-radius: var(--radius);
  transition: var(--transition);
}

.help-step:hover {
  background: rgba(102, 126, 234, 0.05);
}

.help-step-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.25rem;
  box-shadow: var(--shadow);
}

.help-step-content h4 {
  margin-bottom: 0.5rem;
  color: var(--text-color);
  font-weight: 600;
}

.help-step-content p {
  color: var(--text-secondary);
  line-height: 1.6;
}

/* バッジ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--shadow-sm);
}

.badge.secondary {
  background: var(--light-secondary);
  color: var(--text-color);
  border: 1px solid var(--gray-color);
}

/* 最近のリスト */
.recent-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.recent-list p {
  color: var(--text-secondary);
  text-align: center;
  padding: 2rem 0;
}

/* タブナビゲーション（既存のスタイルを上書き） */
.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  padding: 0.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

.tab-btn {
  flex: 1;
  min-width: 120px;
  padding: 0.75rem 1.5rem;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.tab-btn:hover {
  background: rgba(102, 126, 234, 0.1);
  color: var(--primary-color);
}

.tab-btn.active {
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--shadow);
}

.tab-btn i {
  font-size: 1rem;
}

/* タブコンテンツ */
.tab-content {
  display: none;
  animation: fadeIn 0.3s ease-out;
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .excel-container {
    padding: 1rem;
  }
  
  .excel-card {
    padding: 1.5rem;
  }
  
  .tabs {
    flex-direction: column;
  }
  
  .tab-btn {
    width: 100%;
  }
  
  .spreadsheet-controls {
    flex-direction: column;
  }
  
  .control-group {
    width: 100%;
  }
  
  .help-step {
    flex-direction: column;
    text-align: center;
  }
  
  .help-step-icon {
    margin: 0 auto;
  }
}
