* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  background: #0b0f14;
  color: #e6e6e6;
  margin: 0;
  padding: 0;
}

/* ===== CONTAINER ===== */

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

/* ===== HEADINGS ===== */

h1 {
  margin-bottom: 20px;
}

h2 {
  font-size: 14px;
  margin-bottom: 10px;
  color: #aaa;
}
h3 {
  margin-top: 0;
  margin-bottom: 10px;
}

/* ===== CARDS ===== */

.card {
  background: #121720;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  border: 1px solid #1f2530;
}

/* ===== TOP BLOCK ===== */

.top {
  display: block;
  margin-bottom: 20px;
}

.top .card {
  display: flex;
  flex-direction: row;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
}

/* ===== ADD VIDEO ===== */

.add input {
  width: 20%;
  padding: 6px 8px;
  background: #0b0f14;
  border: 1px solid #2a2f3a;
  color: white;
  border-radius: 6px;
  font-size: 12px;
}

.add input::placeholder {
  color: #666;
}

.add button {
  width: 30%;
  padding: 6px 8px;
  background: #4caf50;
  border: none;
  border-radius: 6px;
  color: white;
  font-size: 12px;
  cursor: pointer;
}

.add button:hover {
  background: #43a047;
}

/* ===== SUMMARY ===== */

.summary {
  margin-bottom: 30px;
}

.summary .metrics {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* ===== A/B TEST ===== */

#ab-test {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

#version-new,
#version-old {
  background: #0f141c;
  border-radius: 12px;
  padding: 16px;
  border: 1px solid #1f2530;
}

/* ===== VIDEOS ===== */

.video-card {
  background: #0b0f14;
  border: 1px solid #222;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 14px;
  position: relative;
}

.video-row {
  display: flex;
  flex-direction: column;
}

/* LEFT SIDE */

.video-left {
  display: flex;
  gap: 14px;
  width: 100%;
}

.thumb {
  width: 180px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  border: #727272 solid 1px;
}

.video-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.video-title {
  font-size: 14px;
  color: #fff;
  line-height: 1.3;
}

/* RIGHT SIDE */

.video-right {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

/* ===== METRICS ===== */

.metrics {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.metric {
  font-size: 11px;
  color: #888;
  min-width: 80px;
}

.metric span {
  display: block;
  font-size: 18px;
  color: white;
  margin-top: 2px;
}

.metric small {
  display: block;
  font-size: 10px;
  color: #666;
  margin-top: 2px;
}

/* ===== DELETE BUTTON ===== */

.delete {
  position: absolute;
  right: 10px;
  top: 10px;
  background: #ff5252;
  border: none;
  color: white;
  border-radius: 4px;
  cursor: pointer;
  padding: 2px 6px;
  font-size: 12px;
}

/* ===== VIDEOS HEADER ===== */

.videos-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#toggle-videos {
  background: #1f2530;
  border: 1px solid #2a2f3a;
  color: #aaa;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
}

#toggle-videos:hover {
  background: #2a2f3a;
}

/* ===== TABLE ===== */

table {
  width: 100%;
  border-collapse: collapse;
  background: #121720;
  border-radius: 10px;
  overflow: hidden;
  margin-top: 20px;
}

th,
td {
  padding: 10px;
  font-size: 13px;
  border-bottom: 1px solid #1f2530;
}

th {
  background: #161c26;
  text-align: left;
  color: #888;
  font-weight: normal;
}

tr:hover {
  background: #1a202c;
}

#table tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.015);
}

#table tr:nth-child(odd) {
  background: rgba(255, 255, 255, 0.03);
}

/* ===== EVENTS ===== */

.event {
  padding: 6px 10px;
  margin-bottom: 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.event-main {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}

.event-time {
  color: #888;
  font-size: 12px;
  min-width: 60px;
}

.event-name {
  font-weight: 500;
}

.event-data {
  margin-top: 4px;
  font-size: 12px;
  color: #35a035;
}

/* ===== SESSION STATES ===== */

.session-row {
  transition: background 0.2s ease;
}

.session-row.active {
  background: rgba(25, 114, 28, 0.199) !important;
}

.session-row.inactive {
  background: rgba(255, 255, 255, 0.05);
}

.session-row.closed {
  background: rgba(255, 255, 255, 0.01) !important;
}

/* ===== SCROLL ===== */

::-webkit-scrollbar {
  height: 6px;
  width: 6px;
}

::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 3px;
}

/* ===== MOBILE (iPhone) ===== */

@media (max-width: 768px) {
  .container {
    padding: 16px;
  }

  /* ===== TOP BLOCK ===== */

  .top .card {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  /* ===== ADD VIDEO ===== */

  .add input,
  .add button {
    width: 100%;
  }

  /* ===== A/B TEST ===== */

  #ab-test {
    grid-template-columns: 1fr;
  }

  /* ===== VIDEO CARD ===== */

  .video-left {
    flex-direction: column;
    gap: 10px;
  }

  .thumb {
    width: 100%;
  }

  .video-info {
    width: 100%;
  }

  .video-title {
    font-size: 13px;
  }

  /* ===== METRICS ===== */

  .metrics {
    gap: 10px;
  }

  .metric {
    min-width: 45%;
  }

  .metric span {
    font-size: 16px;
  }

  /* ===== TABLE → SCROLL ===== */

  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  /* ===== HEADER ===== */

  .videos-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  /* ===== BUTTON ===== */

  #toggle-videos {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 768px) {
  table {
    display: block;
  }

  thead {
    display: none;
  }

  tr {
    display: block;
    margin-bottom: 12px;
    background: #121720;
    border-radius: 10px;
    padding: 12px;
  }

  td {
    display: block;
    padding: 6px 0;
    border: none;
    font-size: 13px;
  }

  td::before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    color: #888;
    margin-bottom: 2px;
  }
}
