@charset "utf-8";

/* =========================================
   チャンネル一覧用スタイル
   ========================================= */
.channel-card {
  background-color: var(--bg-card);
  border: 2px solid var(--color-border);
  border-radius: 12px;
  transition: transform 0.2s, border-color 0.2s;
  position: relative;
  isolation: isolate;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: visible;
}

.channel-card:hover {
  transform: translateY(-5px);
  border-color: var(--color-border-hover);
}

.channel-card a {
  text-decoration: none;
  color: inherit;
  display: flex;
  height: 100%;
  box-sizing: border-box;
}

.title-text {
  font-size: 13.5px;
  font-weight: bold;
  margin: 0 0 4px 0;
  width: 100%;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-all;
  line-height: 1.3;
  height: 2.6em;
}

.last-date,
.info-row {
  font-size: 11.5px;
  color: #bbb;
  width: 100%;
}

.channel-card .fav-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #252525;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  padding: 0;
}

/* =========================================
   Grid View (カード表示 - 8列基準) Base: 1400px以上
   ========================================= */
#displayArea:not(.list-view) ul {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
  list-style: none;
  padding: 15px 0 !important;
}

#displayArea:not(.list-view) .channel-card a {
  flex-direction: column;
  align-items: center;
  padding: 8px 6px;
}

#displayArea:not(.list-view) .avatar-container {
  width: 72px;
  height: 72px;
  margin-top: 4px;
  margin-bottom: 8px;
}

#displayArea:not(.list-view) .title-text {
  text-align: center;
}

#displayArea:not(.list-view) .live-current-title {
  font-size: 11.5px;
  color: #bbb;
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-all;
  line-height: 1.4;
  height: 2.8em;
  margin-bottom: 3px;
}

#displayArea:not(.list-view) .viewer-count,
#displayArea:not(.list-view) .member-only-text,
#displayArea:not(.list-view) .last-date,
#displayArea:not(.list-view) .info-row {
  text-align: center;
}

/* =========================================
   List View (リスト表示 - 4列基準)
   ========================================= */
.list-view ul {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  list-style: none;
  padding: 10px 0 !important;
}

.list-view .channel-card a {
  flex-direction: row;
  align-items: center;
  padding: 7px 10px;
}

.list-view .avatar-container {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  margin: 0 10px 0 0;
}

.list-view .info-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  flex-grow: 1;
  padding-right: 28px;
}

.list-view .title-text,
.list-view .live-current-title,
.list-view .viewer-count,
.list-view .member-only-text,
.list-view .last-date,
.list-view .info-row {
  text-align: left !important;
}

.list-view .title-text {
  height: auto;
  max-height: 2.6em;
  margin-bottom: 2px;
}

.list-view .live-current-title {
  font-size: 11.5px;
  color: #aaa;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-all;
  line-height: 1.4;
  height: 2.8em;
  white-space: normal !important;
  margin-bottom: 2px;
}

/* =========================================
   共有バナー用スタイル
   ========================================= */
#shared-list-banner {
  display: none;
  background-color: rgba(255, 64, 129, 0.05);
  border: 1px solid rgba(255, 64, 129, 0.3);
  border-radius: 8px;
  padding: 10px 24px;
  width: fit-content;
  margin: 0 auto 24px;
}

#shared-list-banner .banner-content {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
}

#shared-list-banner .banner-text {
  font-size: 0.95em;
  color: #e0e0e0;
}

#shared-list-banner .banner-buttons {
  display: flex;
}

#clear-shared-list-btn {
  background-color: transparent;
  border: 1px solid #555;
  color: #ccc;
  padding: 6px 14px;
  font-size: 0.9em;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

#clear-shared-list-btn:hover {
  background-color: #333;
  color: #fff;
  border-color: #888;
}

@media (min-width: 768px) {
  #shared-list-banner .banner-content {
    flex-direction: row;
    justify-content: space-between;
    padding: 8px 16px;
  }

  #shared-list-banner {
    border-radius: 50px;
  }
}


/* ==========================================================
   レスポンシブ設定 (Responsive Design)
   ========================================================== */
/* WQHD (2400px以上): カード10列・リスト5列表示 */
@media (min-width: 2400px) {
  #displayArea:not(.list-view) ul {
    grid-template-columns: repeat(10, 1fr);
    gap: 8px;
  }

  .list-view ul {
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
  }
}

