body { font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif; margin: 0; padding: 0; color: #222; background: #111; }

/* Fullscreen mode styles */
.fullscreen-mode {
  overflow: hidden;
  background: #000;
}

.fullscreen-main {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

.fullscreen-img {
  max-width: 100vw;
  max-height: 100vh;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  transition: opacity 0.3s ease-in-out;
  opacity: 1;
}

.fullscreen-img.loading {
  opacity: 0;
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #000;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease-in-out;
}

.loading-overlay.active {
  opacity: 1;
}

.no-image {
  text-align: center;
  color: #999;
  padding: 2rem;
}

.no-image p {
  font-size: 1.2rem;
  margin: 1rem 0;
}

.show-qr-btn {
  background: #0d6efd;
  color: white;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  margin-top: 1rem;
}

.show-qr-btn:hover {
  background: #0b5ed7;
}

/* QR toggle button (floating) */
.qr-toggle {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 100;
  opacity: 1;
  pointer-events: auto;
}

.qr-toggle.hidden-btn {
  opacity: 0;
  pointer-events: none;
}

.qr-toggle:hover {
  background: #fff;
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}

.qr-toggle svg {
  color: #333;
}

/* Logout button (floating, top-right) */
.logout-btn {
  position: fixed;
  top: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 100;
  text-decoration: none;
  opacity: 1;
  pointer-events: auto;
}

.logout-btn.hidden-btn {
  opacity: 0;
  pointer-events: none;
}

.logout-btn:hover {
  background: #fff;
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}

.logout-btn svg {
  color: #dc3545;
}

/* QR overlay */
.qr-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  backdrop-filter: blur(4px);
  transition: opacity 0.3s;
}

.qr-overlay.hidden {
  display: none;
}

.qr-card {
  background: #fff;
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  position: relative;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  max-width: 90vw;
}

.qr-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: #666;
  line-height: 1;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.qr-close:hover {
  background: #f0f0f0;
  color: #000;
}

.qr-card h2 {
  margin-top: 0;
  margin-bottom: 1rem;
  color: #222;
}

.qr-img {
  width: 280px;
  height: 280px;
  image-rendering: pixelated;
  margin: 1rem auto;
  display: block;
}

.qr-card p {
  color: #666;
  margin-top: 1rem;
}

.qr-card a {
  color: #0d6efd;
  text-decoration: none;
}

.qr-card a:hover {
  text-decoration: underline;
}

.qr-card .print-link {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #eee;
}

.qr-card .print-link a {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: #f8f9fa;
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.2s;
}

.qr-card .print-link a:hover {
  background: #e9ecef;
  text-decoration: none;
  transform: translateY(-1px);
}

/* Upload page styles (keep existing) */
header, footer { padding: 1rem 2rem; background: #fff; border-bottom: 1px solid #eee; }
footer { border-top: 1px solid #eee; border-bottom: none; margin-top: 3rem; color: #666; }
main:not(.fullscreen-main):not(.login-main) { padding: 2rem; background: #fafafa; min-height: calc(100vh - 200px); }

.upload-form { display: flex; gap: 1rem; align-items: center; margin-top: 1rem; flex-wrap: wrap; }
button:not(.qr-toggle):not(.qr-close):not(.show-qr-btn):not(.login-button) { background: #0d6efd; color: white; border: none; padding: 0.6rem 1rem; border-radius: 6px; cursor: pointer; }
button:not(.qr-toggle):not(.qr-close):not(.show-qr-btn):not(.login-button):hover { background: #0b5ed7; }

.flashes { list-style: none; padding: 0; }
.flash { padding: 0.5rem 0.75rem; margin: 0.5rem 0; border-radius: 6px; }
.flash.success { background: #e7f5ff; color: #084298; }
.flash.error { background: #ffe8e8; color: #842029; }

/* Login page styles */
.login-page {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-main {
  padding: 2rem;
  width: 100%;
  max-width: 400px;
}

.login-card {
  background: white;
  border-radius: 16px;
  padding: 3rem 2rem;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-card h1 {
  margin: 0 0 0.5rem 0;
  font-size: 2rem;
  color: #222;
}

.login-subtitle {
  color: #666;
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

.login-input {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.login-input:focus {
  outline: none;
  border-color: #667eea;
}

.login-button {
  width: 100%;
  padding: 0.875rem 1rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.login-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.login-button:active {
  transform: translateY(0);
}

.login-hint {
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: #666;
}

.login-hint a {
  color: #667eea;
  text-decoration: none;
}

.login-hint a:hover {
  text-decoration: underline;
}

.login-card .flashes {
  text-align: left;
  margin-bottom: 1rem;
}

@media (max-width: 640px) {
  .qr-img { width: 220px; height: 220px; }
  .qr-toggle { bottom: 1rem; right: 1rem; width: 48px; height: 48px; }
  .login-main { padding: 1rem; }
  .login-card { padding: 2rem 1.5rem; }
}
