﻿:root {
  --bg: #0b0f15;
  --bg-alt: #121925;
  --ink: #e8eefc;
  --muted: #9aa9c3;
  --panel: rgba(21, 29, 42, 0.9);
  --line: #2b3950;
  --accent: #ff9b54;
  --accent-2: #3f8cff;
  --danger: #ef4444;
  --surface-1: rgba(15, 22, 33, 0.92);
  --surface-2: rgba(19, 27, 40, 0.9);
  --shadow: 0 18px 34px rgba(2, 4, 9, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 10%, rgba(255, 155, 84, 0.18) 0%, transparent 38%),
    radial-gradient(circle at 88% 82%, rgba(63, 140, 255, 0.2) 0%, transparent 42%),
    linear-gradient(130deg, var(--bg) 0%, var(--bg-alt) 100%);
  color: var(--ink);
  font-family: "Manrope", "Segoe UI", sans-serif;
}

body.modal-open {
  overflow: hidden;
}

.bg-shape {
  position: fixed;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(20px);
  opacity: 0.28;
  z-index: 0;
}

.bg-one {
  width: 320px;
  height: 320px;
  right: -90px;
  top: 170px;
  background: #ff9b54;
  animation: floaty 14s ease-in-out infinite;
}

.bg-two {
  width: 280px;
  height: 280px;
  left: -100px;
  bottom: -20px;
  background: #3f8cff;
  animation: floaty 16s ease-in-out infinite reverse;
}

@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(4deg); }
}

.brand-bar,
.layout,
.toast,
.invite-banner {
  position: relative;
  z-index: 2;
}

.brand-bar {
  padding: 20px 24px 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid rgba(43, 57, 80, 0.6);
  margin-bottom: 4px;
}

.brand-title {
  font-family: "Sora", sans-serif;
  font-weight: 800;
  font-size: clamp(1.9rem, 2.8vw, 2.5rem);
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, #ff9b54 0%, #ffce8a 45%, #7eb8ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-subtitle {
  grid-column: 1 / 2;
  color: var(--muted);
}

.header-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.auth-badge {
  padding: 8px 12px;
  background: rgba(31, 42, 60, 0.75);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
}

.layout {
  padding: 0 24px 24px;
}

.invite-banner {
  margin: 0 24px 16px;
  padding: 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  background: rgba(28, 38, 54, 0.92);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

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

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(2px);
}

.auth-panel {
  padding: 22px;
  animation: rise 0.45s ease-out;
  max-width: 500px;
  margin: 0 auto;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}

.form-card {
  display: grid;
  gap: 8px;
}

h2, h3 {
  margin: 0;
}

.muted {
  color: var(--muted);
}

label {
  font-size: 0.85rem;
  color: var(--muted);
}

input,
textarea,
button {
  font: inherit;
}

input,
textarea {
  border: 1px solid #3a475f;
  background: #0f1623;
  color: var(--ink);
  border-radius: 10px;
  padding: 10px 12px;
}

input::placeholder,
textarea::placeholder {
  color: #7989a3;
}

textarea {
  min-height: 70px;
  resize: vertical;
}

button {
  border: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 10px 18px rgba(7, 12, 22, 0.5);
}

.ghost-btn {
  background: #1c2638;
  color: var(--ink);
  border: 1px solid #3a4861;
  box-shadow: none;
}

.danger-btn {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.app-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 16px;
  animation: rise 0.45s ease-out;
}

.sidebar {
  padding: 14px;
  display: grid;
  gap: 12px;
  align-content: start;
}

.sidebar-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.inline-form {
  display: grid;
  gap: 8px;
}

.group-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.group-item {
  border: 1px solid #3a4861;
  border-radius: 10px;
  padding: 10px;
  background: #152034;
  cursor: pointer;
  transition: border-color 120ms ease, transform 120ms ease, background-color 120ms ease;
}

.group-item:hover,
.group-item.active {
  border-color: var(--accent-2);
  background: #1a2942;
  transform: translateX(2px);
}

.workspace {
  padding: 16px;
  min-height: 70vh;
}

.empty-state {
  border: 1px dashed #40506a;
  border-radius: 14px;
  padding: 28px;
  text-align: center;
  background: rgba(16, 22, 33, 0.58);
}

