/* ============================================
   Sam Aguiar Injury Lawyers — Video Library
   Brand: Navy #0B212D, Orange #F89C22, White, Green #2ECC71
   Font: Poppins 500/600/700
   ============================================ */

:root {
  --navy: #0B212D;
  --navy-2: #142D3C;
  --navy-3: #1E3F52;
  --orange: #F89C22;
  --orange-hover: #FFAE3F;
  --white: #FFFFFF;
  --offwhite: #F7F5F1;
  --green: #2ECC71;
  --red: #E74C3C;
  --sidebar-w: 248px;
  --topbar-h: 72px;
  --radius: 10px;
  --shadow-card: 0 4px 18px rgba(0,0,0,0.08);
  --shadow-hover: 0 8px 32px rgba(11,33,45,0.18);
}

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

html, body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 500;
  background: var(--offwhite);
  color: var(--navy);
  height: 100%;
  overflow: hidden;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select { font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* ============================================
   APP SHELL
   ============================================ */
#app { display: flex; height: 100vh; }

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-w);
  background: var(--navy);
  color: var(--white);
  display: flex; flex-direction: column;
  padding: 24px 0;
  flex-shrink: 0;
}

.sidebar-brand {
  padding: 0 24px 24px;
  border-bottom: 1px solid var(--navy-3);
  margin-bottom: 16px;
}

.sidebar-brand .brand-mark {
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--orange);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.sidebar-brand .brand-name {
  font-weight: 700;
  font-size: 17px;
  line-height: 1.25;
}

.sidebar-brand .brand-sub {
  font-size: 12px;
  font-weight: 500;
  opacity: 0.6;
  margin-top: 4px;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  padding: 12px 24px 8px;
}

.nav-item {
  display: flex; align-items: center;
  gap: 12px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background 0.15s, border-color 0.15s;
  width: 100%;
  text-align: left;
}

.nav-item .nav-icon {
  width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.nav-item .nav-count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  background: var(--navy-3);
  color: rgba(255,255,255,0.7);
  padding: 2px 8px;
  border-radius: 10px;
}

.nav-item:hover { background: var(--navy-2); }

.nav-item.active {
  background: var(--navy-2);
  border-left-color: var(--orange);
  color: var(--white);
}
.nav-item.active .nav-count {
  background: var(--orange);
  color: var(--navy);
}

.sidebar-stats {
  margin-top: auto;
  padding: 20px 24px;
  border-top: 1px solid var(--navy-3);
  font-size: 12px;
  line-height: 1.5;
}
.sidebar-stats .stat-row {
  display: flex; justify-content: space-between;
  padding: 4px 0;
}
.sidebar-stats .stat-num { color: var(--green); font-weight: 700; }
.sidebar-stats .stat-label { opacity: 0.7; }

/* MAIN AREA */
.main {
  flex: 1;
  display: flex; flex-direction: column;
  overflow: hidden;
}

.topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid #ECE5DA;
  display: flex; align-items: center;
  padding: 0 32px;
  gap: 16px;
  flex-shrink: 0;
}

.topbar-search {
  position: relative;
  flex: 1; max-width: 360px;
}
.topbar-search input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border: 1.5px solid #ECE5DA;
  border-radius: 8px;
  font-size: 14px;
  background: var(--offwhite);
  transition: border-color 0.15s, background 0.15s;
}
.topbar-search input:focus {
  outline: none;
  border-color: var(--orange);
  background: var(--white);
}
.topbar-search .search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--navy-3); opacity: 0.6;
  pointer-events: none;
}

.topbar-spacer { flex: 1; }

.btn-upload {
  background: var(--orange);
  color: var(--white);
  font-weight: 700;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background 0.15s;
}
.btn-upload:hover { background: var(--orange-hover); }

.btn-ghost {
  color: var(--navy);
  font-weight: 600;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 8px;
}
.btn-ghost:hover { background: var(--offwhite); }

/* CONTENT */
.content {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
}

.section-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 24px;
  gap: 24px;
  flex-wrap: wrap;
}

.section-title {
  font-weight: 700;
  font-size: 26px;
  color: var(--navy);
  margin-bottom: 4px;
}

