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

html,
body {
  height: 100%;
  font-family: Lato, 'Microsoft JhengHei', Helvetica, Arial, sans-serif;
}
body {
  display: flex;
  overflow: hidden;
  background: #0d0d1a;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #3d3d6b;
  border-radius: 3px;
}

/* ══════════════════════════════════
   CONFIG PANEL
══════════════════════════════════ */
#cfg {
  width: 290px;
  flex-shrink: 0;
  background: #13132b;
  color: #d0d0e8;
  overflow-y: auto;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-right: 1px solid #252550;
}
.cfg-title {
  font-size: 13px;
  font-weight: 700;
  color: #a78bfa;
  padding-bottom: 8px;
  border-bottom: 1px solid #252550;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sec {
  background: #0e0e24;
  border: 1px solid #252550;
  border-radius: 8px;
  padding: 10px;
}
.sec-title {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #60a5fa;
  font-weight: 700;
  margin-bottom: 8px;
}
.row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.row:last-child {
  margin-bottom: 0;
}
.row.col {
  flex-direction: column;
  align-items: stretch;
}
.row.col .lbl {
  margin-bottom: 3px;
}

.row.end {
  align-items: flex-end;
}

.inp-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.lbl {
  font-size: 11px;
  color: #a0a0c0;
  flex: 1;
  white-space: nowrap;
}
input[type='color'] {
  width: 36px;
  height: 26px;
  border: 1px solid #3d3d6b;
  border-radius: 4px;
  cursor: pointer;
  padding: 2px;
  background: #13132b;
  flex-shrink: 0;
}
input[type='text'].ti,
textarea.ti {
  flex: 1;
  background: #252550;
  border: 1px solid #3d3d6b;
  border-radius: 4px;
  color: #e0e0f0;
  font-size: 11px;
  padding: 4px 7px;
  font-family: inherit;
  outline: none;
  width: 100%;
}
input[type='text'].ti:focus,
textarea.ti:focus {
  border-color: #7c3aed;
}
textarea.ti {
  resize: vertical;
  min-height: 152px;
}

hr {
  border: none;
  height: 1px;
  background-image: radial-gradient(circle, #3d3d6b 1px, transparent 1px);
  background-size: 6px 1px;
  margin: 8px 0;
}

.upload-lbl {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: #252550;
  border: 1px dashed #4d4d7e;
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 11px;
  color: #a0a0c0;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
}
.upload-lbl:hover {
  background: #3d3d6b;
  color: #e0e0f0;
  border-color: #7c3aed;
}

.thumb {
  width: 100%;
  max-height: 50px;
  object-fit: contain;
  border-radius: 4px;
  background: #252550;
  margin-top: 5px;
  display: none;
}
.thumb.on {
  display: block;
}

/* toggle switch */
.tog-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tog {
  position: relative;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}
.tog input {
  opacity: 0;
  width: 0;
  height: 0;
}
.tog-track {
  position: absolute;
  inset: 0;
  background: #252550;
  border-radius: 24px;
  border: 1px solid #4d4d7e;
  transition: 0.3s;
  cursor: pointer;
}
.tog-track::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 2px;
  bottom: 2px;
  background: #6b7280;
  border-radius: 50%;
  transition: 0.3s;
}
.tog input:checked ~ .tog-track {
  background: #7c3aed;
  border-color: #7c3aed;
}
.tog input:checked ~ .tog-track::before {
  transform: translateX(18px);
  background: #fff;
}
.tog-info .tog-name {
  font-size: 12px;
  color: #e0e0f0;
  font-weight: 600;
}
.tog-info .tog-desc {
  font-size: 10px;
  color: #6b7280;
  margin-top: 1px;
}

.reset-btn {
  background: #7f1d1d;
  border: 1px solid #dc2626;
  border-radius: 6px;
  color: #fca5a5;
  font-size: 11px;
  font-weight: 700;
  padding: 8px;
  cursor: pointer;
  width: 100%;
  transition: all 0.2s;
}
.reset-btn:hover {
  background: #dc2626;
  color: #fff;
}

