* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #020617;
  color: #e5e7eb;
}
.confirm-box {
  padding: 15px;
  margin-top: 10px;
  background: #222;
  border: 1px solid #444;
  border-radius: 6px;
}

.confirm-box button {
  margin-right: 10px;
}


a {
  color: #38bdf8;
  text-decoration: none;
}

.invideo-ad {
  margin: 16px auto;
  display: flex;
  justify-content: center;
}

a:hover {
  text-decoration: underline;
}

/* Top bar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid #111827;
  backdrop-filter: blur(10px);
}

.logo {
  font-weight: 700;
  font-size: 1.2rem;
  color: #f97316;
}

.topbar nav {
  display: flex;
  gap: 8px;
  align-items: center;
}

.creator-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 32px;
}


.creator-page .creator-bio {
  max-width: 520px;
}

/* TikTok-style creator bio */
.creator-bio {
  max-width: 360px;        /* TikTok-like narrow text block */
  margin: 6px auto 0;     /* center horizontally */
  font-size: 0.9rem;
  line-height: 1.35;
  color: #9ca3af;

  /* wrapping behavior */
  white-space: pre-wrap;  /* keeps line breaks */
  word-break: break-word;
  overflow-wrap: anywhere;

  text-align: center;
}

/* Professional back button */
.back-button {
  position: absolute;
  top: 68px;              /* sits nicely under navbar */
  left: 16px;

  display: flex;
  align-items: center;
  gap: 6px;

  padding: 10px 16px;
  min-height: 40px;

  background: rgba(2, 6, 23, 0.92);
  backdrop-filter: blur(10px);

  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9999px;

  color: #f9fafb;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.2px;

  cursor: pointer;
  z-index: 10;

  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);

  transition:
    background 0.15s ease,
    transform 0.12s ease,
    box-shadow 0.15s ease;
}

.back-button:hover {
  background: rgba(15, 23, 42, 0.95);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55);
}

.back-button:active {
  transform: translateY(0);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
}


/* ===== MOBILE CREATORS PAGE ===== */
@media (max-width: 768px) {
  .creators-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .creator-card {
    padding: 14px 10px;
    border-radius: 14px;
  }

  .creator-avatar {
    width: 88px;
    height: 88px;
    margin-bottom: 8px;
  }

  .creator-name {
    font-size: 0.95rem;
  }

  .creator-count {
    font-size: 0.75rem;
  }
}

/* ===== MOBILE CREATOR PROFILE ===== */
@media (max-width: 768px) {
  .creator-page {
    padding: 12px;
  }

  .creator-header {
    margin-top: 12px;
    margin-bottom: 24px;
  }

  .creator-avatar-large {
    width: 112px;
    height: 112px;
    margin-bottom: 10px;
  }

  .creator-header h2 {
    font-size: 1.3rem;
  }

  .creator-bio {
    max-width: 90%;
    font-size: 0.85rem;
  }
}

@media (max-width: 768px) {
  .back-button {
    top: 60px;
    left: 12px;
    padding: 8px 14px;
    font-size: 0.9rem;
  }
}

/* ===== MOBILE DASHBOARD UPLOAD COMPACT MODE ===== */
@media (max-width: 768px) {
  .dashboard-layout .video-thumb {
    height: 72px;
    aspect-ratio: 1 / 1;
    border-radius: 6px;
  }

  .dashboard-layout .video-card {
    padding: 8px;
  }
}

.edit-btn {
  margin-top: 8px;
  padding: 8px 12px;
  font-size: 0.85rem;
  border-radius: 10px;
  background: #0f172a;
}

/* ===== DASHBOARD UPLOAD ROW LAYOUT ===== */
.dashboard-video {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

/* Match index thumbnail style */
.dashboard-video .video-thumb {
  width: 96px;
  height: 96px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
}

/* Right-side content */
.dashboard-video .video-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Edit button aligned nicely */
.dashboard-video .edit-btn {
  align-self: flex-start;
  margin-top: 4px;
}



.creator-avatar-large {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
}

.creator-info h1 {
  margin: 0;
}

.creator-page {
  padding: 16px;
}

/* Buttons */

button {
  border: none;
  border-radius: 9999px;
  padding: 6px 12px;
  font-size: 0.9rem;
  cursor: pointer;
  background: #111827;
  color: #e5e7eb;
  transition: background 0.15s ease, transform 0.08s ease;
}

button:hover {
  background: #1f2937;
}

button:active {
  transform: scale(0.97);
}

button.primary {
  background: #f97316;
  color: #020617;
}

button.primary:hover {
  background: #fb923c;
}

button.danger {
  background: #b91c1c;
  color: #f9fafb;
}

button.danger:hover {
  background: #dc2626;
}

button.full {
  width: 100%;
}

/* Layout */

.content {
  max-width: 1000px;
  margin: 20px auto 40px;
  padding: 0 16px;
}

#hero h1 {
  font-size: 2rem;
  margin: 0 0 8px;
}

