.upload-container {
  max-width: 900px;
  width: 95%;
  margin: 2rem auto;
  z-index: 2;
  position: relative;
}

.upload-header {
  text-align: center;
  margin-bottom: 2rem;
}

.app-logo {
  height: 95px;
  width: 95px;
  border-radius: 50%;
  border: 2px solid var(--color-gold);
  box-shadow: 0 0 15px var(--color-gold-glow);
  margin-bottom: 1rem;
  background: white;
}

.upload-header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.upload-header p {
  font-family: var(--font-body);
  color: var(--color-text-muted);
  font-size: 1.1rem;
}

/* Tabs switcher */
.tab-headers {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--color-glass-border);
  padding-bottom: 1rem;
}

.tab-btn {
  background: transparent;
  border: none;
  font-family: var(--font-title);
  color: var(--color-text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.5rem 1rem;
  transition: var(--transition-quick);
  position: relative;
}

.tab-btn:hover {
  color: var(--color-gold);
}

.tab-btn.active {
  color: var(--color-gold);
  text-shadow: 0 0 8px var(--color-gold-glow);
}

.tab-btn.active::after {
  content: "";
  position: absolute;
  bottom: -1rem;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--color-gold);
  box-shadow: 0 0 8px var(--color-gold-glow);
  border-radius: 2px;
}

/* Panels */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.4s ease-out forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Camera tab styles */
.camera-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.viewport-wrapper {
  position: relative;
  width: 100%;
  max-width: 640px;
  aspect-ratio: 4/3;
  background: #000;
  border: 2px solid var(--color-bronze);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

#camera-stream {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

#camera-stream.mirrored {
  transform: scaleX(-1);
}

#captured-preview {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
  z-index: 5;
  transition: transform 0.3s ease;
}

#captured-preview.mirrored {
  transform: scaleX(-1);
}

.camera-overlay-decor {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  border: 15px solid rgba(0,0,0,0.2);
  z-index: 3;
}

/* Reticle corner marks */
.reticle {
  position: absolute;
  width: 30px;
  height: 30px;
  border: 2px solid rgba(16, 185, 129, 0.4);
  z-index: 4;
}
.reticle-tl { top: 20px; left: 20px; border-right: none; border-bottom: none; }
.reticle-tr { top: 20px; right: 20px; border-left: none; border-bottom: none; }
.reticle-bl { bottom: 20px; left: 20px; border-right: none; border-top: none; }
.reticle-br { bottom: 20px; right: 20px; border-left: none; border-top: none; }

.camera-controls {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* File Upload tab styles */
.dropzone {
  border: 2px dashed var(--color-bronze);
  border-radius: 8px;
  padding: 4rem 2rem;
  text-align: center;
  background: rgba(4, 13, 9, 0.4);
  cursor: pointer;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--color-emerald);
  background: rgba(16, 185, 129, 0.05);
  box-shadow: inset 0 0 20px rgba(16, 185, 129, 0.1);
}

.dropzone-icon {
  font-size: 3rem;
  color: var(--color-gold);
  margin-bottom: 1.5rem;
  display: block;
}

.dropzone p {
  margin-bottom: 1rem;
  color: var(--color-text-muted);
}

.dropzone .browse-text {
  color: var(--color-gold);
  text-decoration: underline;
  cursor: pointer;
}

#file-input {
  display: none;
}

/* File selection preview */
.file-preview-card {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--color-glass-border);
  padding: 1rem;
  border-radius: 6px;
  margin-top: 1.5rem;
  animation: fadeIn 0.3s ease;
}

.file-preview-card img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--color-bronze);
}

.file-details {
  flex-grow: 1;
}

.file-name {
  font-weight: 500;
  margin-bottom: 0.25rem;
  word-break: break-all;
}

.file-size {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* Uploading states */
.progress-container {
  width: 100%;
  margin-top: 1.5rem;
  display: none;
}

.progress-bar-wrapper {
  width: 100%;
  height: 6px;
  background: var(--color-jungle-dark);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-gold), var(--color-emerald));
  border-radius: 3px;
  transition: width 0.2s ease;
  box-shadow: 0 0 8px var(--color-emerald-glow);
}

.progress-text {
  text-align: right;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 0.4rem;
}

