/* public/style.css */
:root {
  --primary: #007bff;
  --primary-dark: #0056b3;
  --danger-bg: #f8d7da;
  --danger-text: #a94442;
  --border-radius: 0.5rem;
  --box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  --padding: 1rem;
  --font-size: 1rem;
  --font-size-small: 0.8rem;
  --font-size-xsmall: 0.7rem;
  --bg: #f4f4f4;
  --container-bg: #fff;
  --border: 1px solid #ccc;
  --input-bg: #fafafa;
}

body {
  font-family: sans-serif;
  margin: 0.5rem;
  background-color: var(--bg);
  color: #333;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.container {
  background-color: var(--container-bg);
  padding: var(--padding);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  width: 100%;
  max-width: 1024px;
}

h1,
h2 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  color: #555;
  font-size: 120%;
  text-align: left;
}

#top {
  display: flex;
  gap: 1rem;
}

#top-left-controls {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  left: auto;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.85);
  padding: 0.5rem;
}

.new-room {
  margin-bottom: 0.5rem;
  font-size: var(--font-size-small);
}

#top-left-controls #qrcode {
  margin: 0 auto;
}

/* if under 600px wide, hide the qr code */
@media (max-width: 520px) {
  #top-left-controls #qrcode {
    display: none;
  }
}

button {
  background-color: var(--primary);
  color: white;
  padding: 0.5rem;
  margin: 0.5rem;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: var(--font-size);
  box-shadow: var(--box-shadow);
  transition: background-color 0.2s, box-shadow 0.2s;
}

button:hover {
  background-color: var(--primary-dark);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

footer {
  text-align: center;
  margin-top: 1rem;
}

a {
  text-decoration: none;
  color: var(--primary);
}

.button {
  background-color: var(--primary);
  color: white;
  padding: 0.5rem 0.5rem;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: var(--font-size);
}

.button:hover {
  background-color: var(--primary-dark);
}

.button:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

#qrcode {
  margin: 1.2rem auto;
}

textarea {
  width: 100%;
  padding: 1rem;
  border: var(--border);
  border-radius: var(--border-radius);
  font-size: var(--font-size);
  min-height: 10rem;
  box-sizing: border-box;
  resize: vertical;
  background: var(--input-bg);
}

.users-info {
  margin: 0.5rem 0;
  font-size: small;
  text-align: left;
  padding: 1rem;
  border: 1px solid #eee;
  border-radius: var(--border-radius);
  background-color: var(--input-bg);
}

.users-info p {
  margin-top: 0;
  margin-bottom: 0.3rem;
}

#userList {
  list-style: none;
  padding-left: 0;
}

#userList li {
  margin-bottom: 0.2rem;
  font-size: var(--font-size-small);
  color: #777;
}

.privacy-note {
  font-size: var(--font-size-small);
  color: #888;
  margin-top: 1rem;
  text-align: center;
}

.barcodes {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 100%;
  flex-wrap: wrap;
}

.barcodes > div {
  margin: 0.6rem;
  max-width: 8rem;
}

.barcode-text {
  font-size: var(--font-size-xsmall);
  font-family: monospace;
  word-wrap: break-word;
  max-width: 8rem;
}

#image-share {
  /* margin: 1rem 0; */
  padding: 1rem;
  border: var(--border);
  border-radius: var(--border-radius);
  background: #fafbfc;
}

#dropArea {
  border: 2px dashed #888;
  border-radius: var(--border-radius);
  padding: 1rem;
  text-align: center;
  margin-bottom: 1rem;
  background: #f5f5f5;
  cursor: pointer;
  transition: background 0.2s;
}

#dropArea.dragover {
  background: #e0f7fa;
}

.shared-image {
  display: inline-block;
  margin: 0.5rem;
  text-align: center;
}

.shared-image img {
  display: block;
  margin: 0 auto 0.5rem auto;
  border-radius: 0.25rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.textarea-barcode-controls {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-top: 0.2rem;
  position: relative;
}

#generate-barcodes {
  position: static;
  opacity: 0.7;
  margin-right: 0.5rem;
  font-size: var(--font-size-xsmall);
  padding: 0.2rem 0.5rem;
}

#close-barcodes {
  font-size: var(--font-size-xsmall);
  padding: 0.2rem 0.5rem;
  background: #eee;
  border: var(--border);
  border-radius: 0.25rem;
  cursor: pointer;
  opacity: 0.7;
  margin-left: 0.2rem;
}
#close-barcodes:hover {
  opacity: 1;
  background: var(--danger-bg);
  color: var(--danger-text);
}

#userCountSticky {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.85);
  color: #333;
  font-size: var(--font-size-xsmall);
  padding: 0.2em 0.7em;
  border-radius: 1em;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
  pointer-events: none;
  user-select: none;
}

#userCountSticky.active {
  background: #00ff5a !important;
  color: #222;
}

.upload-status {
  display: none;
  margin: 0.5rem 0;
  text-align: center;
}

.upload-error {
  display: none;
  margin: 0.5rem 0;
  text-align: center;
  background: var(--danger-bg);
  color: var(--danger-text);
  border: 1px solid var(--danger-text);
  font-weight: bold;
}

.general-error {
  display: none;
  margin: 0.5rem 0;
  text-align: center;
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeeba;
  border-radius: var(--border-radius);
  font-weight: bold;
  padding: 0.5rem 1rem;
}

.upload-progress-bar {
  display: none;
  width: 60%;
}

#text-content {
  flex: 1;
}