#hero p {
  margin: 0;
  color: #9ca3af;
}

/* Grid */

.videos-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.thumb-wrapper {
  position: relative;
}

.video-duration {
  position: absolute;
  bottom: 6px;
  left: 6px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 0.7rem;
  padding: 2px 5px;
  border-radius: 4px;
}

.price-badge {
  position: absolute;
  bottom: 6px;
  right: 6px;
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 700;
}

.price-badge.paid {
  background: rgba(17, 24, 39, 0.9);
  color: #facc15;
}

.price-badge.free {
  background: rgba(34, 197, 94, 0.9);
  color: #022c22;
}




/* ===== DASHBOARD VIDEO EDIT CARD ===== */
.video-card {
  background: #020617;
  border-radius: 14px;
  padding: 12px;
  border: 1px solid #111827;
}

/* Title input */
.video-card .title-input {
  font-size: 1rem;
  font-weight: 500;
  padding: 10px 12px;
  border-radius: 12px;
}

/* Paid toggle row */
.video-card .paid-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

/* Price input */
.video-card .price-input {
  margin-top: 6px;
  padding: 10px 12px;
  font-size: 0.95rem;
  border-radius: 12px;
}

/* Action buttons */
.video-card .action-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.video-card .action-row button {
  flex: 1;
  padding: 10px;
  font-size: 0.9rem;
  border-radius: 12px;
}

/* Desktop polish */
@media (min-width: 769px) {
  .video-card {
    padding: 14px;
  }
}


.video-card:hover {
  border-color: #f97316;
  box-shadow: 0 12px 30px rgba(0,0,0,0.5);
  transform: translateY(-2px);
}

.video-card h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.video-card p {
  margin: 2px 0;
  font-size: 0.85rem;
  color: #9ca3af;
}

.badge {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 0.75rem;
  background: #0f172a;
  color: #e5e7eb;
}

.creators-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.creator-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px;
  text-align: center;
  background: #111;
  border-radius: 10px;
  text-decoration: none;
  color: white;
  transition: transform 0.15s ease;
}

.creator-card:hover {
  transform: scale(1.03);
}

.creator-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 10px;
}

.creator-name {
  font-weight: 600;
  margin-bottom: 4px;
}

.creator-count {
  font-size: 13px;
  opacity: 0.7;
}

/* Creator thumbnails – same behavior as video thumbs */

.creator-thumb-wrapper {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 12px;
  margin-bottom: 8px;
  background: #020617;
}

.creator-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}


.creator-card h3 {
  margin: 6px 0 2px;
  font-size: 1rem;
}

.creator-card p {
  margin: 0;
  font-size: 0.8rem;
  color: #9ca3af;
}

/* Forms */

label {
  display: block;
  margin-top: 10px;
  margin-bottom: 4px;
  font-size: 0.85rem;
  color: #9ca3af;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #111827;
  background: #020617;
  color: #e5e7eb;
  padding: 8px 10px;
  font-size: 0.9rem;
}

input[type="file"] {
  margin-top: 4px;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: #f97316;
}

/* Modal */

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.85);
  z-index: 50;
}

.modal.hidden {
  display: none;
}

.modal-content {
  position: relative;
  width: 100%;
  max-width: 360px;
  background: #020617;
  padding: 16px 16px 20px;
  border-radius: 16px;
  border: 1px solid #111827;
  box-shadow: 0 20px 50px rgba(0,0,0,0.9);
}

.modal-content h2 {
  margin-top: 0;
}

.modal-content .close {
  position: absolute;
  right: 10px;
  top: 10px;
  border-radius: 9999px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Misc */

.small {
  font-size: 0.8rem;
  color: #9ca3af;
}

.hidden {
  display: none !important;
}

/* Player page */

.video-wrapper {
  position: relative;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9; /* Makes it scale properly */
  overflow: hidden;
  border-radius: 8px; /* optional */
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}


.player {
  width: 100%;
  max-height: 70vh;
  background: #000;
  border-radius: 12px;
}

#video-meta h1 {
  margin-top: 0;
  font-size: 1.4rem;
}

#video-meta p {
  margin-top: 4px;
}

/* Progress bar */

.progress {
  margin-top: 10px;
  width: 100%;
  height: 8px;
  border-radius: 9999px;
  background: #020617;
  border: 1px solid #111827;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: #f97316;
  transition: width 0.15s ease;
}

.video-thumb {
  width: 100%;
  height: 100px; 
  aspect-ratio: 1 / 1;      /* forces a perfect square */
  object-fit: cover;        /* fills the square without distortion */
  border-radius: 8px;       /* optional rounded corners */
  display: block;
}

