:root {
  --bg-color: #0b1428;
  --glass-bg: rgba(18, 26, 44, 0.55);
  --glass-bg-hover: rgba(22, 34, 56, 0.65);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-hover: rgba(155, 89, 182, 0.35);
  --purple-accent: #9b59b6;
  --purple-glow: rgba(155, 89, 182, 0.25);
  --text-main: #ffffff;
  --text-muted: #98a8c8;
  --radius: 18px;
  --shadow-glass: 0 8px 40px rgba(0, 0, 0, 0.35);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  padding-bottom: 120px;
}

body::before, body::after {
  content: '';
  position: fixed;
  pointer-events: none;
  z-index: 0;
}
body::before {
  top: -30%;
  left: -20%;
  width: 70%;
  height: 80%;
  background: radial-gradient(ellipse at center, rgba(155, 89, 182, 0.2), transparent 70%);
}
body::after {
  bottom: -20%;
  right: -20%;
  width: 60%;
  height: 70%;
  background: radial-gradient(ellipse at center, rgba(52, 152, 219, 0.14), transparent 70%);
}

/* === Верхняя панель === */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2.5rem;
  background: rgba(10, 18, 34, 0.45);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-weight: 800;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  text-shadow: 0 0 14px rgba(155, 89, 182, 0.35);
  font-size: 1.1rem;
}

.btn-admin {
  padding: 0.6rem 1.4rem;
  background: var(--purple-accent);
  color: white;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.25s ease;
  box-shadow: 0 4px 14px rgba(155, 89, 182, 0.35);
}
.btn-admin:hover {
  background: #8e4ca8;
  transform: translateY(-2px);
}

/* === Основная сетка === */
.page-layout {
  max-width: 1440px;
  margin: 0 auto;
  padding: 2rem;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2rem;
  position: relative;
  z-index: 1;
}

/* === Стекло === */
.glass-block {
  background: var(--glass-bg);
  backdrop-filter: blur(28px) saturate(1.3);
  -webkit-backdrop-filter: blur(28px) saturate(1.3);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-glass);
}

/* === Левое меню === */
.sidebar {
  align-self: start;
  position: sticky;
  top: 90px;
}
.sidebar .glass-block {
  background: rgba(255, 255, 255, 0.025);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 1.4rem 1.2rem;
  box-shadow: none;
}
.menu {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.menu-item {
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.8rem 1.1rem;
  border: 1px solid transparent;
  border-radius: 14px;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-size: 0.95rem;
}
.menu-item:hover, .menu-item.active {
  background: rgba(155, 89, 182, 0.14);
  border-color: rgba(155, 89, 182, 0.4);
  color: var(--purple-accent);
  box-shadow: 0 0 16px rgba(155, 89, 182, 0.22);
  transform: translateX(4px);
}

/* === Пункт «Трансляции» === */
.menu-item-live {
  display: flex;
  align-items: center;
  gap: 8px;
}
.menu-item-live .live-dot {
  width: 10px;
  height: 10px;
  background-color: #ff4757;
  border: 2px solid rgba(255, 71, 87, 0.5);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(255, 71, 87, 0.7);
  animation: pulse-dot 1.5s infinite ease-in-out;
  flex-shrink: 0;
}
@keyframes pulse-dot {
  0% { transform: scale(0.9); opacity: 0.7; box-shadow: 0 0 6px rgba(255, 71, 87, 0.5); }
  50% { transform: scale(1.15); opacity: 1; box-shadow: 0 0 14px rgba(255, 71, 87, 0.9); }
  100% { transform: scale(0.9); opacity: 0.7; box-shadow: 0 0 6px rgba(255, 71, 87, 0.5); }
}

/* === Центральная область === */
.main-area {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* === Авторизация, профиль === */
.top-bar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.auth-buttons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.btn-auth {
  padding: 0.5rem 1.2rem;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  font-family: inherit;
  transition: all 0.25s ease;
}
.btn-auth:hover {
  background: rgba(155, 89, 182, 0.14);
  border: 1px solid rgba(155, 89, 182, 0.35);
  color: var(--purple-accent);
  box-shadow: 0 0 12px rgba(155, 89, 182, 0.2);
}
.profile-block {
  position: relative;
  display: none;
}
.profile-block.active {
  display: flex;
}
.profile-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.8rem;
  border: 1px solid transparent;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.25s ease;
}
.profile-header:hover {
  background: rgba(155, 89, 182, 0.14);
  border: 1px solid rgba(155, 89, 182, 0.35);
}
.profile-header:hover .profile-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.profile-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(155, 89, 182, 0.35);
  flex-shrink: 0;
  min-width: 34px;
}
.profile-name {
  color: #fff;
  font-size: 0.9rem;
  font-weight: 500;
}
.profile-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 200px;
  background: rgba(14, 22, 40, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(155, 89, 182, 0.2);
  border-radius: 16px;
  padding: 0.5rem;
  margin-top: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.25s ease;
  z-index: 100;
}
.profile-dropdown-item {
  display: block;
  width: 100%;
  padding: 0.6rem 1rem;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: #ccc;
  cursor: pointer;
  font-size: 0.9rem;
  font-family: inherit;
  text-align: left;
  transition: all 0.25s ease;
}
.profile-dropdown-item:hover {
  background: rgba(155, 89, 182, 0.14);
  border: 1px solid rgba(155, 89, 182, 0.3);
  color: var(--purple-accent);
}

