/* ========== Base ========== */
body {
  font-family: Arial, sans-serif;
  background: #111;              /* darker site vibe */
  margin: 0;
  padding: 20px;
  padding-top: 60px;             /* room for fixed navbar (adjust if needed) */
  color: #eaeaea;
}

h2 { text-align: center; }

/* Card-style container (used on auth/upload pages) */
.container {
  max-width: 500px;
  margin: 0 auto;
  background: #2b2b2b;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 0 15px rgba(0,0,0,0.1);
}

/* Inputs & buttons */
input[type="email"],
input[type="password"],
select,
input[type="text"],
input[type="file"],
textarea {
  width: 100%;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #555;
  background: #3a3a3a;
  color: #ddd;
  box-sizing: border-box;
}

label {
  margin: 10px 0 5px;
  font-weight: bold;
  display: block;
}

input[type="checkbox"] { margin-right: 10px; }

button[type="submit"], button, .btn {
  margin-top: 12px;
  padding: 10px 14px;
  background: #e10600;           /* Arsenal-ish red */
  border: none;
  color: white;
  font-size: 16px;
  border-radius: 8px;
  cursor: pointer;
}
button[type="submit"]:hover,
button:hover,
.btn:hover { background: #b90600; }

.checkbox-label {
  display: flex;
  align-items: center;
  margin-top: 10px;
  color: #bbb;
}
input[type="checkbox"]:checked + span {
  color: #007bff;
  font-weight: bold;
}

/* ========== Navbar ========== */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #222;
  color: #fff;
  padding: 10px 20px;
  position: fixed;   /* stick to top */
  top: 0; left: 0; right: 0;
  z-index: 1000;
}

.nav-left .nav-button {
  color: white;
  margin-right: 15px;
  text-decoration: none;
  font-weight: bold;
}
.nav-left .nav-button:hover { text-decoration: underline; }

.nav-right { position: relative; }

.user-icon {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: white;
}

/* Dropdown */
.dropdown-menu {
  position: absolute;
  right: 0;
  top: 40px;
  background-color: #333;
  list-style: none;
  padding: 10px 0;
  margin: 0;
  width: 180px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
  z-index: 1100;
}
.dropdown-menu li {
  padding: 10px 16px;
  cursor: pointer;
  color: white;
}
.dropdown-menu li:hover { background-color: #555; }

.hidden { display: none !important; }

/* Small-screen navbar ergonomics */
@media (max-width: 560px) {
  .navbar { padding: 10px; }
  .nav-left { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; }
  .nav-left::-webkit-scrollbar { display: none; }
}

/* ========== Full-width pages (homepage, etc.) ========== */
.page {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 20px; /* breathing room */
}

/* Toolbar: search + sort */
.toolbar {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 10px 0 6px;
  flex-wrap: wrap; /* mobile-friendly */
}

.search-wrap {
  position: relative;
  flex: 1 1 560px;    /* wide on desktop */
  max-width: 900px;
  min-width: 260px;
}

#searchInput {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #444;
  background: #1e1e1e;
  color: #fff;
  font-size: 16px;
  outline: none;
}

/* Search suggestions (dropdown) */
.suggestion-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: #232323;
  border: 1px solid #444;
  border-radius: 8px;
  max-height: 280px; /* scrollable, not too tall */
  overflow-y: auto;
  z-index: 1200;     /* below modal, above navbar */
  box-shadow: 0 6px 16px rgba(0,0,0,0.35);
}
.suggestion-list .suggestion-item {
  padding: 10px 12px;
  color: #eee;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.suggestion-list .suggestion-item:hover { background: #2f2f2f; }
.suggestion-list .s-title { font-weight: 600; }
.suggestion-list .s-tags  { color: #bdbdbd; font-size: 12px; }

/* Sort dropdown */
.sort-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #ddd;
}
.sort-wrap select {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #444;
  background: #1e1e1e;
  color: #fff;
}

/* ========== Video Grid ========== */
.video-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 4 per row */
  gap: 18px;
  margin-top: 16px;
}
@media (max-width: 1200px) { .video-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px)  { .video-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .video-grid { grid-template-columns: 1fr; } }

