/**
 * 漫画プロンプトメーカー v5.7.5
 * スタイル拡張 v3 - 修正版
 * ステータス表示とページタブのスタイル追加
 */

/* ========================================
   ページヘッダー: ステータス表示
   ======================================== */

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 15px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  color: white;
}

.page-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: bold;
}

/* ステータスバッジ */
.page-status {
  display: flex;
  align-items: center;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: bold;
  transition: all 0.3s ease;
}

/* 未生成 */
.status-idle {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.5);
}

/* 生成中 */
.status-generating {
  background: #9b59b6;
  color: white;
  border: 2px solid #8e44ad;
  animation: pulse-status 1.5s infinite;
}

@keyframes pulse-status {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

/* 生成成功 */
.status-success {
  background: #2ecc71;
  color: white;
  border: 2px solid #27ae60;
  animation: success-bounce 0.6s ease;
}

@keyframes success-bounce {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* 生成失敗 */
.status-error {
  background: #e74c3c;
  color: white;
  border: 2px solid #c0392b;
  animation: shake 0.5s ease;
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

/* ========================================
   タブナビゲーション: ページタブの強調
   ======================================== */

.cut-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.tab-button {
  padding: 12px 20px;
  background: #f5f5f5;
  border: 2px solid #ddd;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  white-space: nowrap;
  color: #555;
}

.tab-button:hover {
  background: #e8e8e8;
  border-color: #999;
  transform: translateY(-2px);
}

.tab-button.active {
  background: white;
  border-color: #667eea;
  border-bottom: 2px solid white;
  color: #667eea;
  font-weight: bold;
  position: relative;
  z-index: 1;
}

/* ページタブ (一番左) の特別なスタイル */
.tab-button.tab-page-overview {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: #667eea;
  font-weight: bold;
  padding: 12px 24px;
}

.tab-button.tab-page-overview:hover {
  background: linear-gradient(135deg, #5568d3 0%, #653a8b 100%);
  transform: translateY(-2px);
}

.tab-button.tab-page-overview.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: 2px solid #ffd700;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* ========================================
   ページ統合タブコンテンツ
   ======================================== */

.page-overview-content {
  background: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.page-overview-content h4 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 20px;
  color: #333;
}

.page-overview-content > p {
  color: #666;
  margin-bottom: 20px;
}

/* カット一覧サマリー */
.cuts-summary {
  background: #f9f9f9;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  border-left: 4px solid #667eea;
}

.cut-summary-item {
  padding: 10px 0;
  border-bottom: 1px solid #e0e0e0;
}

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

.cut-summary-item strong {
  display: inline-block;
  min-width: 100px;
  color: #667eea;
  font-weight: bold;
}

.cut-summary-item span {
  color: #555;
  font-size: 14px;
}

/* ページ生成アクション */
.page-generation-actions {
  text-align: center;
  margin: 30px 0;
}

.btn-generate-whole-page {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 16px 40px;
  border-radius: 30px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-generate-whole-page:hover {
  background: linear-gradient(135deg, #5568d3 0%, #653a8b 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-generate-whole-page:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

/* ページ画像プレビュー */
.page-image-preview {
  margin-top: 30px;
  padding: 20px;
  background: #f5f5f5;
  border-radius: 12px;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-placeholder {
  text-align: center;
  color: #999;
  padding: 40px;
}

.preview-placeholder p {
  font-size: 16px;
  margin: 0;
}

.page-image-preview img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* プレビューアクション */
.preview-actions {
  text-align: center;
  margin-top: 15px;
}

.btn-download {
  background: #3498db;
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-download:hover {
  background: #2980b9;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(52, 152, 219, 0.3);
}

/* ========================================
   個別カットタブコンテンツ
   ======================================== */

.tab-content {
  display: none;
  background: white;
  padding: 25px;
  border-radius: 0 12px 12px 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

/* カット詳細セクション */
.cut-details {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.detail-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-section label {
  font-weight: bold;
  color: #333;
  font-size: 14px;
}

.detail-section textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.3s ease;
}

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

/* カットアクション */
.cut-actions {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}

.btn-generate-single-cut {
  background: #667eea;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-generate-single-cut:hover {
  background: #5568d3;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-generate-with-reference {
  background: #9b59b6;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-generate-with-reference:hover {
  background: #8e44ad;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(155, 89, 182, 0.3);
}

/* 画像プレビュー (個別カット) */
.image-preview {
  margin-top: 20px;
  padding: 20px;
  background: #f9f9f9;
  border-radius: 8px;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-preview img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* ========================================
   レスポンシブ対応
   ======================================== */

@media (max-width: 768px) {
  .page-header {
    flex-direction: column;
    gap: 15px;
    align-items: flex-start;
  }

  .cut-tabs {
    flex-wrap: wrap;
  }

  .tab-button {
    flex: 1 1 auto;
    min-width: 100px;
  }

  .cut-actions {
    flex-direction: column;
  }

  .btn-generate-single-cut,
  .btn-generate-with-reference {
    width: 100%;
  }
}

/* ========================================
   ローディングアニメーション
   ======================================== */

.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ========================================
   トーストスタイル（既存のimage-gen.jsと統合）
   ======================================== */

#notification-area {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  max-width: 400px;
}

.toast {
  margin-bottom: 10px;
  animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}