/* === Модальные окна (общие) === */
.auth-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.auth-modal.open {
  display: flex;
}
.auth-modal-content {
  background: rgba(16, 24, 42, 0.85);
  backdrop-filter: blur(32px) saturate(1.4);
  -webkit-backdrop-filter: blur(32px) saturate(1.4);
  border: 1px solid rgba(155, 89, 182, 0.2);
  border-radius: 22px;
  padding: 2.2rem;
  width: 90%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  position: relative;
}
.auth-modal-content h3 {
  color: #fff;
  margin-bottom: 1.5rem;
  text-align: center;
  font-size: 1.4rem;
}
.form-group { margin-bottom: 1rem; }
.form-label {
  display: block;
  color: #ccc;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
}
.form-input {
  width: 100%;
  padding: 0.65rem 0.9rem;
  background: rgba(8, 14, 28, 0.7);
  border: 1px solid rgba(155, 89, 182, 0.15);
  border-radius: 12px;
  color: #fff;
  font-size: 0.95rem;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.form-input:focus {
  outline: none;
  border-color: rgba(155, 89, 182, 0.5);
  box-shadow: 0 0 12px rgba(155, 89, 182, 0.2);
}
.form-file {
  width: 100%;
  padding: 0.45rem;
  background: rgba(8, 14, 28, 0.7);
  border: 1px solid rgba(155, 89, 182, 0.15);
  border-radius: 12px;
  color: #ccc;
  font-size: 0.85rem;
  box-sizing: border-box;
}
.btn-primary {
  width: 100%;
  padding: 0.75rem;
  background: rgba(155, 89, 182, 0.25);
  border: 1px solid rgba(155, 89, 182, 0.45);
  border-radius: 12px;
  color: #fff;
  font-size: 0.95rem;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  transition: all 0.25s ease;
}
.btn-primary:hover {
  background: rgba(155, 89, 182, 0.4);
  box-shadow: 0 0 18px rgba(155, 89, 182, 0.35);
}
.btn-cancel {
  margin-top: 0.75rem;
  width: 100%;
  background: transparent;
  color: #888;
  border: none;
  cursor: pointer;
  padding: 0.6rem;
  font-family: inherit;
  font-size: 0.9rem;
}
.btn-cancel:hover { color: #aaa; }
.auth-error {
  color: #e74c3c;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
  display: none;
}
.modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  background: transparent;
  color: #888;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  z-index: 10;
}
.modal-close-btn:hover {
  background: rgba(231, 76, 60, 0.15);
  border-color: rgba(231, 76, 60, 0.3);
  color: #e74c3c;
}
.edit-profile-header { text-align: center; margin-bottom: 1.5rem; }
.edit-profile-nickname { color: #fff; font-size: 1.15rem; font-weight: 600; margin-bottom: 1rem; }
.edit-profile-avatar-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.edit-profile-avatar-preview {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(155, 89, 182, 0.3);
  background: #2a3650;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}
.edit-profile-avatar-hint {
  color: #666;
  font-size: 0.78rem;
  text-align: center;
  margin-bottom: 1.5rem;
  line-height: 1.4;
}

/* === Поиск === */
.search-container {
  position: relative;
  flex: 1;
  max-width: 420px;
  margin: 0 2rem;
}
.search-box {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1.5px solid rgba(155, 89, 182, 0.45);
  border-radius: 9999px;
  padding: 0.5rem 1.1rem;
  box-shadow: 0 0 10px rgba(155, 89, 182, 0.18);
  transition: all 0.25s ease;
}
.search-box:focus-within {
  border-color: var(--purple-accent);
  box-shadow: 0 0 18px rgba(155, 89, 182, 0.4);
  background: rgba(255, 255, 255, 0.06);
}
.search-icon {
  color: rgba(155, 89, 182, 0.8);
  margin-right: 0.55rem;
  flex-shrink: 0;
}
#globalSearch {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  width: 100%;
  font-size: 0.9rem;
  font-family: inherit;
}
#globalSearch::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}
.search-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  background: rgba(14, 22, 40, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(155, 89, 182, 0.22);
  border-radius: 16px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  overflow: hidden;
  max-height: 400px;
  overflow-y: auto;
}
.search-result-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: all 0.2s ease;
}
.search-result-item:hover { background: rgba(155, 89, 182, 0.14); }
.search-result-item:last-child { border-bottom: none; }
.search-result-thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}
.search-result-thumb-vinyl {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #1e2940, #14203a);
}
.search-result-thumb-vinyl::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, #1a1a2e 0%, #16213e 30%, #0f0f1a 60%, #0a0a12 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}
.search-result-thumb-vinyl::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 22%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple-accent), #6c3483);
  box-shadow: 0 0 8px rgba(155, 89, 182, 0.4);
}
.search-result-artist {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-result-title {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.15rem;
}
.search-no-results {
  padding: 1.2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.search-dropdown::-webkit-scrollbar { width: 6px; }
.search-dropdown::-webkit-scrollbar-track { background: transparent; }
.search-dropdown::-webkit-scrollbar-thumb {
  background: rgba(155, 89, 182, 0.3);
  border-radius: 3px;
}

/* === Футер === */
.footer-bar {
  grid-column: 1 / -1;
  width: 100%;
  margin: 2rem 0 0;
  padding: 0.8rem 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(18, 26, 44, 0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1.5px solid rgba(155, 89, 182, 0.4);
  border-radius: 9999px;
  box-shadow: 0 0 18px rgba(155, 89, 182, 0.4), 0 0 10px rgba(155, 89, 182, 0.2);
}
.footer-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}
.footer-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 0 8px rgba(155, 89, 182, 0.5);
}
.footer-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--purple-accent);
  text-decoration: none;
  transition: color 0.25s ease, text-shadow 0.25s ease;
}
.footer-link:hover {
  color: #b370c7;
  text-shadow: 0 0 12px rgba(155, 89, 182, 0.7);
}

