/**
 * 漫画プロンプトメーカー v5.7 MANGA LAYOUT MASTER
 * スタイルシート v3 - タブベースUI
 */

/* ========================================
   1. コマ割り設定スタイル
   ======================================== */

.panel-division-settings {
  animation: slideInFromLeft 0.5s ease-out;
}

.setting-group {
  margin-bottom: 15px;
}

.enhanced-select {
  transition: all 0.3s ease;
  font-size: 14px;
}

.enhanced-select:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.enhanced-select:focus {
  outline: 3px solid #ffd700;
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.3);
}

/* ========================================
   2. 画像サイズ設定スタイル
   ======================================== */

.image-size-settings {
  animation: slideInFromRight 0.5s ease-out;
}

.size-grid {
  gap: 12px;
}

.size-option {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
}

.size-option:hover {
  border-color: #667eea;
  background: #f8f9ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.size-option input[type="radio"] {
  margin-right: 10px;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.size-option.recommended {
  border-color: #ffd700;
  background: linear-gradient(135deg, #fff9e6 0%, #fffef0 100%);
  position: relative;
}

.size-option.recommended::after {
  content: '⭐';
  position: absolute;
  top: -8px;
  right: -8px;
  font-size: 24px;
  animation: pulse 2s ease-in-out infinite;
}

.size-option input[type="radio"]:checked + span {
  font-weight: bold;
  color: #667eea;
}

/* ========================================
   3. タブベースのカット編集UI
   ======================================== */

.tab-based-cut-editor {
  margin-top: 30px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 12px;
}

.page-container {
  margin-bottom: 40px;
  padding: 25px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  animation: fadeInUp 0.5s ease-out;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 3px solid #667eea;
}

.page-header h3 {
  font-size: 24px;
  color: #333;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.btn-generate-page:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 6px 25px rgba(102, 126, 234, 0.6);
}

.btn-generate-page:active {
  transform: translateY(-1px);
}

/* ========================================
   4. タブナビゲーション
   ======================================== */

.cut-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 2px solid #e0e0e0;
  padding-bottom: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.cut-tabs::-webkit-scrollbar {
  height: 6px;
}

.cut-tabs::-webkit-scrollbar-thumb {
  background: #667eea;
  border-radius: 3px;
}

.tab-button {
  padding: 12px 24px;
  background: #f0f0f0;
  border: none;
  border-bottom: 3px solid transparent;
  border-radius: 8px 8px 0 0;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #666;
  white-space: nowrap;
}

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

.tab-button.active {
  background: white;
  border-bottom-color: #667eea;
  color: #667eea;
  box-shadow: 0 -2px 10px rgba(102, 126, 234, 0.2);
}

/* ========================================
   5. タブコンテンツエリア
   ======================================== */

.tab-content-area {
  position: relative;
  min-height: 400px;
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s ease-out;
}

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

.cut-details {
  padding: 20px;
  background: #fafafa;
  border-radius: 8px;
}

.detail-section {
  margin-bottom: 20px;
}

.detail-section label {
  display: block;
  font-size: 15px;
  font-weight: bold;
  color: #333;
  margin-bottom: 8px;
}

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

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

/* ========================================
   6. カットアクションボタン
   ======================================== */

.cut-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.btn-generate-single-cut {
  padding: 10px 20px;
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(17, 153, 142, 0.3);
}

.btn-generate-single-cut:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(17, 153, 142, 0.5);
}

.btn-generate-with-reference {
  padding: 10px 20px;
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(240, 147, 251, 0.3);
}

.btn-generate-with-reference:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(240, 147, 251, 0.5);
}

/* ========================================
   7. 画像プレビューエリア
   ======================================== */

.image-preview {
  margin-top: 20px;
  padding: 15px;
  background: white;
  border: 2px dashed #e0e0e0;
  border-radius: 8px;
  text-align: center;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.image-preview img {
  max-width: 100%;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  transition: transform 0.3s ease;
}

.image-preview img:hover {
  transform: scale(1.02);
}

.image-preview button {
  margin-top: 12px;
  padding: 8px 16px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.3s ease;
}

.image-preview button:hover {
  background: #5568d3;
  transform: translateY(-2px);
}

.page-image-result {
  margin-top: 20px;
  padding: 20px;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  border-radius: 12px;
  text-align: center;
  animation: fadeIn 0.5s ease-out;
}

.page-image-result img {
  max-width: 100%;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
  margin-bottom: 15px;
}

.page-image-result button {
  padding: 10px 24px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.page-image-result button:hover {
  background: #5568d3;
  transform: translateY(-2px);
}

/* ========================================
   8. アニメーション
   ======================================== */

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

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

@keyframes slideInFromLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

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

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

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

  .btn-generate-page {
    width: 100%;
  }

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

  .tab-button {
    font-size: 13px;
    padding: 10px 16px;
  }

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

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

  .size-grid {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   10. 無効化スタイル (参照画像厳密再現時)
   ======================================== */

select:disabled,
input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #f5f5f5;
}

select:disabled:hover,
input:disabled:hover {
  transform: none;
  box-shadow: none;
}