.workspace-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.workspace-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.stack-grid {
  margin: 14px 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.mini-form {
  display: grid;
  gap: 8px;
}

.section-title {
  margin: 12px 0 10px;
}

.collapsible > .collapse-summary,
.collapsible-block .collapse-summary {
  list-style: none;
  cursor: pointer;
  font-family: "Sora", sans-serif;
  font-weight: 700;
  font-size: 1rem;
}

.collapsible > .collapse-summary::-webkit-details-marker,
.collapsible-block .collapse-summary::-webkit-details-marker {
  display: none;
}

.collapsible > .collapse-summary::after,
.collapsible-block .collapse-summary::after {
  content: "▾";
  float: right;
  color: var(--muted);
}

.collapsible:not([open]) > .collapse-summary::after,
.collapsible-block details:not([open]) > .collapse-summary::after {
  content: "▸";
}

.collapsible-block details {
  border: 1px solid #344359;
  border-radius: 12px;
  background: #121d2f;
  padding: 10px;
}

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

/* ─── Collapsible movie card ────────────────────────────── */
.movie-card {
  border: 1px solid #334258;
  border-radius: 14px;
  background: var(--surface-1);
  overflow: hidden;
  transition: border-color 150ms ease;
}

.movie-card[open] {
  border-color: #4a6080;
}

.movie-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 10px 10px;
  user-select: none;
}

.movie-summary::-webkit-details-marker {
  display: none;
}

.movie-card[open] > .movie-summary {
  border-bottom: 1px solid #2e3f57;
}

.poster-thumb {
  width: 64px;
  height: 95px;
  border-radius: 8px;
  object-fit: cover;
  background: #1e293b;
  flex-shrink: 0;
}

.movie-summary-body {
  flex: 1;
  min-width: 0;
}

.movie-summary-top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 8px;
}

.movie-title {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
}

.movie-summary-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  margin-top: 6px;
}

.movie-chevron {
  color: var(--muted);
  font-size: 1rem;
  flex-shrink: 0;
  transition: transform 200ms ease;
}

.movie-card[open] .movie-chevron {
  transform: rotate(180deg);
}

.movie-expanded {
  padding: 14px;
  display: grid;
  gap: 12px;
}

.logo {
  max-height: 32px;
  max-width: 140px;
  object-fit: contain;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 6px 0 2px;
}

.movie-summary .chips {
  margin: 4px 0 0;
}

.chip {
  border-radius: 999px;
  border: 1px solid #42536f;
  padding: 3px 8px;
  font-size: 0.8rem;
  background: #1a2538;
}

.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.92rem;
}

.forms-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.admin-actions {
  margin-top: 8px;
}

.inline-edit {
  display: grid;
  gap: 6px;
  border: 1px solid #3a4962;
  border-radius: 10px;
  padding: 8px;
  background: #111a2b;
}

.danger-zone {
  align-content: start;
}

.people-list {
  margin-top: 8px;
  font-size: 0.86rem;
  color: #b8c2d4;
  display: grid;
  gap: 2px;
}

.not-rated-list {
  font-size: 0.84rem;
  color: #b8c2d4;
  margin-top: 2px;
}

.review-list-wrap {
  margin-top: 10px;
  border: 1px solid #3a4b64;
  border-radius: 12px;
  padding: 10px;
  background: #101a2b;
}

.review-list-title {
  font-family: "Sora", sans-serif;
  font-size: 1rem;
  margin-bottom: 8px;
}

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

.review-item {
  border: 1px solid #46597a;
  border-radius: 10px;
  padding: 10px;
  background: #162338;
}

.review-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}

.review-author {
  font-weight: 800;
  color: #ffc58a;
}

.review-time {
  font-size: 0.78rem;
  color: var(--muted);
}

.review-body {
  font-size: 0.95rem;
  line-height: 1.45;
  color: #dbe8ff;
}

.review-flag {
  margin-top: 8px;
  display: inline-block;
  border: 1px solid #ffb25c;
  background: rgba(255, 155, 84, 0.14);
  color: #ffd4a2;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.76rem;
  font-weight: 700;
}

.review-empty {
  color: var(--muted);
  font-size: 0.88rem;
}

.sidebar-section {
  display: grid;
  gap: 8px;
}

.sidebar-headline {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.collapsible .sidebar-headline {
  justify-content: flex-end;
}

.notification-list,
.feed-list {
  display: grid;
  gap: 8px;
}

.notice-item,
.feed-item {
  border: 1px solid #344359;
  border-radius: 10px;
  background: #141f31;
  padding: 8px;
}

.notice-item.unread {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(255, 155, 84, 0.25);
}

.notice-item .meta,
.feed-item .meta {
  color: var(--muted);
  font-size: 0.8rem;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 16px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 8, 14, 0.74);
}