.copy-btn {
  background: #0f2a4a;
  border: 1px solid #3b82f6;
  border-radius: 6px;
  color: #93c5fd;
  font-size: 11px;
  font-weight: 700;
  padding: 8px;
  cursor: pointer;
  width: 100%;
  transition: all 0.2s;
}
.copy-btn:hover {
  background: #2563eb;
  color: #fff;
}

/* ══════════════════════════════════
   CSS VARIABLES
══════════════════════════════════ */
:root {
  --hdr-bg: #ffffff;
  --hdr-locale: #666666;
  --hdr-active-locale: #3fbb9b;
  --ftr-bg: #0c6251;
  --ftr-text: #ffffff;
  --sp-bg: #0c6251;
  --sp-text: #ffffff;
  --sp-tab: rgba(255, 255, 255, 0.55);
  --sp-tab-active: #ffffff;
  --date-bg: #ffffff;
  --date-text: #0c6251;
  --qa-btn-bg: #3fbb9b;
  --qa-btn-text: #ffffff;
  --desc-color: #333333;
  --tabs-bg: #0a5042;
  --time-text: #ffffff;
  --title-text: #ffffff;
}

/* ══════════════════════════════════
   PREVIEW WRAPPER
══════════════════════════════════ */
#pvw-wrap {
  flex: 1;
  overflow-y: auto;
  /* padding: 18px; */
  background: #0d0d1a;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.pvw-hint {
  font-size: 10px;
  color: #3d3d6b;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
  align-self: flex-start;
}

/* ══════════════════════════════════
   OCGL PREVIEW SHELL
══════════════════════════════════ */
#pvw {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
  font-family: Lato, Helvetica, Arial, sans-serif;
  overflow-y: auto;
}

/* ── HEADER ── */
.ocgl-hdr {
  background: var(--hdr-bg);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 25px;
  height: 70px;
  width: 100%;
}
.logo-area {
  display: flex;
  align-items: center;
  height: 100%;
}
#pvw-logo-img {
  height: 50px;
  display: none;
  object-fit: contain;
  max-width: 160px;
}
#pvw-logo-txt {
  font-size: 22px;
  font-weight: 700;
  color: #3fbb9b;
}
.locale-area {
  display: flex;
  gap: 6px;
  align-items: center;
}
.loc-item {
  font-size: 14px;
  color: var(--hdr-locale);
  cursor: pointer;
  padding: 2px 5px;
}
.loc-item.active {
  color: var(--hdr-active-locale);
}

/* ── EVENT CONTAINER (player + side panel) ── */
.ocgl-event {
  display: flex;
  padding: 20px 25px 0;
  width: 100%;
  max-width: 1322px;
}

/* ── PLAYER ── */
.ocgl-player-wrap {
  width: 66.666%;
  flex-shrink: 0;
}
.ocgl-player-flip {
  width: 100%;
  padding-top: 56.25%;
  background: #000;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  position: relative;
  border-radius: 2px;
}
.player-inner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.big-play {
  width: 58px;
  height: 40px;
  background: rgba(43, 51, 63, 0.75);
  border: 2px solid #fff;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.big-play::after {
  content: '';
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 16px solid #fff;
  margin-left: 3px;
}

/* ── SIDE PANEL ── */
.ocgl-side {
  flex: 1;
  background: var(--sp-bg);
  display: flex;
  flex-direction: column;
  /* max-height: 300px; */
  overflow: hidden;
}

/* ── TABS ── */
.ocgl-tabs {
  display: none;
  background: var(--tabs-bg);
  /* filter: brightness(0.82); */
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}
.ocgl-tabs.on {
  display: flex;
}

