/* ============================================================
   Metro Swim Shop — Video Gallery Dark Mode Stylesheet
   ============================================================ */

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #0f0f0f;
  --bg-card:      #212121;
  --bg-hover:     #272727;
  --bg-input:     #121212;
  --bg-modal:     #0f0f0f;
  --border:       #3f3f3f;
  --border-light: #272727;
  --text:         #f1f1f1;
  --text-muted:   #aaaaaa;
  --text-dim:     #717171;
  --red:          #ff0000;
  --red-hover:    #cc0000;
  --radius-sm:    4px;
  --radius:       8px;
  --radius-lg:    12px;
  --radius-xl:    16px;
  --radius-full:  9999px;
  --shadow:       0 4px 24px rgba(0,0,0,0.6);
  --transition:   0.18s ease;
}

html { color-scheme: dark; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Roboto", "Arial", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font-family: inherit; font-size: inherit; color: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: #555; }

/* ── Top Navigation Bar ───────────────────────────────────── */
.topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 56px;
  padding: 0 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border-light);
}

.topnav__logo {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  text-decoration: none;
}

.topnav__logo-icon {
  width: 32px;
  height: 32px;
  background: var(--red);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  flex-shrink: 0;
}

.topnav__logo-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.topnav__search {
  flex: 1;
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--bg-input);
  transition: border-color var(--transition);
  overflow: hidden;
}

.topnav__search:focus-within { border-color: #1c62b9; }

.topnav__search input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 8px 16px;
  color: var(--text);
  font-size: 14px;
}

.topnav__search input::placeholder { color: var(--text-dim); }

.topnav__search-btn {
  padding: 8px 16px;
  background: var(--bg-hover);
  border-left: 1px solid var(--border);
  color: var(--text-muted);
  transition: color var(--transition);
}

.topnav__search-btn:hover { color: var(--text); }

/* ── Channel Header ───────────────────────────────────────── */
.channel-banner {
  width: 100%;
  height: 140px;
  background: linear-gradient(135deg, #001a33 0%, #003366 50%, #001a33 100%);
  overflow: hidden;
}

.channel-banner img { width: 100%; height: 100%; object-fit: cover; }

.channel-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 24px;
}

@media (min-width: 640px) {
  .channel-info { flex-direction: row; align-items: flex-end; }
}

.channel-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #003366;
  border: 4px solid var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  flex-shrink: 0;
  overflow: hidden;
}

.channel-avatar img { width: 100%; height: 100%; object-fit: cover; }

.channel-meta { flex: 1; }

.channel-name {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

@media (min-width: 640px) { .channel-name { font-size: 28px; } }

.channel-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.channel-sub span + span::before { content: "•"; margin-right: 6px; }

.btn-subscribe {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--text);
  color: var(--bg);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  transition: background var(--transition);
  text-decoration: none;
}

.btn-subscribe:hover { background: #ccc; }

/* ── Tabs ─────────────────────────────────────────────────── */
.tabs {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 24px;
  border-bottom: 1px solid var(--border-light);
  overflow-x: auto;
}

.tab-btn {
  position: relative;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  transition: color var(--transition);
  background: none;
  border: none;
}

.tab-btn:hover { color: var(--text); }

.tab-btn.active {
  color: var(--text);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--text);
  border-radius: 2px 2px 0 0;
}

.tabs__search {
  margin-left: auto;
  padding: 8px;
  color: var(--text-muted);
  transition: color var(--transition);
}

.tabs__search:hover { color: var(--text); }

/* ── Filter Chips ─────────────────────────────────────────── */
.filters {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  overflow-x: auto;
}

.filter-chip {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  background: var(--bg-hover);
  color: var(--text);
  transition: background var(--transition);
  border: none;
}

.filter-chip:hover { background: #3f3f3f; }

.filter-chip.active {
  background: var(--text);
  color: var(--bg);
}

/* ── Video Grid ───────────────────────────────────────────── */
.video-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px 16px;
  padding: 16px 24px 48px;
}

/* Standard videos: 3 columns landscape */
@media (min-width: 640px)  { .video-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .video-grid { grid-template-columns: repeat(3, 1fr); } }

/* Shorts grid: narrower portrait columns — more per row */
.video-grid--shorts {
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 640px)  { .video-grid--shorts { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px)  { .video-grid--shorts { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1200px) { .video-grid--shorts { grid-template-columns: repeat(5, 1fr); } }

/* ── Video Card ───────────────────────────────────────────── */
.video-card {
  cursor: pointer;
  border-radius: 0;
}

/* Default thumbnail: 16:9 landscape for Videos and Posts */
.video-card__thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
}

/* Shorts thumbnail: 9:16 portrait */
.video-card--short .video-card__thumb {
  aspect-ratio: 9/16 !important;
  border-radius: var(--radius-xl);
  max-width: 240px;
  margin: 0 auto;
}

/* Shorts: hide avatar row, center title below thumb */
.video-card--short .video-card__meta {
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}

.video-card--short .video-card__avatar {
  display: none;
}

.video-card--short .video-card__title {
  font-size: 13px;
  -webkit-line-clamp: 2;
}

.video-card--short .video-card__stats {
  font-size: 11px;
}

.video-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.video-card:hover .video-card__thumb img { transform: scale(1.03); }

.video-card__play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.video-card:hover .video-card__play-overlay { background: rgba(0,0,0,0.2); }

.video-card__play-btn {
  opacity: 0;
  background: rgba(0,0,0,0.7);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease;
}

.video-card:hover .video-card__play-btn { opacity: 1; }

.video-card__duration {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0,0,0,0.85);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: var(--radius-sm);
}

.video-card__meta {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.video-card__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-card);
  flex-shrink: 0;
  overflow: hidden;
  margin-top: 2px;
}

.video-card__avatar img { width: 100%; height: 100%; object-fit: cover; }

.video-card__info { flex: 1; min-width: 0; }

.video-card__title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}

.video-card__channel {
  font-size: 12px;
  color: var(--text-muted);
  transition: color var(--transition);
}

.video-card__channel:hover { color: var(--text); }

.video-card__stats {
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Empty State ──────────────────────────────────────────── */
.empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  text-align: center;
}

.empty-state__icon { font-size: 56px; margin-bottom: 16px; }
.empty-state__title { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.empty-state__text  { font-size: 13px; color: var(--text-muted); }

/* ── Skeleton Loading ─────────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-hover) 50%, var(--bg-card) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* ── Modal ────────────────────────────────────────────────── */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.88);
  backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop.open { display: flex; }

.modal {
  position: relative;
  width: 100%;
  max-width: 900px;
  background: #111;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow);
  animation: modalIn 0.2s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

.modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  width: 32px;
  height: 32px;
  background: rgba(0,0,0,0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: background var(--transition);
}

.modal__close:hover { background: rgba(0,0,0,0.9); }

.modal__video {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
}

.modal__video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.modal__info { padding: 14px 16px; }

.modal__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.4;
}

.modal__stats {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.modal__desc {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Utilities ────────────────────────────────────────────── */
.container { max-width: 1280px; margin: 0 auto; }
.sr-only   { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