/* Toast Messages */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: rgba(7, 21, 14, 0.95);
  border: 1px solid var(--color-gold);
  border-radius: 6px;
  padding: 1rem 1.5rem;
  box-shadow: 0 10px 25px rgba(0,0,0,0.6);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  transform: translateY(100px);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
  pointer-events: none;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.success {
  border-color: var(--color-emerald);
  box-shadow: 0 5px 20px rgba(16, 185, 129, 0.2);
}

.toast.success::before {
  content: "✓";
  color: var(--color-emerald);
  font-weight: bold;
}

.toast.error {
  border-color: #ef4444;
  box-shadow: 0 5px 20px rgba(239, 68, 68, 0.2);
}

.toast.error::before {
  content: "✗";
  color: #ef4444;
  font-weight: bold;
}

.toast.info {
  border-color: var(--color-gold);
  box-shadow: 0 5px 20px rgba(197, 168, 128, 0.2);
}

.toast.info::before {
  content: "⚡";
  color: var(--color-gold);
  font-weight: bold;
}

/* Nav links on top */
.nav-bar {
  display: flex;
  justify-content: flex-end;
  max-width: 900px;
  width: 95%;
  margin: 1.5rem auto 0;
  z-index: 2;
  position: relative;
}

.nav-link {
  color: var(--color-gold);
  text-decoration: none;
  font-family: var(--font-title);
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition-quick);
  border: 1px solid var(--color-glass-border);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.2);
}

.nav-link:hover {
  color: var(--color-text-light);
  border-color: var(--color-gold);
  box-shadow: 0 0 10px var(--color-gold-glow);
}

/* Camera tab placeholder */
.camera-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(12, 28, 20, 0.9) 0%, rgba(4, 13, 9, 0.95) 100%);
  color: var(--color-text-muted);
  gap: 0.8rem;
  padding: 2rem;
  text-align: center;
  transition: var(--transition-smooth);
}

.placeholder-icon {
  font-size: 3.5rem;
  filter: drop-shadow(0 0 10px var(--color-gold-glow));
  animation: floatAnim 4s ease-in-out infinite;
}

.placeholder-text {
  font-family: var(--font-title);
  color: var(--color-gold);
  font-size: 1.3rem;
  text-shadow: 0 0 8px var(--color-gold-glow);
  letter-spacing: 0.05em;
}

.placeholder-subtext {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  font-family: var(--font-body);
}

@keyframes floatAnim {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* PWA Banner Styles */
.pwa-install-banner {
  position: fixed;
  bottom: -220px; /* Hidden offscreen initially */
  left: 50%;
  transform: translateX(-50%);
  width: 92%;
  max-width: 520px;
  background: linear-gradient(135deg, rgba(12, 28, 20, 0.98) 0%, rgba(4, 13, 9, 0.98) 100%);
  border: 2px solid var(--color-bronze);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8), 0 0 15px var(--color-gold-glow);
  border-radius: 12px;
  padding: 1.2rem;
  z-index: 999;
  transition: bottom 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
  opacity: 0;
  backdrop-filter: blur(10px);
}

.pwa-install-banner.show-banner {
  bottom: 2rem;
  opacity: 1;
}

.pwa-banner-content {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  position: relative;
}

.pwa-icon {
  font-size: 2.2rem;
  background: rgba(197, 168, 128, 0.12);
  border: 1px solid var(--color-glass-border);
  width: 55px;
  height: 55px;
  min-width: 55px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px var(--color-gold-glow);
}

.pwa-text {
  flex-grow: 1;
}

.pwa-text h3 {
  font-size: 1.05rem;
  margin-bottom: 0.15rem;
  color: var(--color-gold);
}

.pwa-text p {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-family: var(--font-body);
  line-height: 1.4;
}

.pwa-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.btn-pwa-action {
  font-size: 0.8rem;
  padding: 0.4rem 1rem;
}

.btn-pwa-close {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-family: var(--font-body);
  font-size: 0.75rem;
  cursor: pointer;
  text-decoration: underline;
  text-align: center;
  padding: 0.25rem;
  transition: var(--transition-quick);
}

.btn-pwa-close:hover {
  color: var(--color-text-light);
}

/* Adjustments for smaller screens */
@media (max-width: 480px) {
  .pwa-banner-content {
    flex-direction: column;
    text-align: center;
  }
  .pwa-icon {
    margin: 0 auto;
  }
  .pwa-buttons {
    width: 100%;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 1.2rem;
    margin-top: 0.6rem;
  }
  .pwa-install-banner.show-banner {
    bottom: 1rem;
  }
}