.section-sub {
  font-size: 13px;
  color: var(--navy-3);
  opacity: 0.8;
}

/* FILTER BARS */
.filters {
  display: flex; flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.filter-row {
  display: flex; align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-row .filter-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--navy-3);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-right: 4px;
}

.tab-group {
  display: inline-flex;
  background: var(--white);
  border: 1.5px solid #ECE5DA;
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.tab-group .tab {
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy-3);
  border-radius: 6px;
  transition: all 0.15s;
  white-space: nowrap;
}
.tab-group .tab:hover { color: var(--navy); }
.tab-group .tab.active {
  background: var(--navy);
  color: var(--white);
}

.chip-group {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--navy);
  background: var(--white);
  border: 1.5px solid #ECE5DA;
  border-radius: 16px;
  transition: all 0.15s;
}
.chip:hover { border-color: var(--orange); }
.chip.active {
  background: var(--orange);
  color: var(--white);
  border-color: var(--orange);
}

select.filter-select {
  padding: 8px 30px 8px 12px;
  border: 1.5px solid #ECE5DA;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%230B212D' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E") no-repeat right 12px center;
  appearance: none;
  cursor: pointer;
  color: var(--navy);
}
select.filter-select:focus { outline: none; border-color: var(--orange); }

/* GRID */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.video-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.15s, box-shadow 0.15s;
  cursor: pointer;
  display: flex; flex-direction: column;
}
.video-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.video-thumb {
  position: relative;
  aspect-ratio: 16/9;
  background: var(--navy);
  overflow: hidden;
}

.video-thumb video,
.video-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

.video-thumb .thumb-placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-3) 100%);
  color: rgba(255,255,255,0.4);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.play-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(11,33,45,0.0);
  transition: background 0.2s;
}
.video-card:hover .play-overlay { background: rgba(11,33,45,0.45); }

.play-overlay .play-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--orange);
  display: flex; align-items: center; justify-content: center;
  color: var(--white);
  font-size: 22px;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.2s, transform 0.2s;
  box-shadow: 0 6px 24px rgba(0,0,0,0.4);
}
.video-card:hover .play-overlay .play-icon { opacity: 1; transform: scale(1); }

.duration-badge {
  position: absolute; bottom: 8px; right: 8px;
  background: rgba(11,33,45,0.85);
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}

.status-badge {
  position: absolute; top: 10px; left: 10px;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.status-badge.live { background: var(--green); color: var(--white); }
.status-badge.available { background: var(--orange); color: var(--white); }
.status-badge.archive { background: rgba(11,33,45,0.85); color: var(--white); }

.card-body { padding: 14px 16px 16px; }

.card-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--navy);
  line-height: 1.35;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px;
  color: var(--navy-3);
  font-weight: 500;
}

.card-meta .city-pill {
  background: var(--offwhite);
  color: var(--navy);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.card-actions {
  display: flex; gap: 6px;
  padding: 0 12px 12px;
  margin-top: 4px;
}

.card-actions .icon-btn {
  flex: 1;
  padding: 7px;
  font-size: 11px;
  font-weight: 600;
  color: var(--navy);
  background: var(--offwhite);
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: background 0.15s, color 0.15s;
  text-align: center;
}
.card-actions .icon-btn:hover { background: var(--navy); color: var(--white); }
.card-actions .icon-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.card-actions .icon-btn:disabled:hover {
  background: var(--offwhite);
  color: var(--navy);
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--navy-3);
}
.empty-state h3 {
  font-size: 18px; font-weight: 700; color: var(--navy); margin-bottom: 6px;
}
.empty-state p { font-size: 13px; opacity: 0.8; }

/* ============================================
   LIGHTBOX (Video Player Modal)
   ============================================ */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(11,33,45,0.92);
  z-index: 1000;
  display: none;
  align-items: center; justify-content: center;
  padding: 32px;
}
.lightbox.visible { display: flex; }

.lightbox-content {
  width: 100%; max-width: 1100px;
  display: flex; flex-direction: column;
  gap: 16px;
}

.lightbox-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  color: var(--white);
  gap: 16px;
}

.lightbox-title {
  font-weight: 700; font-size: 18px;
  line-height: 1.3;
}

