:root {
  --bg-dark: #0B0F19;
  --bg-card: rgba(22, 29, 45, 0.75);
  --bg-card-border: rgba(255, 255, 255, 0.08);
  --primary-teal: #00D2C8;
  --primary-magenta: #FF2B85;
  --primary-gradient: linear-gradient(135deg, #00D2C8 0%, #FF2B85 100%);
  --text-main: #FFFFFF;
  --text-muted: #94A3B8;
  --text-dim: #64748B;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;
  --font-family: 'Plus Jakarta Sans', 'Outfit', -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-family);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  padding-bottom: 60px;
}

/* Background Ambient Glows */
.ambient-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  z-index: -1;
  pointer-events: none;
}
.glow-1 {
  width: 400px;
  height: 400px;
  background: rgba(0, 210, 200, 0.15);
  top: -100px;
  left: -100px;
}
.glow-2 {
  width: 450px;
  height: 450px;
  background: rgba(255, 43, 133, 0.12);
  top: 300px;
  right: -150px;
}

.app-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 16px;
}

/* Glassmorphism Cards */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  padding: 24px;
  margin-bottom: 24px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Header Bar */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}
.brand-badge {
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand-logo-img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(0, 210, 200, 0.4));
}
.brand-title h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 1px;
}
.brand-title h1 span {
  color: var(--primary-teal);
  font-size: 1.5rem;
}
.tagline {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.status-pills {
  display: flex;
  gap: 10px;
}
.status-pill {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 6px;
}
.status-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #EF4444;
}
.status-pill.online .dot {
  background: #10B981;
  box-shadow: 0 0 8px #10B981;
}

/* Buttons */
.btn {
  font-family: var(--font-family);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}
.btn-primary {
  background: var(--primary-teal);
  color: #05181E;
}
.btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 16px rgba(0, 210, 200, 0.4);
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}
.btn-gradient {
  background: var(--primary-gradient);
  color: #FFFFFF;
  box-shadow: 0 4px 20px rgba(255, 43, 133, 0.3);
}
.btn-gradient:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(255, 43, 133, 0.5);
}
.btn-lg {
  padding: 16px 28px;
  font-size: 1.1rem;
  border-radius: 16px;
}
.btn-sm {
  padding: 8px 14px;
  font-size: 0.8rem;
}

/* Logo Settings Card */
.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.header-icon {
  font-size: 1.5rem;
}
.logo-settings-grid {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px;
  align-items: center;
}
@media (max-width: 600px) {
  .logo-settings-grid {
    grid-template-columns: 1fr;
  }
}
.logo-preview-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: rgba(0,0,0,0.3);
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px dashed rgba(255,255,255,0.15);
}
.logo-preview-box img {
  max-width: 100px;
  max-height: 100px;
  object-fit: contain;
}

.input-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 500;
}

.position-selector {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.pos-btn {
  padding: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}
.pos-btn.active {
  background: rgba(0, 210, 200, 0.15);
  border-color: var(--primary-teal);
  color: var(--primary-teal);
  font-weight: 600;
}

/* Batch Header */
.batch-header-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 30px 0 20px;
  flex-wrap: wrap;
  gap: 16px;
}
.batch-title-group h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
}
.batch-title-group p {
  font-size: 0.9rem;
  color: var(--text-muted);
}
.batch-actions {
  display: flex;
  gap: 12px;
}

/* Empty Card */
.empty-card {
  text-align: center;
  padding: 50px 20px;
}
.empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.8;
}

/* Items Grid */
.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.item-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.item-photo-wrapper {
  position: relative;
  width: 100%;
  height: 240px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
}
.item-photo-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.watermark-badge-preview {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6));
}

.code-overlay-badge {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(13, 17, 23, 0.85);
  border: 1px solid var(--primary-teal);
  color: #FFF;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
}

/* Control Options inside Item Card */
.item-control-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pill-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.pill-btn {
  padding: 6px 12px;
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
}
.pill-btn.active {
  background: rgba(255, 43, 133, 0.2);
  border-color: var(--primary-magenta);
  color: var(--text-main);
  font-weight: 600;
}

.sku-input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  color: #FFF;
  font-size: 0.9rem;
  font-family: inherit;
}
.sku-input:focus {
  outline: none;
  border-color: var(--primary-teal);
}

/* Generation Bar & Toggle */
.generation-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.campaign-options-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* Switch Toggle */
.switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
}
.switch input { display:none; }
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255,255,255,0.15);
  transition: .4s;
  border-radius: 34px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}
input:checked + .slider {
  background: var(--primary-gradient);
}
input:checked + .slider:before {
  transform: translateX(24px);
}

.scene-option-group {
  margin-bottom: 20px;
}
.scene-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.scene-btn {
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.2s ease;
}
.scene-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.scene-btn.active {
  background: rgba(0, 210, 200, 0.18);
  border-color: var(--primary-teal);
  color: var(--primary-teal);
  font-weight: 600;
  box-shadow: 0 0 12px rgba(0, 210, 200, 0.25);
}

.action-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* Modal Overlays */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(5, 10, 20, 0.85);
  backdrop-filter: blur(12px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-content {
  max-width: 500px;
  width: 100%;
  text-align: center;
  position: relative;
}

.loader-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-left-color: var(--primary-teal);
  border-right-color: var(--primary-magenta);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.progress-bar-container {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  overflow: hidden;
  margin: 20px 0 10px;
}
.progress-bar-fill {
  height: 100%;
  background: var(--primary-gradient);
  transition: width 0.3s ease;
}

/* Gallery Modal */
.gallery-modal-content {
  max-width: 900px;
  text-align: left;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 2rem;
  cursor: pointer;
}
.close-btn:hover { color: #FFF; }
.modal-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.gallery-card {
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  border: 1px solid var(--bg-card-border);
}
.gallery-card img {
  width: 100%;
  height: 260px;
  object-fit: cover;
}
.gallery-info {
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.gallery-info .sku-tag {
  font-weight: 700;
  color: var(--primary-teal);
  font-size: 0.9rem;
}