/* === Онлайн-счётчик === */
.online-number {
  display: inline-block;
  font-weight: 700;
  color: var(--purple-accent);
  text-shadow: 0 0 10px rgba(155, 89, 182, 0.5);
  font-size: 1.1rem;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.02); }
  100% { opacity: 1; transform: scale(1); }
}

/* ============================================== */
/* === СТИЛИ ФИЛЬМОВ === */
/* ============================================== */

/* === Заголовок секции === */
.film-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
}
.film-section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}

/* === Сетка фильмов === */
.films-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.4rem;
  margin-bottom: 2rem;
}
.films-loader {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.films-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* === Карточка фильма === */
.film-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  cursor: pointer;
  transition: transform 0.3s ease;
}
.film-card:hover {
  transform: translateY(-6px);
}

.film-cover-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, #1e2940, #14203a);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: box-shadow 0.35s ease, border-color 0.35s ease;
}
.film-card:hover .film-cover-wrap {
  box-shadow: 0 0 24px rgba(155, 89, 182, 0.35);
  border-color: rgba(155, 89, 182, 0.3);
}
.film-cover-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: filter 0.35s ease, transform 0.35s ease;
  filter: brightness(0.85);
}
.film-card:hover .film-cover-wrap img {
  filter: brightness(1.1) saturate(1.15);
  transform: scale(1.05);
}
.film-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e2940, #14203a);
}
.film-cover-placeholder svg {
  width: 48px;
  height: 48px;
  color: rgba(155, 89, 182, 0.4);
}

.film-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
  background: rgba(0, 0, 0, 0.35);
}
.film-card:hover .film-play-overlay {
  opacity: 1;
}
.film-play-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--purple-accent);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(155, 89, 182, 0.55);
  transition: transform 0.2s ease;
}
.film-play-btn:hover {
  transform: scale(1.12);
}
.film-play-btn svg {
  width: 24px;
  height: 24px;
  fill: #fff;
  margin-left: 3px;
}

