/* 効率化ツール - CSS */

/* 基本スタイル */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f8f9fa;
  color: #333;
  line-height: 1.6;
}

.App {
  max-width: 1400px;
  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: 20px;
  border-radius: 12px;
  color: white;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.title-section h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 600;
}

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

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

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

.navigation-link:hover {
  background: rgba(255,255,255,0.3);
  transform: translateY(-2px);
}

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

/* メインコンテンツ */
.main-content {
  background: white;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* ツール選択タブ */
.tool-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  border-bottom: 2px solid #e9ecef;
  padding-bottom: 10px;
}

.tab-button {
  padding: 12px 24px;
  border: none;
  background: #f8f9fa;
  color: #6c757d;
  border-radius: 8px 8px 0 0;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.tab-button.active {
  background: linear-gradient(135deg, #4CAF50, #45a049);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
}

.tab-button:hover:not(.active) {
  background: #e9ecef;
  color: #495057;
}

/* ツールコンテンツ */
.tool-content {
  display: none;
}

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

.tool-header {
  text-align: center;
  margin-bottom: 30px;
  padding: 20px;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border-radius: 8px;
}

.tool-header h2 {
  margin: 0 0 10px 0;
  color: #495057;
  font-size: 1.8rem;
}

.tool-header p {
  margin: 0;
  color: #6c757d;
  font-size: 1.1rem;
}

/* 正規表現テスター */
.regex-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.input-section, .result-section {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #495057;
}

.form-group input, .form-group textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid #dee2e6;
  border-radius: 6px;
  font-size: 14px;
  font-family: 'Courier New', monospace;
  box-sizing: border-box;
  transition: border-color 0.3s ease;
}

.form-group input:focus, .form-group textarea:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

/* 正規表現パターン入力エリア */
.pattern-input-container {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

#regex-presets {
  flex: 0 0 200px;
  padding: 12px;
  border: 2px solid #dee2e6;
  border-radius: 6px;
  font-size: 14px;
  background: white;
  cursor: pointer;
  transition: border-color 0.3s ease;
}

#regex-presets:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

#regex-pattern {
  flex: 1;
  margin-bottom: 0 !important;
}

/* フラグ表示の改善 */
.regex-flags-container {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8f9fa;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #e9ecef;
}

.flags-label {
  font-weight: 600;
  color: #495057;
  font-size: 14px;
  cursor: help;
}

.regex-flags {
  display: flex;
  gap: 20px;
}

.regex-flags label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  color: #495057;
  background: white;
  padding: 6px 12px;
  border-radius: 4px;
  border: 1px solid #dee2e6;
  transition: all 0.3s ease;
}

.regex-flags label:hover {
  background: #e9ecef;
  border-color: #adb5bd;
}

.regex-flags input[type="checkbox"] {
  width: auto;
  margin: 0;
  cursor: pointer;
}

/* ツールチップスタイル */
[title] {
  position: relative;
  cursor: help;
}

[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  animation: tooltipFadeIn 0.3s ease forwards;
}

[title]:hover::before {
  content: '';
  position: absolute;
  bottom: 115%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  animation: tooltipFadeIn 0.3s ease forwards;
}

@keyframes tooltipFadeIn {
  to {
    opacity: 1;
  }
}

/* ボタングループ */
.button-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.primary-btn, .secondary-btn, .info-btn {
  padding: 12px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.primary-btn {
  background: linear-gradient(135deg, #007bff, #0056b3);
  color: white;
}

.primary-btn:hover {
  background: linear-gradient(135deg, #0056b3, #007bff);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,123,255,0.3);
}

.secondary-btn {
  background: #6c757d;
  color: white;
}

.secondary-btn:hover {
  background: #5a6268;
  transform: translateY(-2px);
}

.info-btn {
  background: linear-gradient(135deg, #17a2b8, #138496);
  color: white;
}

.info-btn:hover {
  background: linear-gradient(135deg, #138496, #17a2b8);
  transform: translateY(-2px);
}

/* 結果表示 */
.results-display, .matches-display {
  background: white;
  border: 2px solid #dee2e6;
  border-radius: 6px;
  padding: 15px;
  min-height: 100px;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  margin-bottom: 20px;
}

.success-result {
  background: linear-gradient(135deg, #d4edda, #c3e6cb);
  border: 2px solid #28a745;
  padding: 15px;
  border-radius: 6px;
  color: #155724;
}

.error-result {
  background: linear-gradient(135deg, #f8d7da, #f5c6cb);
  border: 2px solid #dc3545;
  padding: 15px;
  border-radius: 6px;
  color: #721c24;
}

.matches-list {
  margin-top: 15px;
}

.match-item {
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 10px;
  margin-bottom: 10px;
}

.match-text {
  background: #fff3cd;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: bold;
}

.match-position {
  color: #6c757d;
  font-size: 12px;
  margin-left: 10px;
}

.no-matches {
  color: #6c757d;
  font-style: italic;
  text-align: center;
  padding: 20px;
}

/* JSON/XML整形ツール */
.formatter-container {
  max-width: 1200px;
}

.format-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.format-tab {
  padding: 8px 16px;
  border: 2px solid #dee2e6;
  background: white;
  color: #6c757d;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.format-tab.active {
  background: #007bff;
  color: white;
  border-color: #007bff;
}

.formatter-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 30px;
}

.input-section, .output-section {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
}

.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 6px 12px;
  background: #28a745;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.copy-btn:hover {
  background: #218838;
}

.output-section {
  position: relative;
}

/* 検証結果 */
.validation-display {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
  margin-top: 20px;
}

.validation-display h3 {
  margin-top: 0;
  color: #495057;
}

.validation-message {
  padding: 15px;
  border-radius: 6px;
  font-size: 14px;
}

.validation-message.success {
  background: linear-gradient(135deg, #d4edda, #c3e6cb);
  border: 2px solid #28a745;
  color: #155724;
}

.validation-message.error {
  background: linear-gradient(135deg, #f8d7da, #f5c6cb);
  border: 2px solid #dc3545;
  color: #721c24;
}

.validation-message.warning {
  background: linear-gradient(135deg, #fff3cd, #ffeaa7);
  border: 2px solid #ffc107;
  color: #856404;
}

.validation-message.info {
  background: linear-gradient(135deg, #d1ecf1, #bee5eb);
  border: 2px solid #17a2b8;
  color: #0c5460;
}

/* サンプルデータセクション */
.samples-section {
  background: linear-gradient(135deg, #e9ecef, #f8f9fa);
  border-radius: 8px;
  padding: 20px;
  margin-top: 30px;
  text-align: center;
}

.samples-section h3 {
  margin-top: 0;
  color: #495057;
}

.sample-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.sample-btn {
  padding: 10px 16px;
  background: white;
  border: 2px solid #dee2e6;
  border-radius: 6px;
  color: #495057;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.sample-btn:hover {
  background: #007bff;
  color: white;
  border-color: #007bff;
  transform: translateY(-2px);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .regex-container,
  .formatter-content {
    grid-template-columns: 1fr;
  }
  
  .main-header {
    flex-direction: column;
    align-items: stretch;
  }
  
  .tool-tabs {
    flex-direction: column;
  }
  
  .button-group,
  .sample-buttons {
    flex-direction: column;
  }
  
  .format-tabs {
    justify-content: center;
  }
}