/* ============================================================
   CA-Live Stream — Design System
   Blue:    #2663EB  (primary accent, cards, buttons)
   Grey:    #F3F4F6  (backgrounds, borders)
   White:   #FFFFFF  (page bg, cards)
   Fonts:   Pacifico (brand), Poppins 700/900 (headings)
   ============================================================ */

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

:root {
  --blue:         #2663EB;
  --blue-light:   #4F83F0;
  --blue-dark:    #1A4DBD;
  --blue-soft:    #EBF1FD;
  --blue-mid:     #DBEAFE;
  --grey:         #F3F4F6;
  --grey-mid:     #E5E7EB;
  --grey-border:  #D1D5DB;
  --grey-dark:    #9CA3AF;
  --white:        #FFFFFF;
  --text-main:    #111827;
  --text-muted:   #6B7280;
  --text-dim:     #9CA3AF;
  --success:      #10B981;
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
  --shadow:       0 4px 16px rgba(38,99,235,0.10);
  --shadow-lg:    0 8px 32px rgba(38,99,235,0.14);
  --radius:       10px;
  --radius-lg:    14px;
  --border:       1px solid var(--grey-border);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Poppins', sans-serif;
  background: var(--grey);
  color: var(--text-main);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
}

/* ---- Layout ---- */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 256px;
  background: var(--white);
  border-right: var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  box-shadow: var(--shadow-sm);
}

.sidebar-logo {
  padding: 22px 20px 18px;
  border-bottom: var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-logo img { height: 38px; width: auto; object-fit: contain; }
.sidebar-logo .logo-fallback {
  font-family: 'Pacifico', cursive;
  font-size: 20px;
  color: var(--blue);
  line-height: 1;
}
.sidebar-logo .logo-sub {
  font-size: 10px;
  color: var(--text-dim);
  font-weight: 500;
  letter-spacing: 0.3px;
  display: block;
  margin-top: 2px;
}

.sidebar-nav { padding: 16px 10px; flex: 1; }
.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-dim);
  padding: 0 10px;
  margin-bottom: 6px;
  margin-top: 18px;
}
.nav-section-label:first-child { margin-top: 0; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: var(--radius);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.15s;
}
.nav-link:hover { background: var(--grey); color: var(--text-main); }
.nav-link.active { background: var(--blue-soft); color: var(--blue); font-weight: 600; }
.nav-link .icon { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; }

.sidebar-footer {
  padding: 14px;
  border-top: var(--border);
  background: var(--grey);
}
.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  background: var(--white);
  border-radius: var(--radius);
  border: var(--border);
}
.user-avatar {
  width: 30px; height: 30px;
  background: var(--blue);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px; color: var(--white);
  flex-shrink: 0;
}
.user-name { font-size: 13px; font-weight: 600; color: var(--text-main); }
.user-signout { font-size: 11px; color: var(--text-dim); text-decoration: none; }
.user-signout:hover { color: var(--blue); }

/* ---- Main ---- */
.main-content { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--grey); }

.topbar {
  background: var(--white);
  border-bottom: var(--border);
  padding: 0 28px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: var(--shadow-sm);
}
.topbar-title {
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  flex: 1;
}
.topbar-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--grey);
  border: var(--border);
  border-radius: 8px;
  padding: 7px 12px;
  width: 260px;
  transition: border-color 0.15s;
}
.topbar-search:focus-within { border-color: var(--blue); background: var(--white); }
.topbar-search input {
  background: none; border: none; outline: none;
  color: var(--text-main); font-size: 13px; width: 100%;
  font-family: 'Poppins', sans-serif;
}
.topbar-search input::placeholder { color: var(--text-dim); }

.page-body { padding: 28px; flex: 1; }

/* ---- Stream Cards ---- */
.streams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.stream-card {
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
  display: block;
  box-shadow: var(--shadow-sm);
}
.stream-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--blue);
  color: inherit;
}

.card-thumb {
  position: relative;
  aspect-ratio: 16/9;
  background: var(--blue-mid);
  overflow: hidden;
}
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px;
  background: linear-gradient(135deg, var(--blue-soft), var(--blue-mid));
}
.card-badge {
  position: absolute;
  top: 8px; right: 8px;
  background: var(--white);
  border: var(--border);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  color: var(--blue);
  box-shadow: var(--shadow-sm);
}
.card-duration {
  position: absolute;
  bottom: 8px; right: 8px;
  background: rgba(0,0,0,0.65);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  color: #fff;
  font-weight: 600;
}
.play-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(38,99,235,0);
  transition: background 0.18s;
}
.stream-card:hover .play-overlay { background: rgba(38,99,235,0.12); }
.play-btn {
  width: 46px; height: 46px;
  background: var(--blue);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: scale(0.8);
  transition: opacity 0.18s, transform 0.18s;
  box-shadow: 0 4px 12px rgba(38,99,235,0.4);
}
.stream-card:hover .play-btn { opacity: 1; transform: scale(1); }

.card-body { padding: 14px 16px 16px; }
.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}
.card-desc {
  font-size: 12px; color: var(--text-muted);
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
  margin-top: 4px; line-height: 1.5;
}
.card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

