/* Intelligence Refinery — minimal styling */

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui,
               sans-serif;
  margin: 0;
  background: #f7f6f2;
  color: #1a1a1a;
  line-height: 1.5;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* Top bar */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background: #0A5299;
  color: #fff;
}

.brand {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
}

.attendee-name { opacity: 0.95; }

.stream-badge {
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255,255,255,0.18);
}

.logout-form { margin: 0; }

.link-button {
  background: none;
  border: none;
  color: #fff;
  text-decoration: underline;
  cursor: pointer;
  font-size: 14px;
  padding: 0;
}

main {
  padding: 32px 24px;
  max-width: 880px;
  margin: 0 auto;
}

/* Login */
.login-card {
  max-width: 360px;
  margin: 80px auto;
  background: #fff;
  padding: 32px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  text-align: center;
}

.login-card h1 {
  margin-top: 0;
  font-size: 24px;
}

.login-card input {
  font-size: 28px;
  text-align: center;
  letter-spacing: 0.4em;
  width: 100%;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  margin: 16px 0;
}

.login-card button {
  font-size: 16px;
  padding: 10px 20px;
  background: #0A5299;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  width: 100%;
}

.login-card .error {
  color: #b40000;
  font-size: 14px;
  margin-top: 12px;
}

/* Chat */
.chat-shell {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 140px);
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  margin-bottom: 16px;
}

.message {
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: 8px;
  max-width: 85%;
  white-space: pre-wrap;
}

.message.user {
  background: #0A5299;
  color: #fff;
  align-self: flex-end;
  margin-left: auto;
}

.message.assistant {
  background: #f0ede4;
  color: #1a1a1a;
}

.message.system {
  background: transparent;
  color: #666;
  font-style: italic;
  text-align: center;
  font-size: 14px;
}

.composer {
  display: flex;
  gap: 8px;
}

.composer textarea {
  flex: 1;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  resize: vertical;
  font: inherit;
  font-size: 15px;
}

.composer button {
  padding: 0 20px;
  background: #0A5299;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}

.composer button:disabled {
  background: #888;
  cursor: not-allowed;
}

/* -----------------------------------------------------------------
   Chat toolbar (restart, upload, exports)
   ----------------------------------------------------------------- */
.chat-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
  margin-bottom: 12px;
}

.toolbar-button {
  padding: 7px 14px;
  background: #f4f4f6;
  color: #333;
  border: 1px solid #d4d4d8;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.1s;
}

.toolbar-button:hover {
  background: #e8e8eb;
}

.toolbar-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.toolbar-button-primary {
  background: #0A5299;
  color: #fff;
  border-color: #0A5299;
}

.toolbar-button-primary:hover {
  background: #094584;
}

.toolbar-button-warning {
  background: #fff;
  color: #b94a48;
  border-color: #e0c2c0;
}

.toolbar-button-warning:hover {
  background: #fff5f4;
}

/* -----------------------------------------------------------------
   Upload slots (used on /uploads page; see also .uploads-grid below)
   ----------------------------------------------------------------- */
.upload-slot {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: #fff;
  border: 1px solid #e4e4ea;
  border-radius: 6px;
}

.upload-slot label {
  font-size: 13px;
  font-weight: 500;
  color: #333;
}

.upload-slot input[type=file] {
  font-size: 13px;
}

.upload-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: #777;
  font-style: italic;
}

.upload-status {
  font-size: 12px;
  min-height: 1em;
  color: #666;
}

.upload-status.uploading {
  color: #0A5299;
}

.upload-status.success {
  color: #2a7a3a;
}

.upload-status.error {
  color: #b94a48;
}

/* -----------------------------------------------------------------
   Chat layout: main chat + sidebar
   ----------------------------------------------------------------- */
.chat-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 16px;
  flex: 1;
  min-height: 0;
}

.chat-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

.chat-sidebar {
  background: #f8f8fa;
  border: 1px solid #e0e0e6;
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
}

.sidebar-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e0e0e6;
}

.sidebar-header h2 {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin: 0;
}

.sidebar-action {
  font-size: 12px;
  color: #0A5299;
  text-decoration: none;
}

.sidebar-action:hover {
  text-decoration: underline;
}

.sidebar-files {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-file {
  padding: 8px 0;
  border-bottom: 1px solid #ececef;
}

.sidebar-file:last-child {
  border-bottom: none;
}

.sidebar-file-name {
  font-size: 13px;
  font-weight: 500;
  color: #222;
  word-break: break-word;
}

.sidebar-file-size {
  font-size: 11px;
  color: #888;
}

.files-empty {
  font-size: 12px;
  color: #888;
  font-style: italic;
  padding: 6px 0;
}

/* Collapse sidebar on narrow screens */
@media (max-width: 720px) {
  .chat-layout {
    grid-template-columns: 1fr;
  }
  .chat-sidebar {
    display: none;
  }
}

/* -----------------------------------------------------------------
   Uploads page (standalone)
   ----------------------------------------------------------------- */
.uploads-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
}

.uploads-title {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 6px;
  color: #222;
}

.uploads-intro {
  margin: 0 0 24px;
  font-size: 14px;
  color: #555;
  max-width: 700px;
}

.uploads-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

@media (max-width: 720px) {
  .uploads-grid {
    grid-template-columns: 1fr;
  }
}

.uploads-section-heading {
  font-size: 14px;
  font-weight: 600;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid #e4e4ea;
}

.uploads-column .uploads-section-heading + .uploads-section-heading {
  margin-top: 24px;
}

.files-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.file-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  background: #fff;
  border: 1px solid #e4e4ea;
  border-radius: 6px;
}

.file-meta {
  flex: 1;
  min-width: 0;
}

.file-label {
  font-size: 14px;
  font-weight: 500;
  color: #222;
  word-break: break-word;
}

.file-detail {
  font-size: 12px;
  color: #777;
  margin-top: 2px;
}

.file-actions {
  flex-shrink: 0;
}

.file-delete {
  padding: 5px 10px;
  background: #fff;
  color: #b94a48;
  border: 1px solid #e0c2c0;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
}

.file-delete:hover {
  background: #fff5f4;
}
