:root {
  --bg-dark: #090c14;
  --bg-card: rgba(18, 24, 38, 0.85);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-hover: rgba(255, 255, 255, 0.2);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --accent-cyan: #0ea5e9;
  --accent-blue: #3b82f6;
  --accent-green: #10b981;
  --accent-red: #ef4444;

  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  --radius-lg: 14px;
  --radius-md: 8px;
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.4;
}

/* Ambient glow */
.glow-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(140px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.25;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #3b82f6 0%, transparent 70%);
  top: 0;
  left: -150px;
}

.orb-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #0ea5e9 0%, transparent 70%);
  bottom: 10%;
  right: -200px;
}

.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
}

/* Sticky Compact Top Bar */
.compact-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.count-pill {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

.header-hint {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.global-view-toggle {
  display: flex;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 5px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--font-body);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.toggle-btn.active {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.btn-bulk-download {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 13px;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.3);
  transition: all 0.2s;
}

.btn-bulk-download:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* Vertical Feed Container */
.rooms-container {
  max-width: 980px;
  margin: 0 auto;
  padding: 20px 16px 60px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: relative;
  z-index: 1;
}

/* Room Card */
.room-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  background: rgba(14, 20, 32, 0.9);
  transition: border-color 0.2s;
}

.room-card:hover {
  border-color: var(--glass-border-hover);
}

/* Card Header with Sequential Number & Download Buttons */
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid var(--glass-border);
  flex-wrap: wrap;
  gap: 8px;
}

.room-number-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.room-num-badge {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.95rem;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 2px 9px;
  border-radius: 6px;
}

.room-name-text {
  font-weight: 700;
  font-size: 0.95rem;
  color: #f1f5f9;
}

.card-downloads {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: var(--font-body);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.card-dl-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.15);
}

.card-dl-btn:active {
  transform: translateY(1px);
}

.btn-dl-before {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.btn-dl-after {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
}

.btn-dl-combo {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Comparison Viewer on each card */
.comparison-box {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  max-height: 580px;
  min-height: 300px;
  overflow: hidden;
  user-select: none;
  background: #000;
  touch-action: pan-y;
}

.layer-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.layer-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.layer-before {
  width: 50%;
  overflow: hidden;
  z-index: 2;
  will-change: width;
}

.layer-before img {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--card-stage-width, 1000px);
  height: 100%;
  max-width: none;
}

.layer-after {
  z-index: 1;
}

/* Compact pill labels */
.tag-pill {
  position: absolute;
  top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10;
  pointer-events: none;
}

.tag-left {
  left: 12px;
  background: rgba(239, 68, 68, 0.4);
  border: 1px solid rgba(239, 68, 68, 0.6);
  color: #fca5a5;
}

.tag-right {
  right: 12px;
  background: rgba(16, 185, 129, 0.4);
  border: 1px solid rgba(16, 185, 129, 0.6);
  color: #6ee7b7;
}

/* Slider Line & Handle */
.slider-handle-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 36px;
  transform: translateX(-50%);
  z-index: 20;
  cursor: ew-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  will-change: left;
}

.slider-handle-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #ffffff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.9), 0 0 4px rgba(0, 0, 0, 0.8);
}

.slider-handle-knob {
  width: 34px;
  height: 34px;
  background: rgba(15, 23, 42, 0.9);
  border: 2px solid #ffffff;
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), 0 0 10px rgba(56, 189, 248, 0.6);
  transition: transform 0.15s, background 0.15s;
  z-index: 2;
}

.slider-handle-divider:hover .slider-handle-knob,
.slider-handle-divider.active .slider-handle-knob {
  transform: scale(1.15);
  background: #0284c7;
}

/* Side by side state */
.comparison-box.is-side-by-side {
  display: flex;
}

.comparison-box.is-side-by-side .layer-img {
  position: relative;
  width: 50%;
  height: 100%;
}

.comparison-box.is-side-by-side .layer-before img,
.comparison-box.is-side-by-side .layer-after img {
  position: static;
  width: 100%;
  height: 100%;
}

.comparison-box.is-side-by-side .slider-handle-divider {
  display: none;
}

/* Toast */
.toast-msg {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e293b;
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #f8fafc;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  z-index: 1000;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideToast 0.25s ease forwards;
}

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

@media (max-width: 640px) {
  .compact-header {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .header-left, .header-right {
    justify-content: space-between;
  }
  .card-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .card-downloads {
    width: 100%;
    justify-content: space-between;
  }
  .card-dl-btn {
    flex: 1;
    justify-content: center;
    padding: 6px 8px;
    font-size: 0.72rem;
  }
}