.ocgl-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--sp-tab);
  font-size: 13px;
  font-family: Lato, Helvetica, Arial, sans-serif;
  padding: 8px 18px 10px;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: color 0.2s;
  user-select: none;
  min-height: 54px;
}
.ocgl-tab.active {
  color: var(--sp-tab-active);
  border-bottom-color: var(--sp-tab-active);
}
.tab-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}
.tab-label {
  font-size: 13px;
  line-height: 1;
}

/* ── INFO PANEL ── */
.ocgl-info {
  padding: 10px;
  text-align: left;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.ocgl-time {
  display: flex;
  align-items: center;
  padding: 10px;
  color: var(--time-text);
  font-size: 13px;
}
.date-pill {
  width: 40px;
  height: 40px;
  background: var(--date-bg);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
  flex-shrink: 0;
}
.dp-mo {
  font-size: 8px;
  color: var(--date-text);
  display: block;
  text-transform: uppercase;
}
.dp-d {
  font-size: 14px;
  font-weight: 700;
  color: var(--date-text);
  display: block;
}
.t-str {
  color: var(--time-text);
  font-size: 13px;
  margin: 0 8px;
}
.t-sep {
  color: var(--time-text);
  font-size: 13px;
}

.ocgl-ev-title {
  color: var(--title-text);
  font-size: 20px;
  font-weight: 700;
  padding: 10px;
  white-space: pre-wrap;
  word-break: break-word;
  flex: 1;
}

/* ── Q&A BOX (has-tab only) ── */
.ocgl-qa {
  background: #fff;
  border-radius: 5px;
  padding: 10px;
  margin: 8px 10px;
  display: none;
}
.ocgl-qa.on {
  display: block;
}
.qa-area {
  width: 100%;
  border: none;
  outline: none;
  font-size: 14px;
  resize: none;
  height: 56px;
  font-family: inherit;
  color: #333;
}
.qa-sub {
  display: block;
  width: 100%;
  background: var(--qa-btn-bg);
  color: var(--qa-btn-text);
  border: none;
  border-radius: 5px;
  padding: 12px;
  font-size: 15px;
  cursor: pointer;
  margin-top: 6px;
  font-family: inherit;
}

/* ── POLLING PANEL ── */
.ocgl-polling {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 16px 24px;
  flex: 1;
}
.ocgl-polling.on {
  display: flex;
}

.poll-empty-icon {
  display: flex;
  align-items: flex-end;
  color: var(--sp-text);
  opacity: 0.7;
  margin-bottom: 14px;
}
.poll-empty-text {
  color: var(--sp-text);
  font-size: 13px;
  text-align: center;
  opacity: 0.85;
  font-family: Lato, Helvetica, Arial, sans-serif;
}

/* ── BORDER between event section and description ── */
.event-border {
  width: 100%;
  border-bottom: 1px solid #dddddd;
  margin: 20px 0px;
}

/* ── DETAIL DESCRIPTION (below video, white bg) ── */
.detail-description {
  flex: 1;
  font-size: 16px;
  line-height: 150%;
  padding: 20px 25px;
  text-align: left;
  background: #fff;
  width: 100%;
  max-width: 1322px;
}

#pvw-desc {
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── FOOTER ── */
.ocgl-ftr {
  background: var(--ftr-bg);
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}
.ftr-txt {
  color: var(--ftr-text);
  font-size: 12px;
}
.ftr-txt a {
  color: var(--ftr-text);
  text-decoration: none;
}
.ftr-txt a:hover {
  text-decoration: underline;
}

/* ── RESPONSIVE ── */
@media (max-width: 1203px) {
  body {
    /* flex-direction: column; */
    overflow: auto;
    height: auto;
  }
  #cfg {
    height: 100vh;
  }
  #pvw-wrap {
    /* padding: 10px; */
  }
  .ocgl-event {
    flex-direction: column;
    padding: 12px 12px 0;
  }
  .ocgl-player-wrap {
    width: 100%;
  }
  .ocgl-side {
    width: 100%;
    min-height: 200px;
  }
  .detail-description {
    padding: 15px;
  }
}