/* === Кнопки админа на карточке фильма === */
.film-card-admin-btns {
  position: absolute;
  top: 8px;
  right: 8px;
  display: none;
  gap: 0.4rem;
  z-index: 5;
}
.film-card.show-admin .film-card-admin-btns {
  display: flex;
}
.film-card-admin-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  opacity: 0.85;
}
.film-card-admin-btn.edit {
  background: rgba(155, 89, 182, 0.7);
  color: #fff;
}
.film-card-admin-btn.edit:hover {
  background: rgba(155, 89, 182, 1);
  opacity: 1;
  box-shadow: 0 0 12px rgba(155, 89, 182, 0.5);
}
.film-card-admin-btn.delete {
  background: rgba(231, 76, 60, 0.7);
  color: #fff;
}
.film-card-admin-btn.delete:hover {
  background: rgba(231, 76, 60, 1);
  opacity: 1;
  box-shadow: 0 0 12px rgba(231, 76, 60, 0.5);
}

/* === Инфо карточки === */
.film-card-info h3 {
  font-size: 0.95rem;
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.25s ease;
}
.film-card:hover .film-card-info h3 {
  color: var(--purple-accent);
}
.film-card-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

/* === Карточка добавления === */
.film-add-card {
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.3s ease;
}
.film-add-card:hover {
  transform: translateY(-6px);
}
.film-add-card-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  border: 2px dashed rgba(155, 89, 182, 0.3);
  background: rgba(155, 89, 182, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
.film-add-card:hover .film-add-card-cover {
  border-color: rgba(155, 89, 182, 0.6);
  background: rgba(155, 89, 182, 0.1);
  box-shadow: 0 0 24px rgba(155, 89, 182, 0.25);
}
.film-add-card-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(155, 89, 182, 0.15);
  border: 2px solid rgba(155, 89, 182, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--purple-accent);
  transition: all 0.3s ease;
}
.film-add-card:hover .film-add-card-icon {
  background: rgba(155, 89, 182, 0.3);
  border-color: var(--purple-accent);
  color: #fff;
  box-shadow: 0 0 20px rgba(155, 89, 182, 0.4);
  transform: scale(1.1);
}
.film-add-card-info {
  padding-top: 0.6rem;
  text-align: center;
}
.film-add-card-info span {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.25s ease;
}
.film-add-card:hover .film-add-card-info span {
  color: var(--purple-accent);
}

/* === Модалка добавления/редактирования === */
.film-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.film-modal.open {
  display: flex;
}
.film-modal-content {
  background: rgba(16, 24, 42, 0.9);
  backdrop-filter: blur(32px) saturate(1.4);
  -webkit-backdrop-filter: blur(32px) saturate(1.4);
  border: 1px solid rgba(155, 89, 182, 0.2);
  border-radius: 22px;
  padding: 2.2rem;
  width: 90%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  position: relative;
}
.film-modal-content h3 {
  color: #fff;
  margin-bottom: 1.5rem;
  text-align: center;
  font-size: 1.4rem;
}
.film-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  background: transparent;
  color: #888;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  z-index: 10;
}
.film-modal-close:hover {
  background: rgba(231, 76, 60, 0.15);
  border-color: rgba(231, 76, 60, 0.3);
  color: #e74c3c;
}

/* === Форма фильма === */
.film-form-group { margin-bottom: 1rem; }
.film-form-label {
  display: block;
  color: #ccc;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
}
.film-form-input {
  width: 100%;
  padding: 0.65rem 0.9rem;
  background: rgba(8, 14, 28, 0.7);
  border: 1px solid rgba(155, 89, 182, 0.15);
  border-radius: 12px;
  color: #fff;
  font-size: 0.95rem;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.film-form-input:focus {
  outline: none;
  border-color: rgba(155, 89, 182, 0.5);
  box-shadow: 0 0 12px rgba(155, 89, 182, 0.2);
}
.film-form-textarea {
  resize: vertical;
  min-height: 70px;
}

/* === Зона перетаскивания файлов === */
.film-file-zone {
  width: 100%;
  padding: 1.5rem 1rem;
  background: rgba(8, 14, 28, 0.5);
  border: 2px dashed rgba(155, 89, 182, 0.25);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: center;
}
.film-file-zone:hover,
.film-file-zone.dragover {
  border-color: rgba(155, 89, 182, 0.6);
  background: rgba(155, 89, 182, 0.06);
  box-shadow: 0 0 16px rgba(155, 89, 182, 0.15);
}
.film-file-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.film-file-text svg {
  color: rgba(155, 89, 182, 0.5);
}
.film-file-zone.has-file {
  border-color: rgba(46, 204, 113, 0.4);
  border-style: solid;
}
.film-file-zone.has-file .film-file-text span {
  color: #2ecc71;
}

/* === Превью обложки === */
.film-cover-preview {
  position: relative;
  margin-top: 0.6rem;
  width: 160px;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(155, 89, 182, 0.25);
}
.film-cover-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.film-cover-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(231, 76, 60, 0.8);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}
.film-cover-remove:hover {
  background: rgba(231, 76, 60, 1);
}

