* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: sans-serif;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #f9f9f9;
}

/* 上部30%: 検索エリア */
.search-section {
  height: 30vh;
  padding: 15px;
  background-color: #fff;
  border-bottom: 1px solid #ddd;
  overflow-y: auto;
}

.search-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 600px;
  margin: 0 auto;
}

.search-box {
  display: flex;
  gap: 8px;
}

.search-box input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.search-box button {
  padding: 8px 16px;
  background-color: #ff0000;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

/* 検索候補 */
.search-results {
  max-width: 600px;
  margin: 10px auto 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px;
  background: #f0f0f0;
  border-radius: 4px;
}

.search-item-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.view-btn {
  padding: 6px 12px;
  background-color: #065fd4;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

/* 下部70%: 詳細表示エリア */
.detail-section {
  height: 70vh;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.hidden {
  display: none !important;
}

.channel-basic {
  display: flex;
  align-items: center;
  gap: 15px;
}

.channel-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
}

.channel-detail {
  color: #555;
  font-size: 0.95rem;
}

/* タブ＆フィルター設定 */
.top-videos-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tab-container {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid #ddd;
  padding-bottom: 8px;
  overflow-x: auto;
}

.tab-btn {
  padding: 6px 12px;
  background: #e0e0e0;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  font-weight: bold;
}

.tab-btn.active {
  background: #ff0000;
  color: white;
}

.filter-controls {
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 0.9rem;
  background: #fff;
  padding: 8px 12px;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.filter-controls select {
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid #ccc;
}

/* 動画カード */
.top-videos-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.video-card {
  display: flex;
  gap: 12px;
  background: white;
  padding: 10px;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.video-thumb {
  width: 120px;
  object-fit: cover;
  border-radius: 4px;
}

.video-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.video-title {
  color: #0f0f0f;
  text-decoration: none;
  font-weight: bold;
}

.video-date {
  color: #666;
  font-size: 0.85rem;
}

/* 再生選択モーダル */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background-color: #fff;
  padding: 20px;
  border-radius: 8px;
  max-width: 500px;
  width: 90%;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 24px;
  cursor: pointer;
  color: #666;
}

.player-container {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 アスペクト比 */
}

.player-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 4px;
}

.modal-action-btns {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.action-btn {
  padding: 8px 16px;
  border: 1px solid #ccc;
  background-color: #f0f0f0;
  border-radius: 4px;
  cursor: pointer;
}

.action-btn.primary {
  background-color: #ff0000;
  color: white;
  border: none;
}

/* エラー案内テキストのスタイリング */
#errorreason {
  margin-top: 10px;
  padding: 8px 12px;
  font-size: 0.85rem;
  color: #856404;
  background-color: #fff3cd;
  border: 1px solid #ffeeba;
  border-radius: 4px;
  line-height: 1.4;text-align: center;
}