/* ビジネス計算ツール - メインCSS */

/* 基本スタイル */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', 'Hiragino Sans', 'Yu Gothic UI', sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f8f9fa;
  color: #333;
  line-height: 1.6;
}

.App {
  max-width: 1600px;
  margin: 0 auto;
  padding: 20px;
}

/* ヘッダー */
.main-header {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 30px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 25px;
  border-radius: 15px;
  color: white;
  box-shadow: 0 8px 32px rgba(102, 126, 234, 0.3);
}

.title-section h1 {
  margin: 0;
  font-size: 2.2rem;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-navigation {
  flex-grow: 1;
}

.fixed-buttons-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.navigation-link {
  display: inline-block;
  padding: 10px 18px;
  background: rgba(255,255,255,0.2);
  color: white;
  text-decoration: none;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.navigation-link:hover {
  background: rgba(255,255,255,0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255,255,255,0.2);
}

.back-link {
  background: rgba(255,255,255,0.3) !important;
  font-weight: 600;
}

/* メインコンテンツ */
.main-content {
  background: white;
  border-radius: 15px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  overflow: hidden;
}

/* タブナビゲーション */
.tab-navigation {
  display: flex;
  flex-wrap: wrap;
  background: #f8f9fa;
  border-bottom: 3px solid #e9ecef;
  padding: 10px 15px;
  gap: 5px;
}

.tab-btn {
  padding: 12px 20px;
  border: none;
  background: transparent;
  color: #6c757d;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
  white-space: nowrap;
}

.tab-btn:hover {
  background: #e9ecef;
  color: #495057;
}

.tab-btn.active {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* タブコンテンツ */
.tab-content-container {
  padding: 30px;
  min-height: 600px;
}

.tab-content {
  display: none;
}

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

.tab-content h2 {
  margin: 0 0 30px 0;
  font-size: 1.8rem;
  color: #2c3e50;
  border-bottom: 3px solid #667eea;
  padding-bottom: 10px;
}

/* 計算セクション */
.calc-section {
  margin-bottom: 40px;
  padding: 25px;
  background: #f8f9fa;
  border-radius: 12px;
  border-left: 5px solid #667eea;
}

.calc-section h3 {
  margin: 0 0 20px 0;
  font-size: 1.3rem;
  color: #495057;
  font-weight: 600;
}

/* 入力グループ */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.input-row {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

.input-row label {
  min-width: 120px;
  font-weight: 600;
  color: #495057;
  font-size: 14px;
}

.input-row input,
.input-row select,
.input-row textarea {
  flex: 1;
  min-width: 200px;
  padding: 10px 12px;
  border: 2px solid #e9ecef;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.3s ease;
}

.input-row input:focus,
.input-row select:focus,
.input-row textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-row textarea {
  resize: vertical;
  min-height: 80px;
}

.input-row span {
  color: #6c757d;
  font-weight: 500;
  font-size: 14px;
}

/* ボタンスタイル */
.calc-btn {
  padding: 12px 24px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
  align-self: flex-start;
}

.calc-btn:hover {
  background: linear-gradient(135deg, #764ba2, #667eea);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.button-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* 結果表示 */
.result-display {
  margin-top: 20px;
  min-height: 60px;
  padding: 20px;
  background: white;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-family: 'Courier New', monospace;
}

.result-display:empty::before {
  content: '計算結果がここに表示されます';
  color: #6c757d;
  font-style: italic;
  font-family: 'Segoe UI', sans-serif;
}

.result-success {
  background: #d4edda;
  border-color: #c3e6cb;
  color: #155724;
}

.result-error {
  background: #f8d7da;
  border-color: #f5c6cb;
  color: #721c24;
}

.result-info {
  background: #cce7ff;
  border-color: #b3d9ff;
  color: #004085;
}

/* 結果アイテム */
.result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 10px 0;
  padding: 8px 0;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}

.result-item:last-child {
  border-bottom: none;
}

.result-label {
  font-weight: 600;
  color: #495057;
}

.result-value {
  font-weight: 700;
  font-size: 16px;
}

.result-highlight {
  background: rgba(102, 126, 234, 0.1);
  padding: 4px 8px;
  border-radius: 4px;
  color: #667eea;
}

/* 特別な表示要素 */
.conversion-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-top: 15px;
}

.conversion-item {
  padding: 15px;
  background: #f8f9fa;
  border-radius: 6px;
  text-align: center;
}

.conversion-unit {
  font-size: 12px;
  color: #6c757d;
  margin-bottom: 5px;
}

.conversion-value {
  font-size: 18px;
  font-weight: 700;
  color: #2c3e50;
}

/* カラープレビュー */
.color-preview {
  width: 100px;
  height: 50px;
  border-radius: 6px;
  border: 2px solid #dee2e6;
  margin: 10px 0;
}

/* ハッシュ表示 */
.hash-output {
  word-break: break-all;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  background: #f8f9fa;
  padding: 10px;
  border-radius: 4px;
  border: 1px solid #dee2e6;
}

/* レスポンシブ対応 */
@media (max-width: 1200px) {
  .tab-navigation {
    justify-content: center;
  }
  
  .tab-btn {
    flex: 1;
    min-width: 120px;
  }
}

@media (max-width: 768px) {
  .App {
    padding: 10px;
  }
  
  .main-header {
    flex-direction: column;
    text-align: center;
  }
  
  .tab-navigation {
    flex-direction: column;
    padding: 15px;
  }
  
  .tab-btn {
    flex: none;
    width: 100%;
    margin-bottom: 5px;
  }
  
  .tab-content-container {
    padding: 20px;
  }
  
  .calc-section {
    padding: 20px;
  }
  
  .input-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  
  .input-row label {
    min-width: auto;
  }
  
  .input-row input,
  .input-row select,
  .input-row textarea {
    min-width: auto;
    width: 100%;
  }
  
  .button-group {
    flex-direction: column;
  }
  
  .calc-btn {
    width: 100%;
  }
  
  .conversion-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .title-section h1 {
    font-size: 1.6rem;
  }
  
  .tab-content h2 {
    font-size: 1.4rem;
  }
  
  .calc-section h3 {
    font-size: 1.1rem;
  }
  
  .fixed-buttons-group {
    flex-direction: column;
    width: 100%;
  }
  
  .navigation-link {
    text-align: center;
    width: 100%;
  }
}

/* 特殊な計算結果スタイル */
.timeline-result {
  background: linear-gradient(90deg, #f8f9fa 0%, #e9ecef 100%);
  padding: 15px;
  border-radius: 8px;
  margin: 10px 0;
}

.timeline-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px dashed #dee2e6;
}

.timeline-item:last-child {
  border-bottom: none;
}

.percentage-bar {
  width: 100%;
  height: 20px;
  background: #e9ecef;
  border-radius: 10px;
  overflow: hidden;
  margin: 10px 0;
}

.percentage-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea, #764ba2);
  transition: width 0.5s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 12px;
}

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

.tab-content.active {
  animation: slideIn 0.3s ease;
}

.result-display {
  transition: all 0.3s ease;
}

.result-display:not(:empty) {
  animation: slideIn 0.4s ease;
}