/* Reset and base */
* { box-sizing: border-box; }
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}
body {
  display: flex;
  flex-direction: column;
  font-family: system-ui,-apple-system,BlinkMacSystemFont,sans-serif;
  background: #f5f7fa;
  min-height: 100vh;
}

/* Controls bar */
#controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
}

/* Button base */
.btn {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  transition: all .15s ease;
  position: relative;
  line-height: 1;
  min-height: 36px;
}

/* Primary */
.btn-primary {
  background: linear-gradient(135deg,#4f7cff,#2f4be0);
  color: white;
  box-shadow: 0 6px 16px -4px rgba(79,124,255,.35);
}
.btn-primary:hover {
  filter: brightness(1.05);
}
.btn-primary:active {
  transform: translateY(1px);
}
.btn-primary:disabled {
  opacity: .5;
  cursor: not-allowed;
}

/* Secondary */
.btn-secondary {
  background: #f0f4f9;
  color: #334e68;
  box-shadow: 0 4px 12px -2px rgba(0,0,0,.05);
}
.btn-secondary:hover {
  background: #e2e9f5;
}
.btn-secondary:active {
  transform: translateY(1px);
}

/* Danger */
.btn-danger {
  background: #ff5f5f;
  color: white;
  box-shadow: 0 6px 16px -4px rgba(255,95,95,.35);
}
.btn-danger:hover {
  filter: brightness(1.1);
}
.btn-danger:active {
  transform: translateY(1px);
}

/* File input styled minimal */
.btn-file {
  padding: 6px 12px;
  background: #eef4fb;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: .9rem;
}

/* Live indicator */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: #ffecea;
  color: #d32f2f;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  margin-left: auto;
}
.live-badge .dot {
  width: 10px;
  height: 10px;
  background: #d32f2f;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 6px rgba(211,47,47,.6);
}

/* Session label */
.small-text {
  font-size: 0.75rem;
  color: #556080;
  margin-left: 8px;
}

/* Workspace: slide on left, chat on right */
#workspace {
  flex: 1 1 auto;
  display: flex;
  overflow: hidden;
  min-height: 0;
  gap: 0;
}

/* Slide pane */
#slide-pane {
  flex: 2 1 0;
  display: flex;
  flex-direction: column;
  padding: 16px;
  overflow: hidden;
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
}

/* Slide image container */
#slide-image {
  flex: 1 1 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #f0f4f9;
  border: 1px solid #d0d7e6;
  border-radius: 6px;
}
#slide-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  display: block;
}

/* Chat sidebar */
#chat {
  flex: 0 0 360px;
  min-width: 260px;
  padding: 16px;
  overflow-y: auto;
  background: #f7f9fc;
  border-left: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#chat p, #chat div {
  margin: 4px 0;
  padding: 8px 12px;
  background: #ffffff;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,.03);
  font-size: .9rem;
  word-break: break-word;
}

/* Responsive: only stack on narrow screens */
@media (max-width: 760px) {
  #workspace {
    flex-direction: column;
  }
  #slide-pane {
    border-right: none;
    border-bottom: 1px solid #e2e8f0;
  }
  #chat {
    border-left: none;
    border-top: 1px solid #e2e8f0;
    max-width: none;
    flex: 0 0 220px;
  }
}

/* Site-wide header */
.site-header {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 200;
  flex-wrap: wrap;
}

.site-header .logo {
  font-weight: 700;
  font-size: 1.25rem;
  text-decoration: none;
  color: #2f4be0;
  letter-spacing: 0.5px;
}

.site-header .actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-header .subtitle {
  font-size: 0.85rem;
  color: #556080;
  margin-left: 6px;
}

@media (max-width: 800px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .site-header .actions {
    margin-top: 6px;
  }
}

