/* ==========================================================================
   JAM_SPINNER // STYLE CODE
   Modern Cyber-Arcade Aesthetic (Vibrant Gradients & Flat Glassmorphism)
   ========================================================================== */

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

  /* Colors */
  --bg-deep: #0a071b;
  --bg-deck: #120e2e;
  --bg-panel: rgba(22, 18, 56, 0.7);
  --bg-header: #1b1544;
  
  --color-cyan: #00f0ff;
  --color-pink: #ff007f;
  --color-violet: #7000ff;
  
  --grad-primary: linear-gradient(135deg, var(--color-cyan) 0%, var(--color-pink) 100%);
  --grad-panel: linear-gradient(180deg, rgba(30, 24, 76, 0.6) 0%, rgba(18, 14, 46, 0.8) 100%);
  
  --text-primary: #f0edff;
  --text-muted: #8d87b3;
  --text-active: #ffffff;
  
  --shadow-glow-cyan: 0 0 15px rgba(0, 240, 255, 0.45);
  --shadow-glow-pink: 0 0 15px rgba(255, 0, 127, 0.45);
  --shadow-deck: 0 12px 40px rgba(0, 0, 0, 0.6);

  --border-radius: 8px;
  --transition-normal: 0.3s 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.2);
}
::-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-cyan);
}

/* Selection */
::selection {
  background-color: var(--color-pink);
  color: #fff;
}

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

/* Subtle background accent glow behind app */
.app-deck::before {
  content: '';
  position: absolute;
  top: -10%;
  left: 20%;
  width: 60%;
  height: 20%;
  background: linear-gradient(90deg, var(--color-cyan), var(--color-pink));
  filter: blur(120px);
  opacity: 0.15;
  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, 255, 255, 0.05);
  border-radius: var(--border-radius);
  height: 60px;
  padding: 0 20px;
  z-index: 10;
}

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

.arcade-logo {
  color: var(--color-cyan);
  filter: drop-shadow(0 0 5px rgba(0, 240, 255, 0.5));
}

.header-logo h1 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 1px;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

.header-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

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

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

/* --- Left: Slots Board Area --- */
.slots-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 0;
}

.slots-reel-board {
  flex-grow: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  min-height: 0;
}

/* Individual Slot Reel Card */
.slot-reel {
  background: var(--grad-panel);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.slot-reel:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.slot-reel.locked {
  border-color: var(--color-pink);
  box-shadow: inset 0 0 15px rgba(255, 0, 127, 0.15);
}

/* Reel Header & Category tags */
.reel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background-color: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.category-tag {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-muted);
}

.slot-reel.locked .category-tag {
  color: var(--color-pink);
}

/* Lock 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-cyan);
}

.slot-reel.locked .lock-btn {
  color: var(--color-pink);
  filter: drop-shadow(0 0 4px var(--color-pink));
}

/* Viewport containing rolling values */
.reel-viewport {
  flex-grow: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 8px 16px rgba(0,0,0,0.5), inset 0 -8px 16px rgba(0,0,0,0.5);
  padding: 0 16px;
}

/* Moving strip of name options */
.reel-strip {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

.reel-strip.rolling {
  filter: blur(1.5px);
}

/* The card values inside reel viewports */
.reel-card {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-cyan);
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
  word-break: break-word;
  user-select: none;
}

.slot-reel.locked .reel-card {
  color: var(--color-pink);
  text-shadow: 0 0 8px rgba(255, 0, 127, 0.3);
}

/* --- Dashboard Button Action Row --- */
.action-dock {
  display: flex;
  gap: 16px;
}

/* Big Spin Button */
.spin-btn {
  flex: 1;
  height: 60px;
  background: var(--grad-primary);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 1px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0, 240, 255, 0.25);
  transition: all var(--transition-normal);
}

.spin-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 240, 255, 0.45);
}

.spin-btn:active {
  transform: translateY(1px);
  box-shadow: 0 3px 10px rgba(0, 240, 255, 0.2);
}

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

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

/* Share Button */
.share-btn {
  width: 180px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.share-btn:hover:not(:disabled) {
  background-color: rgba(255, 255, 255, 0.06);
  border-color: var(--color-cyan);
  box-shadow: var(--shadow-glow-cyan);
}

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

/* --- Right: History Sidebar logs --- */
.history-container {
  background: var(--bg-panel);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.sidebar-header {
  height: 52px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  background-color: rgba(0, 0, 0, 0.15);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-header h2 {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.count-badge {
  background-color: var(--color-cyan);
  color: var(--bg-deep);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
}

.history-body {
  flex-grow: 1;
  overflow-y: auto;
  padding: 12px;
}

.hist-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

/* History mini card item */
.hist-item {
  background-color: rgba(0,0,0,0.18);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
  animation: slide-in 0.2s ease-out forwards;
}

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

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

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

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

.toast-popup span {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-cyan);
}

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

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

@keyframes toast-reveal {
  from {
    bottom: -10px;
    opacity: 0;
  }
  to {
    bottom: 24px;
    opacity: 1;
  }
}

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

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

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

  .slots-reel-board {
    grid-template-columns: repeat(2, 1fr);
  }

  .slot-reel {
    height: 180px;
  }

  .hist-list {
    max-height: 250px;
    overflow-y: auto;
  }
}

@media (max-width: 500px) {
  .slots-reel-board {
    grid-template-columns: 1fr;
  }
  
  .app-deck {
    padding: 12px;
  }
  
  .action-dock {
    flex-direction: column;
  }
  
  .share-btn {
    width: 100%;
    height: 48px;
  }
}
