@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --purple: #8C63FF;
  --violet: #BB5CF6;
  --navy: #1A1A2E;
  --dark: #0F0F17;
  --white: #FFFFFF;
  --green: #22C55E;
  --text-dim: #9A9AB0;
  --border: rgba(255,255,255,0.08);
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--dark);
  color: var(--white);
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 400;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

h1, h2, h3 { font-weight: 700; margin: 0 0 8px; }
p { color: var(--text-dim); margin: 0 0 12px; }

.gradient-text {
  background: linear-gradient(90deg, var(--purple), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: opacity .15s ease;
}
.btn:hover { opacity: 0.88; }
.btn-primary {
  background: linear-gradient(90deg, var(--purple), var(--violet));
  color: var(--white);
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--white);
}
.btn-full { width: 100%; }
.btn-danger { background: #E5484D; color: var(--white); }

.input-group { margin-bottom: 16px; }
.input-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text-dim);
}
.input-group input, .input-group textarea, .input-group select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--navy);
  color: var(--white);
  font-family: inherit;
  font-size: 14px;
}
.input-group input:focus, .input-group textarea:focus {
  outline: 2px solid var(--purple);
  outline-offset: 1px;
}

.card {
  background: var(--navy);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ---------- Auth (splash / login / register) ---------- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-box { width: 100%; max-width: 420px; }
.auth-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; font-size: 20px; font-weight: 700; }
.auth-logo .dot {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--violet));
  display: flex; align-items: center; justify-content: center;
}
.auth-divider { text-align: center; color: var(--text-dim); font-size: 13px; margin: 18px 0; }
.auth-alt { display: flex; flex-direction: column; gap: 10px; }
.auth-footer { text-align: center; margin-top: 20px; font-size: 14px; color: var(--text-dim); }
.auth-footer a { color: var(--purple); font-weight: 600; }

/* ---------- App shell (sidebar + main) ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px;
  background: var(--navy);
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-logo { display: flex; align-items: center; gap: 10px; font-weight: 700; padding: 0 8px 24px; }
.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: 10px;
  color: var(--text-dim); font-size: 14px; font-weight: 500;
  margin-bottom: 2px;
}
.nav-link.active { background: linear-gradient(90deg, var(--purple), var(--violet)); color: var(--white); }
.sidebar-footer {
  margin-top: auto; display: flex; align-items: center; gap: 10px;
  padding: 10px 8px; border-top: 1px solid var(--border);
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); display: inline-block; }

.main { flex: 1; padding: 24px 28px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; gap: 12px; }
.search-input {
  flex: 1; max-width: 420px; padding: 10px 14px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--navy); color: var(--white);
}

/* ---------- Movie grids ---------- */
.movie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
}
.movie-card { cursor: pointer; }
.movie-card img { border-radius: 10px; aspect-ratio: 2/3; object-fit: cover; margin-bottom: 8px; }
.movie-card .title { font-size: 14px; font-weight: 600; }
.movie-card .meta { font-size: 12px; color: var(--text-dim); }

.hero-banner {
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  min-height: 320px;
  display: flex;
  align-items: flex-end;
  padding: 28px;
  background-size: cover;
  background-position: center;
  margin-bottom: 28px;
}
.hero-banner::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(15,15,23,0.95) 10%, rgba(15,15,23,0.2) 80%);
}
.hero-content { position: relative; max-width: 520px; }

/* ---------- Watch room ---------- */
.watch-layout { display: flex; gap: 20px; height: calc(100vh - 48px); }
.player-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.video-wrap { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; flex: 1; }
.video-wrap video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.player-controls {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 14px 18px; background: linear-gradient(0deg, rgba(0,0,0,.75), transparent);
  display: flex; align-items: center; gap: 14px; color: var(--white);
}
.player-controls .seek { flex: 1; }
.admin-badge {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  background: var(--purple); padding: 3px 8px; border-radius: 6px;
}

.chat-col {
  width: 320px; flex-shrink: 0; background: var(--navy);
  border: 1px solid var(--border); border-radius: var(--radius);
  display: flex; flex-direction: column; overflow: hidden;
}
.chat-header { padding: 14px 16px; border-bottom: 1px solid var(--border); font-weight: 600; }
.chat-messages { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.chat-msg .name { font-size: 12px; font-weight: 600; color: var(--violet); }
.chat-msg .time { font-size: 10px; color: var(--text-dim); margin-left: 6px; }
.chat-msg .body { font-size: 14px; }
.chat-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); }
.chat-input input { flex: 1; padding: 10px 12px; border-radius: 20px; border: 1px solid var(--border); background: var(--dark); color: var(--white); }
.chat-input button {
  width: 40px; height: 40px; border-radius: 50%; border: none;
  background: linear-gradient(135deg, var(--purple), var(--violet)); color: var(--white); cursor: pointer;
}

.badge-online { color: var(--green); font-size: 12px; }
.badge-offline { color: var(--text-dim); font-size: 12px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .watch-layout { flex-direction: column; height: auto; }
  .chat-col { width: 100%; height: 380px; }
  .video-wrap { min-height: 220px; }
}

@media (max-width: 768px) {
  .app-shell { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: fixed; bottom: 0; left: 0; right: 0;
    flex-direction: row; padding: 8px; border-right: none; border-top: 1px solid var(--border);
    z-index: 50; justify-content: space-around;
  }
  .sidebar-logo, .sidebar-footer { display: none; }
  .nav-link { flex-direction: column; gap: 4px; font-size: 10px; padding: 6px; }
  .main { padding: 16px; padding-bottom: 90px; }
  .movie-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
  .hero-banner { min-height: 220px; padding: 18px; }
  .topbar { flex-wrap: wrap; }
}