.ad-container,
.ad-container-right {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 10px auto;
}

.ad-container-right {
  float: right;
  margin-left: 15px;
}
/* Sidebar ad shared styling */
.ad-sidebar {
  position: fixed;
  top: 80px; /* adjust depending on your navbar height */
  width: 160px;
  height: 600px;
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

/* Right side */
.ad-right {
  right: 10px; /* stick to right side */
}

/* Left side */
.ad-left {
  left: 10px; /* stick to left side */
}

/* Prevent ads from overlapping the content */
body {
  padding-left: 180px;  /* makes space for left sidebar */
  padding-right: 180px; /* makes space for right sidebar */
}




/* Responsive */

@media (max-width: 800px) {
  #video-wrapper {
    grid-template-columns: 1fr;
  }

  /* Hide the floating left/right ads */
  .ad-sidebar,
  .ad-left,
  .ad-right,.desktop-only {
    display: none !important;
  }

  /* Remove forced padding that breaks layout */
  body {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* Allow content to use full width */
  .content {
    padding: 0 12px;
  }
  .invideo-ad {
    transform: scale(0.9);
  }
}

/* ===== MOBILE NAV ===== */

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.6rem;
  color: #e5e7eb;
  cursor: pointer;
}

/* Mobile layout */
@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .topbar nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;

    display: flex;
    flex-direction: column;
    gap: 10px;

    padding: 14px;
    background: rgba(15, 23, 42, 0.98);
    border-bottom: 1px solid #111827;

    /* animation setup */
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-6px);

    transition:
      max-height 0.35s ease,
      opacity 0.25s ease,
      transform 0.25s ease;
  }

  .topbar nav.open {
    max-height: 520px; /* enough for all buttons */
    opacity: 1;
    transform: translateY(0);
  }

  .topbar nav button {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
  }

  #nav-credits {
    text-align: center;
    font-size: 0.85rem;
    opacity: 0.7;
  }
}
/* Hide categories section on mobile */
@media (max-width: 768px) {
  #category-section {
    display: none;
  }
}

/* ===== MOBILE VIDEO GRID ===== */
@media (max-width: 768px) {
  .videos-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .video-card {
    width: 100%;
    padding: 8px;
    border-radius: 10px;
  }

  .video-thumb {
    height: auto;
    aspect-ratio: 1 / 1;
  }

  .video-card h3 {
    font-size: 0.9rem;
    line-height: 1.2;
    margin-top: 6px;
  }

  .video-card p {
    font-size: 0.75rem;
  }

  .price-badge,
  .video-duration {
    font-size: 0.65rem;
    padding: 2px 4px;
  }
}
/* Prevent closed mobile nav from blocking clicks */
@media (max-width: 768px) {
  .topbar nav {
    pointer-events: none;
  }

  .topbar nav.open {
    pointer-events: auto;
  }
}

/* ===== DASHBOARD LAYOUT ===== */
.dashboard-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
  padding: 16px;
}
/* Allow uploads list to scroll naturally */



/* Sidebar */
.dashboard-layout aside {
  border: 1px solid #222;
  border-radius: 12px;
  padding: 12px;
}

/* Main panel */
.dashboard-layout #view {
  border: 1px solid #222;
  border-radius: 12px;
  padding: 16px;
}


/* ===== MOBILE DASHBOARD ===== */
@media (max-width: 768px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  /* Sidebar becomes horizontal menu */
  .dashboard-layout aside {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    border: none;
    padding: 0 0 8px;
  }

  .dashboard-layout aside h3 {
    display: none;
  }

  .dashboard-layout aside button {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 10px 14px;
    font-size: 0.9rem;
  }
}

/* Allow uploads list to scroll naturally */
.dashboard-layout,
.dashboard-layout #view {
  overflow: visible;
}
/* Ensure dashboard fills viewport */
.dashboard-layout {
  min-height: calc(100vh - 60px); /* account for topbar */
}
/* Better scrolling for long upload lists */
.dashboard-layout .videos-grid {
  margin-bottom: 40px; /* breathing room for last card */
}
@media (max-width: 768px) {
  .dashboard-layout aside {
    position: sticky;
    top: 56px; /* below topbar */
    background: #020617;
    z-index: 5;
  }
}

/* ===== MOBILE DASHBOARD UPLOADS ===== */
@media (max-width: 768px) {
  .dashboard-video {
    gap: 10px;
  }

  .dashboard-video .video-thumb {
    width: 72px;
    height: 72px;
    border-radius: 8px;
  }

  .dashboard-video h3 {
    font-size: 0.9rem;
    line-height: 1.2;
  }

  .dashboard-video .edit-btn {
    font-size: 0.8rem;
    padding: 6px 10px;
  }

  .edit-panel {
    margin-top: 6px;
  }
}








