/* ===== VideoDetail.css – Single Video Page (edge‑to‑edge mobile) ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #4361ee;
  --primary-dark: #3a56d4;
  --secondary: #ff6b6b;
  --accent: #f9c74f;
  --success: #4caf50;
  --danger: #ff6b6b;
  --dark: #1e293b;
  --gray-900: #0f172a;
  --gray-800: #334155;
  --gray-700: #475569;
  --gray-600: #64748b;
  --gray-500: #94a3b8;
  --gray-400: #cbd5e1;
  --gray-300: #e2e8f0;
  --gray-200: #f1f5f9;
  --gray-100: #f8fafc;
  --white: #ffffff;
  --bg-light: #f8fafc;

  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.07);
  --shadow-hover: 0 20px 30px -10px rgba(67, 97, 238, 0.2);
  --transition: all 0.2s ease;

  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
  background-color: var(--bg-light);
  color: var(--dark);
  line-height: 1.5;
  overflow-x: hidden;
  width: 100%;
}

/* ===== MODERN HEADER – edge‑to‑edge ===== */
.modern-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--gray-300);
  padding: 0.75rem 0;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.back-btn {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--gray-800);
  padding: 0.25rem 1rem;
  cursor: pointer;
  transition: var(--transition);
  height: 40px;
  display: flex;
  align-items: center;
  text-decoration: none;
}
.back-btn:hover { color: var(--primary); }

.header-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--gray-900);
  padding-right: 1rem;
}

/* ===== ALERT MESSAGES – edge‑to‑edge ===== */
.alert-success {
  background: rgba(76, 175, 80, 0.1);
  border-left: 4px solid var(--success);
  color: var(--success);
  padding: 1rem;
  margin: 0 0 1rem 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 500;
  border-radius: 0;
}

/* ===== MAIN CONTAINER – edge‑to‑edge ===== */
.detail-container {
  max-width: 100%;
  margin: 0;
  padding: 0;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

/* ----- Video Section (full width, inner padding) ----- */
.video-section {
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: 0;          /* flat on mobile */
  margin: 0 0 1rem 0;         /* only bottom margin */
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.video-player {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}
.video-player video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.video-title {
  font-size: 1.4rem;
  font-weight: 700;
  padding: 1rem 1rem 0.5rem;
  color: var(--gray-900);
}

.video-meta {
  display: flex;
  gap: 1.5rem;
  padding: 0 1rem 1rem;
  color: var(--gray-600);
  font-size: 0.9rem;
}
.video-meta span {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ----- Sidebar – stacked cards, full width ----- */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0 1rem;            /* inner padding */
}

.card {
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: 0;            /* flat on mobile */
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.price-card {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
}
.price-label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  opacity: 0.9;
  margin-bottom: 0.25rem;
}
.price-amount {
  font-size: 2rem;
  font-weight: 700;
}

/* Seller card */
.seller-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.seller-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gray-300);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary);
  overflow: hidden;
}
.seller-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.seller-info {
  flex: 1;
}
.seller-name {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--gray-900);
  margin-bottom: 0.25rem;
}
.seller-stats {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--gray-600);
}
.seller-stats span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.action-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1rem;
  border-radius: 3rem;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}
.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -8px var(--primary);
}
.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}
.btn-outline:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
}
.btn-danger {
  background: var(--secondary);
  color: white;
}
.btn-danger:hover {
  background: #e05a5a;
  transform: translateY(-2px);
}

.category-chip {
  display: inline-block;
  background: var(--gray-200);
  color: var(--gray-800);
  padding: 0.4rem 1rem;
  border-radius: 2rem;
  font-size: 0.9rem;
  font-weight: 500;
}
.description-text {
  color: var(--gray-700);
  line-height: 1.6;
  font-size: 0.95rem;
}

/* ----- Gallery Section (full width, inner padding) ----- */
.gallery-section {
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: 0;            /* flat on mobile */
  margin: 0 1rem 1rem;          /* side margins for gallery? No, we want edge-to-edge but inner padding */
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.gallery-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--gray-800);
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}
.thumbnail {
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
  background: var(--gray-200);
}
.thumbnail:hover {
  transform: scale(1.03);
  border-color: var(--primary);
}
.thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.thumbnail-error {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-300);
  color: var(--gray-600);
  font-size: 1.5rem;
}
.empty-gallery {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem;
  color: var(--gray-500);
}
.empty-gallery i {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

/* ----- Comments Section (full width, inner padding) ----- */
.comments-section {
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: 0;            /* flat on mobile */
  margin: 0 1rem 1rem;          /* side margins */
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.comments-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gray-800);
}
.comment-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 0.5rem;
}
.comment-item {
  display: flex;
  gap: 0.75rem;
}
.comment-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  flex-shrink: 0;
}
.comment-content {
  flex: 1;
  background: var(--gray-100);
  padding: 0.75rem;
  border-radius: var(--radius-lg);
}
.comment-author {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--gray-900);
  margin-bottom: 0.25rem;
}
.comment-text {
  color: var(--gray-700);
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}
.comment-time {
  font-size: 0.7rem;
  color: var(--gray-500);
}
.comment-input-area {
  display: flex;
  gap: 0.5rem;
}
#commentInput {
  flex: 1;
  padding: 0.9rem 1rem;
  border: 1px solid var(--gray-300);
  border-radius: 3rem;
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
}
#commentInput:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}
#postCommentBtn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.9rem 1.5rem;
  border-radius: 3rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
#postCommentBtn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px -5px var(--primary);
}

/* ===== IMAGE MODAL ===== */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.modal.active {
  display: flex;
  opacity: 1;
}
.close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: white;
  font-size: 3rem;
  cursor: pointer;
  z-index: 1010;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  transition: var(--transition);
}
.close:hover {
  background: rgba(255,255,255,0.2);
  transform: scale(1.1);
}
.modal-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  font-size: 2rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.3);
}
#prevImage { left: 20px; }
#nextImage { right: 20px; }
.modal-button:hover {
  background: rgba(255,255,255,0.4);
  transform: translateY(-50%) scale(1.1);
}
.modal-image {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius-lg);
}

/* ===== TABLET & DESKTOP UPGRADES ===== */
@media (min-width: 768px) {
  .detail-container {
    grid-template-columns: 2fr 1fr;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    gap: 2rem;
  }

  .video-section,
  .card,
  .gallery-section,
  .comments-section {
    border-radius: var(--radius-xl);
    margin: 0;
  }

  .sidebar {
    padding: 0;
  }

  .gallery-section {
    grid-column: 1 / -1;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
  }

  .comments-section {
    grid-column: 1 / -1;
  }

  .comment-list {
    max-height: 500px;
  }
}

@media (min-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ===== UTILITIES ===== */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
}