.lightbox-meta {
  font-size: 13px;
  opacity: 0.7;
  margin-top: 4px;
}

.lightbox-close {
  color: var(--white);
  font-size: 28px;
  font-weight: 300;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  transition: background 0.15s;
  flex-shrink: 0;
}
.lightbox-close:hover { background: rgba(255,255,255,0.12); }

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

.lightbox-actions {
  display: flex; gap: 10px;
  flex-wrap: wrap;
}
.lightbox-actions .btn {
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  background: rgba(255,255,255,0.12);
  color: var(--white);
  transition: background 0.15s;
}
.lightbox-actions .btn:hover { background: rgba(255,255,255,0.22); }
.lightbox-actions .btn.primary {
  background: var(--orange);
}
.lightbox-actions .btn.primary:hover { background: var(--orange-hover); }

/* ============================================
   UPLOAD MODAL
   ============================================ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(11,33,45,0.85);
  z-index: 1001;
  display: none;
  align-items: center; justify-content: center;
  padding: 32px;
}
.modal-backdrop.visible { display: flex; }

.modal {
  background: var(--white);
  border-radius: 14px;
  width: 100%; max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}

.modal-header {
  padding: 24px 28px 16px;
  border-bottom: 1px solid var(--offwhite);
  display: flex; justify-content: space-between; align-items: center;
}
.modal-header h2 {
  font-weight: 700; font-size: 18px; color: var(--navy);
}
.modal-close {
  color: var(--navy-3);
  font-size: 24px;
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--offwhite); }

.modal-body { padding: 24px 28px; }

.dropzone {
  border: 2px dashed #DCD2C2;
  border-radius: 10px;
  padding: 32px 16px;
  text-align: center;
  background: var(--offwhite);
  transition: border-color 0.15s, background 0.15s;
  cursor: pointer;
  margin-bottom: 20px;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--orange);
  background: #FFF8EE;
}
.dropzone .dz-icon {
  font-size: 32px; color: var(--orange); margin-bottom: 8px;
}
.dropzone .dz-text {
  font-size: 14px; font-weight: 600; color: var(--navy);
}
.dropzone .dz-sub {
  font-size: 12px; color: var(--navy-3); margin-top: 4px;
}
.dropzone.has-file { border-color: var(--green); background: #F0FDF4; }
.dropzone.has-file .dz-icon { color: var(--green); }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-grid .full { grid-column: 1 / -1; }

.form-field label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--navy-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}
.form-field input,
.form-field select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #ECE5DA;
  border-radius: 8px;
  font-size: 14px;
  background: var(--white);
  color: var(--navy);
}
.form-field input:focus,
.form-field select:focus { outline: none; border-color: var(--orange); }

.modal-footer {
  padding: 16px 28px 24px;
  border-top: 1px solid var(--offwhite);
  display: flex; justify-content: flex-end; gap: 10px;
}
.modal-footer .btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.modal-footer .btn.cancel {
  background: var(--offwhite); color: var(--navy);
}
.modal-footer .btn.submit {
  background: var(--orange); color: var(--white);
}
.modal-footer .btn.submit:hover { background: var(--orange-hover); }
.modal-footer .btn.submit:disabled {
  opacity: 0.4; cursor: not-allowed;
}

.upload-note {
  font-size: 11px;
  color: var(--navy-3);
  background: var(--offwhite);
  padding: 10px 12px;
  border-radius: 6px;
  margin-top: 16px;
  line-height: 1.5;
}
.upload-note strong { color: var(--navy); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
  .sidebar { width: 64px; }
  .sidebar-brand .brand-name,
  .sidebar-brand .brand-sub,
  .nav-item span:not(.nav-icon):not(.nav-count),
  .nav-section-label,
  .sidebar-stats { display: none; }
  .nav-item { justify-content: center; padding: 14px 0; }
  .content { padding: 20px; }
  .topbar { padding: 0 16px; }
  .topbar-search { max-width: none; }
}

@media (max-width: 600px) {
  .video-grid { grid-template-columns: 1fr; }
  .section-header { flex-direction: column; align-items: flex-start; }
  .filter-row { gap: 8px; }
  .tab-group .tab { padding: 6px 10px; font-size: 12px; }
}
