/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #0d0d0d;
  --surface:     #1a1a1a;
  --surface2:    #242424;
  --border:      #2e2e2e;
  --orange:      #FF6B00;
  --blue:        #4169E1;
  --red:         #e53935;
  --text:        #ffffff;
  --text-muted:  #888888;
  --text-dim:    #555555;
  --radius:      8px;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.4;
}

/* ── Header ───────────────────────────────────────────────── */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 56px;
  border-bottom: 1px solid var(--border);
  background: #111;
  flex-shrink: 0;
}

.brand-logo {
  font-weight: 700;
  font-size: 16px;
  color: var(--orange);
  letter-spacing: -0.3px;
}

.brand-sub {
  margin-left: 10px;
  color: var(--text-muted);
  font-size: 13px;
}

.calendar-pane-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.month-tabs { display: flex; gap: 4px; }

.tab-btn {
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s;
}

.tab-btn:hover { color: var(--text); border-color: #555; }

.tab-btn.active {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
  font-weight: 600;
}

/* ── Split View ───────────────────────────────────────────── */
.split-view {
  display: grid;
  grid-template-columns: 44% 56%;
  height: calc(100vh - 56px);
  overflow: hidden;
}

/* ── Calendar Pane ────────────────────────────────────────── */
.calendar-pane {
  padding: 20px 20px 16px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

.month-heading {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.dow-headers {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
}

.dow-headers span {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 4px 0;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

/* ── Day Cells ────────────────────────────────────────────── */
.day-cell {
  aspect-ratio: 1;
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: background 0.12s;
  border: 1px solid transparent;
  user-select: none;
}

.day-cell:hover { background: var(--surface2); }
.day-cell.filler { background: transparent; cursor: default; pointer-events: none; }
.day-cell.past { opacity: 0.6; }
.day-cell.today { border-color: var(--blue); }
.day-cell.selected { background: rgba(65, 105, 225, 0.25); border-color: var(--blue); }
.day-cell.scheduled { background: rgba(255, 107, 0, 0.12); }
.day-cell.scheduled:hover { background: rgba(255, 107, 0, 0.22); }
.day-cell.selected.scheduled { background: rgba(65, 105, 225, 0.25); }

/* Red triangle top-right corner — unpublished flag */
.day-cell.unpublished::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 12px 12px 0;
  border-color: transparent var(--red) transparent transparent;
  border-radius: 0 var(--radius) 0 0;
}

.day-number {
  font-size: 13px;
  font-weight: 600;
}

.day-cell.filler .day-number,
.day-cell.past .day-number { color: var(--text-dim); }
.day-cell.today .day-number { color: var(--blue); }

.day-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--orange);
  margin-top: 3px;
}

/* ── Legend ───────────────────────────────────────────────── */
.calendar-legend { display: flex; gap: 16px; padding-top: 4px; }

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
}

.legend-triangle {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 10px 10px 0;
  border-color: transparent var(--red) transparent transparent;
}

/* ── Detail Pane ──────────────────────────────────────────── */
.detail-pane { overflow-y: auto; padding: 24px; }

.detail-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  font-size: 14px;
}

.detail-content { display: flex; flex-direction: column; gap: 16px; }

.detail-date { font-size: 20px; font-weight: 700; }

.unpublished-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(229, 57, 53, 0.12);
  border: 1px solid rgba(229, 57, 53, 0.4);
  border-radius: var(--radius);
  padding: 10px 14px;
  color: #ef5350;
  font-size: 13px;
  font-weight: 500;
}

.media-area {
  position: relative;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.media-area img {
  display: block;
  max-height: 50vh;
  width: auto;
  max-width: 100%;
  margin: 0 auto;
  border-radius: var(--radius);
}

.media-area video {
  display: block;
  max-height: 50vh;
  width: auto;
  max-width: 100%;
  margin: 0 auto;
  border-radius: var(--radius);
}

.play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.35);
  cursor: pointer;
  border-radius: var(--radius);
  transition: background 0.15s;
}

.play-overlay:hover { background: rgba(0,0,0,0.5); }

.play-icon {
  width: 52px;
  height: 52px;
  background: var(--orange);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.play-icon svg { width: 22px; height: 22px; fill: #fff; margin-left: 3px; }

.meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.meta-item {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 10px 12px;
}

.meta-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.meta-value { font-size: 14px; font-weight: 600; }
.meta-value.muted { color: var(--text-muted); font-weight: 400; font-size: 12px; }

.package-id {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: var(--text-dim);
  padding: 8px 12px;
  background: var(--surface);
  border-radius: var(--radius);
  word-break: break-all;
}

.package-id-label {
  color: var(--text-muted);
  font-weight: 600;
}

.detail-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: var(--text-muted);
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .split-view {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    height: auto;
    overflow: visible;
  }
  .calendar-pane { border-right: none; border-bottom: 1px solid var(--border); }
  .detail-pane { height: auto; }
}
