:root {
  --bg-color: #0d1117;
  --card-bg: #161b22;
  --border-color: #30363d;
  --text-color: #c9d1d9;
  --accent-color: #58a6ff;
  --success-color: #2ea44f;
  --error-color: #f85149;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  display: flex;
  justify-content: center;
  padding: 20px;
}

.container {
  max-width: 1000px;
  width: 100%;
}

header {
  text-align: center;
  margin-bottom: 30px;
}

h1 {
  color: #fff;
  margin-bottom: 5px;
}

.subtitle {
  color: #8b949e;
}

/* アップローダー */
.upload-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.video-uploader {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 15px;
  display: flex;
  flex-direction: column;
}

.video-uploader label {
  font-weight: bold;
  margin-bottom: 10px;
  color: var(--accent-color);
}

.drop-zone {
  border: 2px dashed var(--border-color);
  border-radius: 6px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s;
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 150px;
}

.drop-zone:hover {
  border-color: var(--accent-color);
}

.drop-text {
  color: #8b949e;
  font-size: 14px;
}

video {
  width: 100%;
  max-height: 200px;
  border-radius: 4px;
  background-color: #000;
}

/* 設定 */
.settings-section {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 30px;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.setting-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.setting-group input {
  background-color: var(--bg-color);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 8px;
  border-radius: 4px;
  width: 150px;
}

/* ボタン・ステータス */
.action-section {
  text-align: center;
  margin-bottom: 30px;
}

button, .btn-success {
  background-color: var(--accent-color);
  color: #fff;
  border: none;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: bold;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: opacity 0.2s;
}

button:disabled {
  background-color: var(--border-color);
  color: #8b949e;
  cursor: not-allowed;
}

button:hover:not(:disabled), .btn-success:hover {
  opacity: 0.9;
}

.btn-success {
  background-color: var(--success-color);
  margin-top: 15px;
}

#status-container {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.spinner {
  width: 30px;
  height: 30px;
  border: 3px solid var(--border-color);
  border-top: 3px solid var(--accent-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.progress-bar-container {
  width: 100%;
  max-width: 400px;
  height: 8px;
  background-color: var(--border-color);
  border-radius: 4px;
  overflow: hidden;
}

#progress-bar {
  height: 100%;
  background-color: var(--accent-color);
  transition: width 0.1s;
}

#result-section {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
}

#result-section video {
  max-width: 400px;
  width: 100%;
  max-height: 500px;
}

.hidden {
  display: none !important;
}
/* デバッグログ用パネル */
.debug-panel {
  margin-top: 30px;
  background-color: #1a1f2c;
  border: 1px solid #2d3748;
  border-radius: 8px;
  padding: 15px;
  text-align: left;
}

.debug-panel summary {
  color: #a0aec0;
  cursor: pointer;
  font-weight: bold;
  outline: none;
  user-select: none;
}

.debug-panel textarea {
  width: 100%;
  height: 200px;
  margin-top: 10px;
  background-color: #0f1219;
  color: #48bb78; /* 緑色のコンソール風テキスト */
  border: 1px solid #2d3748;
  border-radius: 4px;
  padding: 10px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 12px;
  resize: vertical;
}