.modal-card {
  position: relative;
  width: min(980px, 100%);
  max-height: 90vh;
  overflow: auto;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.friends-list {
  margin-top: 6px;
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
}

.friend-item {
  border: 1px solid #3b4a63;
  border-radius: 10px;
  background: #111c2e;
  padding: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.friend-item .meta {
  color: var(--muted);
  font-size: 0.8rem;
}

.remove-friend-btn {
  min-width: 90px;
  padding: 8px 10px;
}

.hidden {
  display: none !important;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: #0b1320;
  color: var(--ink);
  border: 1px solid #3a4861;
  padding: 10px 14px;
  border-radius: 10px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4);
}

/* ─── Auth tabs ─────────────────────────────────────────── */
.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.auth-tab {
  background: #1c2638;
  color: var(--muted);
  border: 1px solid #3a4861;
  box-shadow: none;
  flex: 1;
  font-weight: 700;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}

.auth-tab.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border-color: transparent;
}

/* ─── Button loading spinner ────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }

.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
  opacity: 0.8;
}

.btn-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* ─── Rating score colours ──────────────────────────────── */
.score-high { color: #4ade80; font-weight: 700; }
.score-mid  { color: #facc15; font-weight: 700; }
.score-low  { color: #f87171; font-weight: 700; }
.score-none { color: var(--muted); }

/* ─── Rated badge ───────────────────────────────────────── */
.rated-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  background: rgba(63, 140, 255, 0.12);
  border: 1px solid rgba(63, 140, 255, 0.3);
  color: var(--accent-2);
  font-weight: 600;
}

/* ─── Focus ring ────────────────────────────────────────── */
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 1px;
  border-color: var(--accent-2);
}

/* ─── Sync status ───────────────────────────────────────── */
.sync-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sync-status {
  font-size: 0.74rem;
  color: var(--muted);
}

/* ─── Icon button ───────────────────────────────────────── */
.icon-btn {
  padding: 5px 9px;
  font-size: 1rem;
  line-height: 1;
}

/* ─── Movies header + sort row ──────────────────────────── */
.movies-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 10px;
}

.movies-header .section-title {
  margin: 0;
}

.sort-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.sort-label {
  font-size: 0.82rem;
}

.sort-btn {
  background: #1c2638;
  color: var(--muted);
  border: 1px solid #3a4861;
  box-shadow: none;
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}

.sort-btn.active {
  background: rgba(63, 140, 255, 0.16);
  color: var(--accent-2);
  border-color: rgba(63, 140, 255, 0.45);
}

/* ─── Invite URL callout ────────────────────────────────── */
.invite-url-callout {
  margin: 10px 0 14px;
  border: 1px solid rgba(63, 140, 255, 0.38);
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(63, 140, 255, 0.07);
  display: grid;
  gap: 8px;
}

.invite-url-label {
  font-size: 0.85rem;
  color: var(--accent-2);
  font-weight: 700;
}

.invite-url-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

/* ─── Sidebar divider ───────────────────────────────────── */
.sidebar-divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: 8px 0;
}

/* ─── Notification count badge ──────────────────────────── */
.notif-count {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 0.7rem;
  font-weight: 700;
  margin-left: 6px;
  vertical-align: middle;
  line-height: 1.5;
}

/* ─── Role badges ───────────────────────────────────────── */
.role-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  vertical-align: middle;
  margin-left: 6px;
}

.role-owner {
  background: rgba(255, 155, 84, 0.18);
  border: 1px solid rgba(255, 155, 84, 0.4);
  color: #ff9b54;
}

.role-admin {
  background: rgba(63, 140, 255, 0.14);
  border: 1px solid rgba(63, 140, 255, 0.35);
  color: var(--accent-2);
}

.role-member {
  background: rgba(154, 169, 195, 0.1);
  border: 1px solid rgba(154, 169, 195, 0.25);
  color: var(--muted);
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .brand-bar {
    grid-template-columns: 1fr;
  }

  .header-actions {
    justify-self: start;
    justify-content: flex-start;
  }

  .workspace-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .stack-grid,
  .forms-row,
  .auth-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .invite-banner {
    margin: 0 12px 12px;
    flex-direction: column;
    align-items: stretch;
  }

  .movie-summary {
    gap: 10px;
    padding: 8px 10px 8px 8px;
  }

  .poster-thumb {
    width: 52px;
    height: 77px;
  }
}