/* === Прогресс загрузки === */
.film-upload-progress {
  margin: 1rem 0;
}
.film-progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}
.film-progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}
.film-progress-fill {
  height: 100%;
  background: var(--purple-accent);
  border-radius: 4px;
  width: 0%;
  transition: width 0.2s ease;
  box-shadow: 0 0 8px rgba(155, 89, 182, 0.5);
}

/* === Кнопки формы === */
.film-btn-primary {
  width: 100%;
  padding: 0.75rem;
  background: rgba(155, 89, 182, 0.25);
  border: 1px solid rgba(155, 89, 182, 0.45);
  border-radius: 12px;
  color: #fff;
  font-size: 0.95rem;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  transition: all 0.25s ease;
  margin-top: 0.5rem;
}
.film-btn-primary:hover {
  background: rgba(155, 89, 182, 0.4);
  box-shadow: 0 0 18px rgba(155, 89, 182, 0.35);
}
.film-btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.film-btn-cancel {
  margin-top: 0.6rem;
  width: 100%;
  background: transparent;
  color: #888;
  border: none;
  cursor: pointer;
  padding: 0.6rem;
  font-family: inherit;
  font-size: 0.9rem;
}
.film-btn-cancel:hover { color: #aaa; }

/* === Модалка плеера === */
.film-player-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 999;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.film-player-modal.open {
  display: flex;
}
.film-player-container {
  width: 100%;
  max-width: 1100px;
  position: relative;
}
.film-player-close {
  position: absolute;
  top: -50px;
  right: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(155, 89, 182, 0.2);
  border: 1px solid rgba(155, 89, 182, 0.4);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  z-index: 10;
}
.film-player-close:hover {
  background: rgba(231, 76, 60, 0.3);
  border-color: rgba(231, 76, 60, 0.5);
  transform: rotate(90deg);
}
.film-player-container video {
  width: 100%;
  max-height: 70vh;
  border-radius: 14px;
  background: #000;
  border: 1px solid rgba(155, 89, 182, 0.2);
  box-shadow: 0 12px 50px rgba(0, 0, 0, 0.6);
}
.film-player-info {
  margin-top: 1.2rem;
}
.film-player-info h3 {
  color: #fff;
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.film-player-info p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* === Контекстное меню === */
.film-context-overlay {
  position: fixed;
  inset: 0;
  z-index: 998;
  display: none;
}
.film-context-overlay.active {
  display: block;
}
.film-context-menu {
  position: fixed;
  display: none;
  flex-direction: column;
  background: rgba(14, 22, 40, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(155, 89, 182, 0.2);
  border-radius: 14px;
  padding: 0.4rem;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
  z-index: 999;
  min-width: 180px;
}
.film-context-menu.active {
  display: flex;
}
.film-context-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1rem;
  border-radius: 10px;
  color: #ccc;
  cursor: pointer;
  font-size: 0.9rem;
  font-family: inherit;
  transition: all 0.2s ease;
}
.film-context-item:hover {
  background: rgba(155, 89, 182, 0.14);
  color: var(--purple-accent);
}
.film-context-item.danger:hover {
  background: rgba(231, 76, 60, 0.14);
  color: #e74c3c;
}

/* === Адаптив === */
@media (max-width: 900px) {
  .page-layout {
    grid-template-columns: 1fr;
    padding: 1rem;
    gap: 1.2rem;
  }
  .top-bar { padding: 0.8rem 1rem; }
  .search-container { display: none; }
  .sidebar { position: static; }
  .films-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
  }
  .film-modal-content {
    padding: 1.6rem;
    max-height: 95vh;
  }
  .film-player-modal { padding: 0; }
  .film-player-container { max-width: 100%; }
  .film-player-container video {
    max-height: 60vh;
    border-radius: 0;
  }
  .film-player-close {
    top: 10px;
    right: 10px;
  }
  .film-player-info { padding: 0 1rem; }
  body { padding-bottom: 90px; }
}

@media (max-width: 500px) {
  .films-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
  }
  .film-card-info h3 { font-size: 0.85rem; }
  .film-card-info p {
    font-size: 0.72rem;
    -webkit-line-clamp: 1;
  }
  .film-add-card-icon {
    width: 44px;
    height: 44px;
  }
  .film-add-card-info span {
    font-size: 0.8rem;
  }
  .film-card-admin-btn {
    width: 30px;
    height: 30px;
  }
  .film-card-admin-btn svg {
    width: 14px;
    height: 14px;
  }
}
