/* ==========================================================================
   BOUNTY_DECK // STYLE CODE
   Industrial Cyber-Guild Bounty Aesthetic (Hazard Orange & Steel Panels)
   ========================================================================== */

/* --- Custom Variables & Theme Tokens --- */
:root {
  --font-sans: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Color System */
  --bg-deep: #08080c;
  --bg-deck: #111116;
  --bg-panel: rgba(22, 22, 30, 0.75);
  --bg-header: #1d1d29;

  --color-orange: #ff5500;     /* Hazard Orange */
  --color-orange-dim: #7f2b00;
  --color-amber: #ffcc00;      /* Warning Gold */
  
  --text-primary: #e6e5f3;
  --text-muted: #838299;
  --text-active: #ffffff;
  
  --shadow-glow: 0 0 12px rgba(255, 85, 0, 0.4);
  --shadow-deck: 0 12px 40px rgba(0, 0, 0, 0.7);

  --border-radius: 6px;
  --transition-normal: 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
  --transition-fast: 0.15s ease;
}

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

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-deep);
  font-family: var(--font-sans);
  color: var(--text-primary);
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.3);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-header);
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.05);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-orange);
}

/* --- App Deck Wrapper --- */
.bounty-deck {
  width: 95vw;
  height: 90vh;
  max-width: 1200px;
  max-height: 800px;
  background-color: var(--bg-deck);
  border: 1px solid rgba(255, 85, 0, 0.12);
  border-radius: 12px;
  box-shadow: var(--shadow-deck), 0 0 15px rgba(255, 85, 0, 0.05);
  display: flex;
  flex-direction: column;
  padding: 20px;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

/* Hazard orange ambient glow behind app */
.bounty-deck::before {
  content: '';
  position: absolute;
  top: -15%;
  left: 20%;
  width: 60%;
  height: 30%;
  background: radial-gradient(circle, rgba(255, 85, 0, 0.05) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
}

/* --- Top Header Navigation --- */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--bg-header);
  border: 1px solid rgba(255, 85, 0, 0.1);
  border-radius: var(--border-radius);
  height: 52px;
  padding: 0 16px;
  z-index: 10;
}

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

.bounty-logo {
  color: var(--color-orange);
  filter: drop-shadow(0 0 4px var(--color-orange));
}

.header-logo h1 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--text-active);
}

.header-actions {
  display: flex;
  gap: 12px;
}

.header-btn {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 85, 0, 0.18);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.header-btn:hover {
  border-color: var(--color-orange);
  color: var(--color-orange);
  box-shadow: var(--shadow-glow);
}

/* --- Workspace Layout --- */
.bounty-workspace {
  flex-grow: 1;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
  min-height: 0;
  z-index: 5;
}

/* --- Left Column: Configurations & Logs --- */
.controls-panel {
  background: var(--bg-panel);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  backdrop-filter: blur(3px);
}

.panel-header {
  height: 44px;
  background-color: rgba(0, 0, 0, 0.15);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  padding: 0 16px;
}

.panel-header h2 {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-muted);
}

.panel-body {
  flex-grow: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.group-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--text-muted);
}

/* Theme Select */
.bounty-select {
  background-color: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 85, 0, 0.15);
  border-radius: var(--border-radius);
  padding: 8px 10px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  outline: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.bounty-select:focus {
  border-color: var(--color-orange);
  box-shadow: var(--shadow-glow);
}

/* Primary generate button */
.btn-primary {
  height: 48px;
  background: var(--color-orange-dim);
  border: 1px solid var(--color-orange);
  color: var(--text-active);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  border-radius: var(--border-radius);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(255, 85, 0, 0.15);
  transition: all var(--transition-normal);
  flex-shrink: 0;
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--color-orange);
  color: var(--bg-deep);
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

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

.btn-primary:disabled {
  opacity: 0.25;
  cursor: not-allowed;
  transform: none;
}

.btn-flare {
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.25),
    transparent
  );
}

.btn-primary:hover .btn-flare {
  left: 150%;
  transition: left 0.75s ease-in-out;
}

/* --- History list logs --- */
.history-log-section {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  padding-top: 14px;
}

.log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.export-logs-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 3px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.export-logs-btn:hover:not(:disabled) {
  border-color: var(--color-orange);
  color: var(--color-orange);
}