.video-card {
  background: #2a2a2a;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 0 8px rgba(0,0,0,0.25);
}

/* Thumbnail wrapper (16:9) */
.video-thumb {
  position: relative;
  width: 100%;
  padding-top: 56.25%;     /* 16:9 */
  background: #111;
  overflow: hidden;
}

/* Image sits below preview video */
.video-thumb img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  z-index: 1;
}

/* Hover/touch preview video (fades in above the image) */
.preview-video {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;     /* don’t capture taps/clicks */
  z-index: 2;               /* above the img */
  opacity: 0;               /* start hidden */
  transition: opacity 120ms linear;
}
.preview-playing .preview-video { opacity: 1; }

/* Duration badge stays on top of both */
.badge-duration,
.duration-badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 3;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 12px;
  padding: 3px 6px;
  border-radius: 4px;
}

/* Card info */
.video-info,
.video-meta { padding: 10px 12px 12px; color: #eee; }
.video-title { margin: 0 0 6px; font-size: 16px; line-height: 1.3; }
.video-meta { font-size: 13px; color: #bdbdbd; }
.video-meta a.user-link { color: #b9d6ff; text-decoration: underline; }

/* ========== Pagination ========== */
.pagination {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin: 18px 0 8px;
}
.page-btn,
.page-ellipsis {
  padding: 6px 10px;
  border-radius: 6px;
  background: #222;
  color: #fff;
  border: 1px solid #444;
  cursor: pointer;
  user-select: none;
}
.page-btn.active {
  background: #e60000;
  border-color: #e60000;
}
.page-btn:hover { background: #333; }
.page-ellipsis { cursor: default; opacity: 0.7; }

/* ========== Auth Modal ========== */
#auth-modal {
  position: fixed;
  inset: 0;                     /* full viewport */
  z-index: 3000;                /* above navbar & dropdown */
  background: rgba(0,0,0,0.55); /* backdrop */
  display: flex;
  justify-content: center;
  align-items: flex-start;      /* stick near top */
  padding-top: 80px;            /* show under navbar area */
}

#auth-modal .auth-card {
  width: min(600px, 92vw);
  background: #1f1f1f;
  color: #fff;
  border-radius: 12px;
  border: 1px solid #333;
  box-shadow: 0 12px 30px rgba(0,0,0,0.5);
  padding: 18px 18px 20px;
  position: relative;
}

#auth-modal .auth-card h3 { margin: 0 0 8px; }

#auth-modal .modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: transparent;
  border: 0;
  font-size: 20px;
  color: #aaa;
  cursor: pointer;
}
#auth-modal .modal-close:hover { color: #fff; }

/* ========== Upload Progress ========== */
.progress-wrap {
  position: relative;
  width: 100%;
  height: 12px;
  background: #2a2a2a;
  border-radius: 8px;
  overflow: hidden;
  margin: 12px 0 10px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}
.progress-bar {
  height: 100%;
  width: 0%;
  background: #e60000;
  transition: width 0.2s ease;
}
.progress-label {
  position: absolute;
  right: 8px;
  top: -22px;
  font-size: 12px;
  color: #ccc;
}
.progress-wrap.indeterminate .progress-bar {
  width: 40%;
  animation: progress-indeterminate 1s linear infinite;
}
@keyframes progress-indeterminate {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(250%); }
}

/* ========== watch page title ========== */
.video-title-heading{margin:14px 0 8px;color:#fff;font-size:20px;font-weight:700;line-height:1.25}

.uploader-link { color:#fff; text-decoration:underline; }







/* 1) Kill horizontal overflow globally */
html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

/* 2) Use border-box everywhere to avoid width math overflow */
*, *::before, *::after {
  box-sizing: border-box;
}




