/* ============================================================
   ViralxPot — Component Styles
   Cards, Buttons, Pagination, Filters, Toast, Skeleton, Modal
   Premium Luxury Aesthetic — Netflix/Apple quality
   ============================================================ */

/* ---- Filter Bar ---- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.filter-btn {
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  transition: all 0.3s ease;
}
.filter-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border-color: var(--border-light);
}
.filter-btn.active {
  background: linear-gradient(135deg, var(--neon-purple), var(--neon-pink));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.25);
}

/* ---- Card Grid ---- */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
@media (min-width: 580px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 900px) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (min-width: 1200px) {
  .card-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Smooth content-area transition for filter switching */
#content-area {
  transition: opacity 0.18s ease;
}

/* ---- Card ---- */
.card {
  position: relative;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition:
    transform 0.5s var(--transition-smooth),
    box-shadow 0.5s ease;
  animation: fadeInUp 0.45s var(--transition-smooth) backwards;
}

/* Soft glow border */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    135deg,
    rgba(139, 92, 246, 0.15),
    rgba(236, 72, 153, 0.1)
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  transition: all 0.5s ease;
  z-index: 2;
}

/* ---- HOVER: Desktop only (fix mobile freeze) ---- */
@media (hover: hover) {
  .card:hover {
    transform: translateY(-6px) scale(1.015);
    box-shadow: var(--shadow-card-hover);
  }
  .card:hover::before {
    background: conic-gradient(
      from var(--border-angle),
      var(--neon-purple),
      var(--neon-pink),
      var(--neon-purple)
    );
    animation: borderRotate 3s linear infinite;
  }
  .card:hover .card-image img.loaded {
    transform: scale(1.08);
  }
  .card:hover .image-overlay {
    opacity: 1;
  }
  .card:hover .play-overlay {
    opacity: 1;
  }
  .card:hover .play-overlay .play-circle {
    transform: scale(1);
  }
}

/* Card image */
.card-image {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: linear-gradient(135deg, #070a1a, #050714);
}
.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition:
    opacity 0.45s ease,
    transform 0.6s var(--transition-smooth);
}
.card-image img.loaded {
  opacity: 1;
}
.card-image .image-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(8, 9, 13, 0.55) 0%, transparent 45%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

/* Play icon overlay */
.card-image .play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 3;
}
.play-overlay .play-circle {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(0.8);
  transition:
    transform 0.4s var(--transition-smooth),
    background 0.3s ease,
    border-color 0.3s ease;
}
.play-circle:hover {
  background: rgba(139, 92, 246, 0.45);
  border-color: rgba(139, 92, 246, 0.6);
}
.play-circle svg {
  width: 22px;
  height: 22px;
  color: #fff;
  margin-left: 2px;
}

/* Mobile: always show play overlay subtly */
@media (hover: none) {
  .card-image .play-overlay {
    opacity: 0.8;
  }
  .play-overlay .play-circle {
    transform: scale(0.85);
    background: rgba(0, 0, 0, 0.5);
    visibility: hidden;
  }
}

/* Card body */
.card-body {
  padding: 1.1rem 1.2rem 1.2rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  position: relative;
  z-index: 1;
}
.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.card-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: auto;
}

/* ---- BUTTONS ---- */

/* Watch Now */
.btn-watch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--neon-purple), var(--neon-pink));
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  border: none;
  position: relative;
  overflow: hidden;
  transition: all 0.35s ease;
  box-shadow: 0 4px 18px rgba(139, 92, 246, 0.25);
  text-decoration: none;
}
.btn-watch:hover {
  box-shadow: 0 6px 28px rgba(139, 92, 246, 0.4);
  transform: translateY(-1px);
  filter: brightness(1.08);
}
.btn-watch:active {
  transform: translateY(0) scale(0.98);
}
.btn-watch svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}
.btn-watch .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  transform: scale(0);
  animation: ripple 0.6s ease-out;
  pointer-events: none;
}

/* Alternate */
.btn-alt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-lg);
  background: rgba(34, 211, 238, 0.06);
  border: 1px solid rgba(34, 211, 238, 0.18);
  color: var(--neon-cyan);
  font-weight: 600;
  font-size: 0.8rem;
  transition: all 0.3s ease;
  text-decoration: none;
}
.btn-alt:hover {
  background: rgba(34, 211, 238, 0.12);
  border-color: rgba(34, 211, 238, 0.35);
  box-shadow: 0 4px 20px rgba(34, 211, 238, 0.12);
  transform: translateY(-1px);
}
.btn-alt svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* Gradient button */
.btn-gradient {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--neon-purple), var(--neon-pink));
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  border: none;
  transition: all 0.35s ease;
  box-shadow: 0 4px 18px rgba(139, 92, 246, 0.25);
}
.btn-gradient:hover {
  box-shadow: 0 6px 28px rgba(139, 92, 246, 0.4);
  transform: translateY(-1px);
  filter: brightness(1.08);
}
.btn-gradient:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

