/* Base */
:root {
  --bg: #0f0f0f; /* YouTube dark */
  --card: #212121;
  --soft: #2a2a2a;
  --text: #ffffff;
  --muted: #aaaaaa;
  --primary: #ff0000; /* YouTube red */
  --primary-hover: #e00000;
  --success: #22c55e;
  --error: #ef4444;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: radial-gradient(1200px 600px at 10% 10%, #0b1020, var(--bg));
  color: var(--text);
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header */
/* Topbar estilo YouTube */
.topbar { position: sticky; top: 0; z-index: 50; background: var(--card); border-bottom: 1px solid #333; }
.topbar-inner { display: grid; grid-template-columns: 180px 1fr 140px; align-items: center; gap: 1rem; padding: .5rem 0; }
.brand { display: inline-flex; align-items: center; gap: .5rem; font-weight: 700; }
.brand-icon { color: var(--primary); }
.brand-text { color: var(--text); }
.search { display: flex; }
.search input { width: 100%; padding: .5rem .75rem; border-radius: 999px; border: 1px solid #444; background: #121212; color: var(--text); }
.search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(255,0,0,.12); }
.actions { display: flex; justify-content: end; }

/* Cards */
.card {
  background: linear-gradient(180deg, var(--card), var(--soft));
  border: 1px solid #333;
  border-radius: 14px;
  padding: 1rem;
  margin: 1rem 0;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}
.card h2 { margin-top: 0; }

/* Upload form */
.form-row { margin: .75rem 0; }
input[type="file"] {
  width: 100%;
  padding: .75rem;
  border-radius: 10px;
  border: 1px dashed #374151;
  background: #0b1224;
  color: var(--text);
}
.hint { color: var(--muted); font-size: .9rem; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem 1rem;
  border-radius: 10px;
  border: 1px solid #233251;
  background: #0b1224;
  color: var(--text);
  cursor: pointer;
  transition: all .2s ease;
}
.btn:hover { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(255,0,0,.15); }
.btn.primary { background: var(--primary); color: #fff; border-color: var(--primary-hover); }
.btn.primary:hover { background: var(--primary-hover); }

/* Progress */
.progress-wrapper { display: flex; align-items: center; gap: .5rem; margin-top: .5rem; }
progress { width: 200px; height: 16px; }

.message { margin-top: .5rem; }
.message.success { color: var(--success); }
.message.error { color: var(--error); }

/* Player */
.player-section .player { width: 100%; max-height: 60vh; border-radius: 12px; background: #000; }

/* Gallery */
.video-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 180px)); gap: .4rem; }
.video-item { background: #121212; border: 1px solid #333; border-radius: 8px; padding: .35rem; display: flex; flex-direction: column; gap: .3rem; cursor: pointer; transition: border-color .2s ease, box-shadow .2s ease, transform .06s ease; }
.video-item:hover { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(96,165,250,.12); }
.video-item:active { transform: scale(0.99); }
.video-item.active { border-color: var(--primary-hover); box-shadow: 0 0 0 3px rgba(255,0,0,.18); }
.thumb { width: 100%; aspect-ratio: 16 / 9; border-radius: 5px; position: relative; background: linear-gradient(180deg, #0d0d0d, #1a1a1a); overflow: hidden; }
.play-overlay { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 1.1rem; background: rgba(0,0,0,0.15); opacity: 0; transition: opacity .2s ease; }
.video-item:hover .play-overlay { opacity: 1; }
.video-meta { display: flex; flex-direction: column; gap: .25rem; }
.video-name { color: var(--text); font-size: .85rem; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.video-date { color: var(--muted); font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* .video-actions removido: card inteiro é clicável */

/* Footer */
.footer { padding: 2rem 0; color: var(--muted); }

/* Responsive tweaks */
@media (max-width: 640px) {
  .header h1 { font-size: 1.6rem; }
}