﻿:root {
  --bg-main: #08070d;
  --bg-soft: #11101a;
  --bg-card: #181329;
  --text-main: #f2f2f8;
  --text-soft: #b7b6c8;
  --primary: #6a0dad;
  --primary-2: #a34dff;
  --danger: #ff4d67;
  --radius: 16px;
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Montserrat", sans-serif;
  background:
    radial-gradient(circle at 8% 0%, rgba(106, 13, 173, 0.2) 0%, transparent 32%),
    linear-gradient(140deg, #050508 0%, #090714 48%, #06060d 100%);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

.hidden {
  display: none !important;
}

.loader-overlay {
  position: fixed;
  inset: 0;
  background: #040308;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
  z-index: 9999;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.loader-overlay.hide {
  opacity: 0;
  visibility: hidden;
}

.loader {
  width: 52px;
  height: 52px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--primary-2);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  background: linear-gradient(180deg, rgba(10, 8, 17, 0.94), rgba(10, 8, 17, 0.76));
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.topbar-left,
.topbar-right {
  min-width: 160px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-right {
  justify-content: flex-end;
}

.logo {
  font-weight: 800;
  letter-spacing: 1px;
  font-size: 1.15rem;
  color: #f7f2ff;
}

.search-wrap {
  flex: 1;
  max-width: 700px;
}

.search-wrap.compact {
  display: flex;
  justify-content: center;
}

#searchInput {
  width: 100%;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid rgba(162, 120, 245, 0.35);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  outline: none;
  transition: all 0.25s ease;
}

#searchInput:focus {
  border-color: var(--primary-2);
  box-shadow: 0 0 0 4px rgba(163, 77, 255, 0.2);
}

.btn,
.icon-btn {
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  color: #fff;
  background: linear-gradient(120deg, var(--primary), var(--primary-2));
}

.icon-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  display: none;
}

.btn.danger {
  background: linear-gradient(120deg, #ce2542, var(--danger));
}

.btn:hover,
.icon-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(163, 77, 255, 0.35);
}

.layout {
  display: flex;
  gap: 20px;
  flex: 1;
  padding: 18px 20px 28px;
}

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: rgba(14, 12, 22, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  height: calc(100vh - 104px);
  position: sticky;
  top: 84px;
  padding: 18px 14px;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.side-link {
  padding: 11px 12px;
  border-radius: 11px;
  color: var(--text-soft);
  transition: background 0.25s ease, color 0.25s ease;
}

.side-link:hover,
.side-link.active {
  color: #fff;
  background: rgba(163, 77, 255, 0.2);
}

.content {
  flex: 1;
  min-width: 0;
}

.videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 18px;
}

.video-card {
  background: linear-gradient(180deg, rgba(28, 22, 43, 0.95), rgba(17, 14, 27, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transform: translateY(20px);
  opacity: 0;
  animation: cardIn 0.55s ease forwards;
}

@keyframes cardIn {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.video-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.card-body {
  padding: 12px 14px 15px;
}

.card-title {
  margin: 0 0 8px;
  font-size: 0.98rem;
}

.meta {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.82rem;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.empty-state {
  text-align: center;
  margin-top: 28px;
  color: var(--text-soft);
}

.section-title {
  margin: 4px 0 16px;
  font-size: 1.5rem;
}

.section-subtitle {
  margin: 0 0 12px;
  font-size: 1.15rem;
}

.category-block {
  margin-bottom: 28px;
}


.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.category-chip {
  border: 1px solid rgba(162, 120, 245, 0.35);
  background: rgba(255, 255, 255, 0.04);
  color: #e8defb;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.category-chip:hover {
  background: rgba(163, 77, 255, 0.2);
}

.category-chip.active {
  background: linear-gradient(120deg, var(--primary), var(--primary-2));
  border-color: transparent;
  color: #fff;
}


.player-page {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 18px;
}

.player-column {
  background: rgba(13, 11, 20, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}

.video-player-wrap {
  position: relative;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
}

.video-player-wrap video {
  width: 100%;
  display: block;
  background: #000;
}

.fullscreen-btn {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 3;
}

.player-meta h1 {
  margin: 14px 0 10px;
  font-size: 1.34rem;
}

.player-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--text-soft);
}

.like-btn.liked {
  background: linear-gradient(120deg, #2f9f75, #2ec597);
}

.description {
  margin-top: 14px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 12px;
  color: #ddd9ea;
  line-height: 1.5;
}

.comments-section {
  margin-top: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px;
}

.comments-section h2 {
  margin: 0 0 12px;
  font-size: 1.08rem;
}

.comment-form {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.comments-list {
  display: grid;
  gap: 8px;
}

.comment-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 10px;
}

.comment-item h4 {
  margin: 0 0 6px;
  font-size: 0.92rem;
}

.comment-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.comment-delete-btn {
  padding: 5px 10px;
  font-size: 0.74rem;
}

.comment-item p {
  margin: 0 0 6px;
  color: #e8e4f6;
  line-height: 1.4;
}

.comment-item span {
  color: var(--text-soft);
  font-size: 0.76rem;
}

.recommendations {
  background: rgba(13, 11, 20, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 12px;
  max-height: calc(100vh - 136px);
  overflow-y: auto;
  box-shadow: var(--shadow);
}

.reco-item {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 10px;
  margin-bottom: 12px;
  padding: 8px;
  border-radius: 12px;
  transition: background 0.2s ease;
}

.reco-item:hover {
  background: rgba(163, 77, 255, 0.18);
}

.reco-item img {
  width: 100%;
  height: 74px;
  object-fit: cover;
  border-radius: 10px;
}

.reco-item h3 {
  margin: 0 0 6px;
  font-size: 0.9rem;
}

.reco-item p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.76rem;
}

.admin-page {
  flex: 1;
  padding: 30px 20px;
  max-width: 1050px;
  width: 100%;
  margin: 0 auto;
}

.card {
  background: rgba(14, 11, 24, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}

.admin-login {
  max-width: 480px;
  margin: 40px auto;
}

.admin-login form,
.admin-form {
  display: grid;
  gap: 10px;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(162, 120, 245, 0.32);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  border-radius: 10px;
  padding: 12px 14px;
  font-family: inherit;
}

label {
  font-size: 0.86rem;
  color: var(--text-soft);
  margin-top: 3px;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary-2);
}

.error-msg {
  color: #ff8fa2;
  margin-top: 8px;
}

.admin-videos {
  display: grid;
  gap: 10px;
}

.admin-row {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 12px;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  padding: 8px;
}

.admin-row img {
  width: 100%;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
}

.admin-actions {
  display: flex;
  gap: 8px;
}

.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.history-list {
  display: grid;
  gap: 10px;
}

.history-item {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 8px;
  transition: background 0.2s ease, transform 0.2s ease;
}

.history-item:hover {
  background: rgba(163, 77, 255, 0.18);
  transform: translateY(-1px);
}

.history-item img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
}

.history-item h3 {
  margin: 0 0 8px;
  font-size: 0.96rem;
}

.history-item p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.83rem;
}

.site-footer {
  margin-top: auto;
  text-align: center;
  padding: 14px 10px 20px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #b56cff;
  text-shadow:
    0 0 6px rgba(181, 108, 255, 0.95),
    0 0 14px rgba(181, 108, 255, 0.72),
    0 0 26px rgba(90, 20, 138, 0.8);
}

@media (max-width: 1024px) {
  .player-page {
    grid-template-columns: 1fr;
  }

  .recommendations {
    max-height: unset;
  }
}

@media (max-width: 860px) {
  .icon-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
  }

  .topbar {
    padding: 12px 14px;
  }

  .topbar-left,
  .topbar-right {
    min-width: auto;
  }

  .layout {
    gap: 12px;
    padding: 12px 12px 24px;
  }

  .sidebar {
    position: fixed;
    z-index: 101;
    top: 68px;
    left: 12px;
    width: 74%;
    max-width: 290px;
    height: calc(100vh - 88px);
    transform: translateX(-115%);
    transition: transform 0.28s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }
}

@media (max-width: 680px) {
  .search-wrap {
    display: none;
  }

  .videos-grid {
    grid-template-columns: 1fr;
  }

  .admin-row {
    grid-template-columns: 1fr;
  }

  .reco-item {
    grid-template-columns: 120px 1fr;
  }

  .history-item {
    grid-template-columns: 1fr;
  }
}