/* Ghost button */
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1.25rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.8rem;
  transition: all 0.25s ease;
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-primary);
}

/* ---- PAGINATION ---- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 1.75rem 0 0.5rem;
}
.pagination a,
.pagination button,
.pagination span {
  min-width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.25s ease;
  text-decoration: none;
}
.page-num {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}
.page-num:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}
.page-num.active {
  background: linear-gradient(135deg, var(--neon-purple), var(--neon-pink));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 3px 14px rgba(139, 92, 246, 0.25);
}
.page-nav {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}
.page-nav:hover:not(.disabled) {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}
.page-nav.disabled {
  opacity: 0.3;
  pointer-events: none;
  color: var(--text-muted);
}
.page-nav svg {
  width: 16px;
  height: 16px;
}
.page-dots {
  color: var(--text-muted);
}

/* ---- EMPTY STATE ---- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3.5rem 2rem;
  max-width: 420px;
  margin: 2rem auto;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-2xl);
  backdrop-filter: blur(12px);
  animation: fadeIn 0.4s ease;
}
.empty-state-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  position: relative;
}
.empty-state-icon::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: rgba(139, 92, 246, 0.06);
  filter: blur(10px);
}
.empty-state-icon svg {
  width: 26px;
  height: 26px;
  color: var(--text-muted);
  position: relative;
}
.empty-state h3 {
  font-size: 1.25rem;
  margin-bottom: 0.6rem;
  font-weight: 700;
}
.empty-state p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 320px;
}

/* ---- SKELETON LOADING ---- */
.skeleton-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  position: relative;
}
.skeleton-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 30%,
    rgba(255, 255, 255, 0.025) 50%,
    transparent 70%
  );
  background-size: 200% 100%;
  animation: shimmer 1.8s ease-in-out infinite;
}
.skeleton-image {
  aspect-ratio: 16/9;
  background: rgba(255, 255, 255, 0.03);
}
.skeleton-body {
  padding: 1.1rem;
}
.skeleton-line {
  height: 13px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  margin-bottom: 0.65rem;
}
.skeleton-line.w-75 {
  width: 75%;
}
.skeleton-line.w-100 {
  width: 100%;
}
.skeleton-btn {
  height: 38px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.03);
  margin-top: 0.4rem;
}

/* ---- TOAST NOTIFICATIONS ---- */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1rem;
  left: 1rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  pointer-events: none;
}
@media (min-width: 640px) {
  .toast-container {
    left: auto;
    top: 5rem;
    bottom: auto;
    right: 1.5rem;
    width: 320px;
  }
}
.toast {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.8rem 1.1rem;
  border-radius: var(--radius-xl);
  backdrop-filter: blur(20px);
  border: 1px solid;
  pointer-events: auto;
  animation: toastIn 0.35s var(--transition-smooth);
  min-width: 260px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}
.toast.toast-exit {
  animation: toastOut 0.25s ease forwards;
}
.toast-success {
  background: rgba(5, 17, 10, 0.92);
  border-color: rgba(16, 185, 129, 0.25);
  color: #a7f3d0;
}
.toast-error {
  background: rgba(17, 5, 5, 0.92);
  border-color: rgba(239, 68, 68, 0.25);
  color: #fecaca;
}
.toast-info {
  background: rgba(5, 11, 17, 0.92);
  border-color: rgba(59, 130, 246, 0.25);
  color: #bfdbfe;
}
.toast-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.toast-success .toast-icon {
  color: #10b981;
}
.toast-error .toast-icon {
  color: #ef4444;
}
.toast-info .toast-icon {
  color: #3b82f6;
}
.toast-message {
  flex: 1;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.toast-close {
  background: none;
  border: none;
  color: inherit;
  opacity: 0.4;
  padding: 3px;
  border-radius: 6px;
  transition: all 0.2s ease;
  cursor: pointer;
}
.toast-close:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.06);
}
.toast-close svg {
  width: 15px;
  height: 15px;
}

/* ---- DELETE MODAL ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}
.modal-card {
  background: #0e0f16;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-2xl);
  padding: 2rem;
  max-width: 380px;
  width: 100%;
  text-align: center;
  animation: fadeInUp 0.3s var(--transition-smooth);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}
.modal-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}
.modal-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}
.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}
.modal-cancel-btn {
  padding: 0.6rem 1.5rem;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.25s ease;
}
.modal-cancel-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}
.modal-delete-btn {
  padding: 0.6rem 1.5rem;
  border-radius: var(--radius-lg);
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #f87171;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.25s ease;
}
.modal-delete-btn:hover {
  background: rgba(239, 68, 68, 0.2);
}
