/* =========================
   TubeIdol Modern UI
   ========================= */

:root {
  --bg: #252525;
  --fg: #e2e2e2;
  --accent: #cf6e0c;
  --card: #2f2f2f;
  --muted: #9a9a9a;
  --border: rgba(255,255,255,0.08);
}

/* Reset */

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial;
  line-height: 1.5;
}

/* Typography */

h1, h2, h3 {
  margin: 0 0 12px 0;
  font-weight: 700;
}

p {
  margin: 0 0 12px 0;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Layout */

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px 60px 20px;
}

/* Header */

.site-header {
  background: #1f1f1f;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-link {
  font-size: 20px;
  font-weight: 800;
  color: var(--fg);
}

.site-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.site-nav a {
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 400;
  transition: 0.2s ease;
}

.site-nav a:hover {
  background: rgba(207,110,12,0.15);
}

/* Cards */

.card,
.video-item,
.comment {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  transition: 0.2s ease;
}

.card:hover,
.video-item:hover {
  border-color: rgba(207,110,12,0.4);
}

/* Video Grid */

.video-list {
  display: grid;
  gap: 20px;
  margin-top: 24px;
}

@media (min-width: 700px) {
  .video-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1000px) {
  .video-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Video Page */

.video-player video {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--border);
  margin-bottom: 18px;
  background: black;
}

/* Forms */

form {
  margin-top: 16px;
}

input,
textarea,
button {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #2a2a2a;
  color: var(--fg);
  font-size: 14px;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
}

button {
  background: var(--accent);
  border: none;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s ease;
  color: #111;
}

button:hover {
  opacity: 0.9;
}

/* Comments */

.comments {
  margin-top: 24px;
  display: grid;
  gap: 16px;
}

.comment small {
  display: block;
  color: var(--muted);
  margin-top: 8px;
  font-size: 12px;
}

/* Admin */

.admin-section {
  margin-top: 40px;
}

.admin-section h3 {
  margin-bottom: 18px;
}

/* Tables (if any remain) */

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

th {
  background: #1f1f1f;
}

/* Subtle polish */

.video-item h3 {
  margin-bottom: 8px;
}

.video-item p {
  color: var(--muted);
  font-size: 14px;
}

/* Theme toggle behaves exactly like nav links */

.site-nav form {
  margin: 0;
  display: inline-flex;
}

.theme-toggle {
  all: unset;
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  color: var(--accent);
  border: 1px solid transparent;
  transition: 0.2s ease;
}

.theme-toggle:hover {
  background: rgba(207,110,12,0.15);
}

/* ======================
   Upload Overlay
   ====================== */

.upload-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.upload-overlay.hidden {
  display: none;
}

.upload-box {
  background: #2f2f2f;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 40px;
  text-align: center;
  max-width: 320px;
}

.upload-box p {
  margin: 20px 0 8px 0;
  font-weight: 600;
}

.upload-box small {
  opacity: 0.7;
}

/* Spinner */

.upload-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255,255,255,0.1);
  border-top: 4px solid var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.video-card-link {
  text-decoration: none;
  color: inherit;
}

.video-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 12px;
  margin-bottom: 12px;
  background: #111;
}

.video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: 0.3s ease;
}

.video-item:hover .video-thumb img {
  transform: scale(1.05);
}