@media (max-width: 1200px) {
  #displayArea:not(.list-view) ul {
    grid-template-columns: repeat(6, 1fr);
  }

  .list-view ul {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 1000px) {
  #displayArea:not(.list-view) ul {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 768px) {
  #displayArea:not(.list-view) ul {
    grid-template-columns: repeat(3, 1fr);
  }

  .list-view ul {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 580px) {
  #displayArea:not(.list-view) ul {
    grid-template-columns: repeat(2, 1fr);
  }

  .list-view ul {
    grid-template-columns: 1fr;
  }

  #displayArea:not(.list-view) .avatar-container {
    width: 65px;
    height: 65px;
  }
}

@media (max-width: 450px) {
  #displayArea:not(.list-view) ul {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 10px 0 !important;
  }

  #displayArea:not(.list-view) .channel-card a {
    padding: 8px;
  }

  #displayArea:not(.list-view) .avatar-container {
    width: 65px;
    height: 65px;
    margin-bottom: 8px;
  }

  #displayArea:not(.list-view) .title-text {
    font-size: 13px;
    margin-bottom: 4px;
    height: 2.8em;
  }

  #displayArea:not(.list-view) .live-current-title {
    font-size: 11px;
    line-height: 1.3;
  }

  #displayArea:not(.list-view) .info-row,
  #displayArea:not(.list-view) .last-date {
    font-size: 11px;
  }

  .list-view .channel-card a {
    padding: 8px 10px;
  }

  .list-view .avatar-container {
    width: 42px;
    height: 42px;
    margin-right: 10px;
  }

  .list-view .title-text {
    font-size: 12.5px;
  }
}
.agency-filter-row {
  margin-top: 0;
  display: flex;
  flex-wrap: wrap !important;
  gap: 8px;
  white-space: normal !important;
  width: auto !important;
  flex: 1;
  min-width: 0;
}
.agency-filter-row::-webkit-scrollbar {
  display: none;
}

.agency-filter-row {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.agency-tag {
  background-color: rgba(255, 255, 255, 0.04) !important;
  color: #aaa !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 8px !important;
  height: 30px !important;
  padding: 0 14px !important;
  cursor: pointer;
  font-size: 0.8rem !important;
  font-weight: 500;
  transition: all 0.2s ease;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  flex-shrink: 0;
}

.agency-tag:hover {
  background-color: rgba(255, 255, 255, 0.08) !important;
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
}

.agency-tag.active {
  background: rgba(139, 92, 246, 0.15) !important;
  color: #d8b4fe !important;
  border-color: rgba(168, 85, 247, 0.4) !important;
  font-weight: bold;
}

/* =========================================
   ソートタグ & 登録者数表示スタイル
   ========================================= */
.sort-filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sort-tag {
  background-color: rgba(255, 255, 255, 0.05);
  color: #ccc;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  height: 30px;
  padding: 0 14px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.sort-tag:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.sort-tag.active {
  background-color: #3b82f6 !important;
  color: #ffffff !important;
  border-color: #3b82f6 !important;
  font-weight: bold;
}

/* デフォルト (sort-live): LIVE中チャンネルはタイトル・同接数 (.live-status) を表示し、.last-date を非表示 */
.channel-card.is-live-card .last-date,
.channel-card.is-member-card .last-date {
  display: none;
}

.channel-card.is-live-card .live-status,
.channel-card.is-member-card .live-status {
  display: block;
}

.sub-count-display {
  font-size: 13px;
  color: #a7f3d0;
  font-weight: bold;
  margin-top: 4px;
  display: none;
}

#displayArea:not(.list-view) .sub-count-display {
  text-align: center;
}

.list-view .sub-count-display {
  text-align: left;
}

/* 次回配信日ソート選択時 (#displayArea.sort-next) */
/* LIVEバッジは表示のまま、配信中タイトル・同接数 (.live-status) を非表示にし、次回・最終配信日時 (.last-date) を表示 */
#displayArea.sort-next .live-status {
  display: none !important;
}

#displayArea.sort-next .last-date {
  display: block !important;
}

/* 登録者数ソート選択時 (#displayArea.sort-subscribers) */
/* LIVEバッジは表示のまま、配信情報 (.channel-stream-info) を非表示にし、登録者数 (.sub-count-display) を表示 */
#displayArea.sort-subscribers .channel-stream-info {
  display: none !important;
}

#displayArea.sort-subscribers .sub-count-display {
  display: block !important;
}