body {
  margin: 0;
  padding: 10px;
  font-family: Arial, sans-serif;
  background: #8e44ad;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-height: 97vh;
}

.body-container {
  width: 1400px;
  height: 100%;
  display: flex;
  gap: 10px;
  margin: 0 auto;
}

.left-panel {
  width: 600px;
  height: 720px;
  background: white;
  display: flex;
  flex-direction: column;
  row-gap: 10px;
  column-gap: 10px;
  border-radius: 8px;
  border: 2px solid #020086;
  box-shadow:
    0 0 10px rgba(111, 0, 255, 0.377),
    0;
  overflow: visible; /* 避免 select 下拉選單被裁切 */
}

/* 選擇資料夾 + 選擇影片 同一行不換行 */
.video-selection-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  margin: 8px 10px;
}
.video-selection-row label {
  flex-shrink: 0;
  font-weight: bold;
  color: #333;
}
.video-selection-row .file-input,
.video-selection-row .video-input {
  flex: 1;
  min-width: 180px; /* 確保資料夾名稱完整顯示 */
  max-width: 280px;
}

.file-input,
.video-input {
  margin-top: 5px;
  margin-left: 5px;
  margin-bottom: 5px;
  display: inline-block;
  width: auto;
  flex: 1;
  padding: 8px;
  border: 1px solid #8e44ad;
  border-radius: 4px;
  background-color: #8e44ad;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
  text-transform: uppercase;
  color: #fff;
  font-weight: bold;
}

#videoPlayer {
  display: block;
  width: 570px;
  height: 480px;
  margin-left: 15px;
  margin-right: 15px;
}

.right-panel {
  width: 790px;
  height: 720px;
  background: white;
  display: flex;
  flex-direction: column;
  row-gap: 10px;
  column-gap: 10px;
  border-radius: 8px;
  border: 2px solid #020086;
  box-shadow:
    0 0 10px rgba(111, 0, 255, 0.377),
    0 2px 4px rgba(0, 0, 0, 0.1);
  overflow-y: auto;
}

/* AI Analysis Panel Styles */
.analysis-panel {
  background: #f8f9fa;
  border: 2px solid #28a745;
  border-radius: 8px;
  padding: 15px;
  margin: 10px;
  box-shadow: 0 2px 8px rgba(40, 167, 69, 0.2);
}

.analysis-panel h2 {
  color: #28a745;
  margin: 0 0 15px 0;
  font-size: 18px;
  text-align: center;
}

.analysis-content {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.analysis-section {
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 12px;
}

.analysis-section h3 {
  color: #495057;
  margin: 0 0 10px 0;
  font-size: 14px;
  border-bottom: 1px solid #e9ecef;
  padding-bottom: 5px;
}

.analysis-item {
  margin: 8px 0;
  font-size: 13px;
  line-height: 1.4;
}

.suggestion-box {
  background: #e8f5e8;
  border-left: 4px solid #28a745;
  padding: 10px;
  border-radius: 4px;
  font-style: italic;
}

.analysis-point {
  margin: 4px 0;
  padding: 8px;
  background: #f8f9fa;
  border-left: 3px solid #6c757d;
  border-radius: 4px;
  line-height: 1.6;
}

.analysis-point strong {
  color: #495057;
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
}

#actionTypeValue {
  color: #007bff;
  font-weight: bold;
}

video {
  width: 99%;
  max-width: 800px;
  max-height: 600vh;
  background: black;
  margin: 0 auto 20px auto;
  border-radius: 4px;
  display: block;
}

.speed-control {
  display: flex;
  font-size: 20px;
  font-weight: bold;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 10px;
  padding: 10px;
  background: #8e44ad;
  color: #fff;
  border-radius: 4px;
}

#speedControl {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
}

#speedControl {
  -webkit-appearance: none;
  appearance: none;
  width: 300px;
  height: 10px;
  border-radius: 5px;
  background: linear-gradient(
    to right,
    #e1b8ff 0%,
    #c575ff var(--val, 50%),
    white var(--val, 50%),
    white 100%
  );
}

#speedControl::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #c575ff;
  cursor: pointer;
}

.chart-box {
  background: rgb(255, 255, 255);
  padding: 5px;
  border-radius: 8px;
  width: 95%;
  height: 35%;
  margin: 0 auto;
  aspect-ratio: 800 / 240;
  box-shadow:
    inset 0 0 0 10px white,
    0 2px 4px rgba(106, 6, 255, 0.1);
}

.trajectory-controls {
  background: white;
  padding: 10px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 5px;
}

h2 {
  color: #8d00e5;
  text-align: center;
  font-family: "Arial", sans-serif;
  font-size: 16px;
  font-weight: bold;
  text-transform: uppercase;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
  margin: 0 0 3px 0;
  padding: 10px 10px;
  border-bottom: 3px solid #8d00e5;
}

.filename {
  color: #00f7ff;
  font-size: 1em;
  margin-bottom: 10px;
  font-family: "Roboto", sans-serif;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: linear-gradient(135deg, #00f7ffde, #ff00f7);
  padding: 5px 10px;
  border-radius: 5px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.ai-feedback {
  background-color: #ecd6fc;
  margin-top: 5px;
  margin-left: 5px;
  margin-right: 5px;
  color: #8d00e5;
  font-size: 1.2em;
  font-weight: bold;
  padding: 10px 20px;
  border: 2px solid #8d00e5;
  border-radius: 8px;
  text-align: left;
  display: inline-block;
}