.export-logs-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.hist-list {
  flex-grow: 1;
  overflow-y: auto;
  background-color: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--border-radius);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.empty-log-msg {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 40px;
  line-height: 1.4;
}

/* Mini history rows */
.hist-item {
  background-color: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.02);
  border-radius: 4px;
  padding: 8px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: all var(--transition-fast);
  animation: slide-in 0.15s ease-out forwards;
}

.hist-item:hover {
  border-color: var(--color-orange);
  background-color: rgba(255, 255, 255, 0.01);
}

.hist-item-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
}

.hist-item-desc {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Right Column: Board Panel & Reels --- */
.board-panel {
  background: var(--bg-panel);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 16px;
  gap: 16px;
}

.bounty-board {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

/* Horizontal Slot Row */
.bounty-slot {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--border-radius);
  display: flex;
  flex-direction: column;
  height: calc(20% - 10px); /* 5 slots equally spaced */
  min-height: 72px;
  overflow: hidden;
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.bounty-slot:hover {
  border-color: rgba(255,255,255,0.08);
}

.bounty-slot.locked {
  border-color: var(--color-orange);
  box-shadow: inset 0 0 10px rgba(255, 85, 0, 0.15);
}

/* Slot header row */
.slot-header {
  height: 24px;
  background-color: rgba(0,0,0,0.25);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 12px;
}

.slot-tag {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.bounty-slot.locked .slot-tag {
  color: var(--color-orange);
}

/* Lock Padlock button */
.lock-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.lock-btn:hover {
  color: var(--color-orange);
}

.bounty-slot.locked .lock-btn {
  color: var(--color-orange);
  filter: drop-shadow(0 0 3px var(--color-orange));
}

/* Viewport for vertical rolling strips */
.slot-viewport {
  flex-grow: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  background-color: rgba(0,0,0,0.15);
  box-shadow: inset 0 4px 8px rgba(0,0,0,0.3), inset 0 -4px 8px rgba(0,0,0,0.3);
  padding: 0 16px;
}

.slot-strip {
  display: flex;
  flex-direction: column;
  width: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

.slot-strip.rolling {
  filter: blur(1px);
}

/* Slot cards inside viewports */
.slot-card {
  display: flex;
  align-items: center;
  width: 100%;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-amber);
  text-shadow: 0 0 6px rgba(255, 204, 0, 0.25);
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bounty-slot.locked .slot-card {
  color: var(--color-orange);
  text-shadow: 0 0 6px rgba(255, 85, 0, 0.25);
}

/* Export dock row */
.export-dock {
  height: 48px;
  background-color: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 10px;
}

.export-btn, .export-btn-sub {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all var(--transition-fast);
  background: transparent;
}

.export-btn {
  border: 1px solid rgba(255, 85, 0, 0.35);
  color: var(--color-orange);
}

.export-btn:hover:not(:disabled) {
  background-color: rgba(255, 85, 0, 0.08);
  border-color: var(--color-orange);
  box-shadow: var(--shadow-glow);
}

.export-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.export-btn-sub {
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-muted);
}

.export-btn-sub:hover {
  border-color: rgba(255,255,255,0.2);
  color: var(--text-primary);
}

#copy-btn {
  margin-right: auto; /* push reset locks to right */
}

/* --- Toast Popups --- */
.toast {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--bg-header);
  border: 1px solid var(--color-orange);
  box-shadow: var(--shadow-glow);
  border-radius: var(--border-radius);
  padding: 10px 24px;
  z-index: 1000;
  animation: slide-up 0.25s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}

.toast span {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-orange);
}

/* --- Common Keyframes --- */
.hidden {
  display: none !important;
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slide-up {
  from {
    bottom: -10px;
    opacity: 0;
  }
  to {
    bottom: 20px;
    opacity: 1;
  }
}

/* --- Responsive Media breaks --- */
@media (max-width: 900px) {
  body, html {
    overflow-y: auto;
    align-items: flex-start;
  }

  .bounty-deck {
    height: auto;
    max-height: none;
    margin: 20px 0;
  }

  .bounty-workspace {
    grid-template-columns: 1fr;
  }

  .bounty-slot {
    height: 80px;
  }

  .hist-list {
    max-height: 200px;
  }
}