.meta-tag {
  background: var(--blue-soft);
  border: 1px solid var(--blue-mid);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 11px;
  color: var(--blue);
  font-weight: 600;
}
.meta-tag.grey {
  background: var(--grey);
  border-color: var(--grey-border);
  color: var(--text-muted);
}
.meta-tag.green {
  background: #ECFDF5;
  border-color: #A7F3D0;
  color: #059669;
}

/* ---- Filters ---- */
.filters-bar {
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 22px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
  box-shadow: var(--shadow-sm);
}
.filter-group { display: flex; flex-direction: column; gap: 4px; }
.filter-label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--text-dim);
}
.filter-select {
  background: var(--grey);
  border: var(--border);
  border-radius: 8px;
  color: var(--text-main);
  padding: 7px 32px 7px 12px;
  font-size: 13px;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239CA3AF' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  min-width: 160px;
  transition: border-color 0.15s;
}
.filter-select:focus { border-color: var(--blue); background-color: var(--white); }

/* ---- Buttons ---- */
.btn {
  padding: 8px 18px;
  border-radius: 8px;
  border: none;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}
.btn-blue {
  background: var(--blue);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(38,99,235,0.25);
}
.btn-blue:hover { background: var(--blue-dark); color: var(--white); }
.btn-outline {
  background: var(--white);
  border: var(--border);
  color: var(--text-muted);
}
.btn-outline:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }

/* ---- Player Page ---- */
.player-layout { display: grid; grid-template-columns: 1fr 320px; gap: 22px; }

.player-container {
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16/9;
  position: relative;
  box-shadow: var(--shadow);
}
.player-container video,
.player-container iframe { width: 100%; height: 100%; display: block; border: none; }

.player-info {
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-top: 16px;
  box-shadow: var(--shadow-sm);
}
.player-title {
  font-size: 20px;
  font-weight: 900;
  color: var(--text-main);
  margin-bottom: 10px;
  line-height: 1.3;
}
.player-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.player-desc { font-size: 14px; color: var(--text-muted); line-height: 1.7; }

.related-panel {
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  height: fit-content;
  position: sticky;
  top: 76px;
  box-shadow: var(--shadow-sm);
}
.related-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.related-item {
  display: flex; gap: 10px; padding: 8px;
  border-radius: var(--radius);
  text-decoration: none; color: inherit;
  margin-bottom: 4px; transition: background 0.15s;
}
.related-item:hover { background: var(--grey); }
.related-thumb {
  width: 80px; height: 48px;
  background: var(--blue-mid);
  border-radius: 6px; overflow: hidden; flex-shrink: 0;
}
.related-thumb img { width: 100%; height: 100%; object-fit: cover; }
.rel-title { font-size: 12px; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--text-main); }
.rel-meta { font-size: 11px; color: var(--text-dim); margin-top: 3px; }

/* ---- Login ---- */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--grey);
  padding: 20px;
}
.login-card {
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow-lg);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo img { height: 48px; margin-bottom: 12px; }
.login-logo .brand {
  font-family: 'Pacifico', cursive;
  font-size: 26px;
  color: var(--blue);
  display: block;
}
.login-logo .tagline { font-size: 13px; color: var(--text-muted); margin-top: 6px; }

.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: 11px; font-weight: 700;
  color: var(--text-muted); margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: 0.6px;
}
.form-control {
  width: 100%;
  background: var(--grey);
  border: var(--border);
  border-radius: 8px;
  color: var(--text-main);
  padding: 10px 14px;
  font-size: 14px;
  font-family: 'Poppins', sans-serif;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.form-control:focus { border-color: var(--blue); background: var(--white); }
.form-control::placeholder { color: var(--text-dim); }

.error-msg {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: #DC2626;
  margin-bottom: 16px;
}

/* ---- Misc ---- */
.page-header { margin-bottom: 22px; }
.page-header h1 { font-size: 22px; font-weight: 900; color: var(--text-main); }
.page-header p { color: var(--text-muted); font-size: 13px; margin-top: 4px; font-weight: 400; }

.empty-state {
  text-align: center; padding: 60px 20px;
  background: var(--white); border: var(--border);
  border-radius: var(--radius-lg); color: var(--text-muted);
}
.empty-state .icon { font-size: 44px; margin-bottom: 14px; }
.empty-state h3 { font-size: 17px; font-weight: 700; color: var(--text-main); }
.empty-state p { font-size: 13px; margin-top: 6px; }

.blue-accent { color: var(--blue); }
.divider { border: none; border-top: var(--border); margin: 18px 0; }

/* ---- Breadcrumb ---- */
.breadcrumb { display:flex; gap:6px; align-items:center; font-size:13px; color:var(--text-muted); margin-bottom:20px; flex-wrap:wrap; font-weight:500; }
.breadcrumb a { color:var(--text-muted); text-decoration:none; }
.breadcrumb a:hover { color:var(--blue); }
.breadcrumb .sep { color:var(--grey-border); }
.breadcrumb .current { color:var(--text-main); font-weight:600; }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .player-layout { grid-template-columns: 1fr; }
  .related-panel { position: static; }
}
@media (max-width: 640px) {
  .page-body { padding: 16px; }
  .topbar { padding: 0 16px; }
  .topbar-search { display: none; }
  .streams-grid { grid-template-columns: 1fr; }
}
