/* ==========================================================================
   BILL PROCEDURE - ULTRA-PREMIUM CLEAN MINIMAL GAME DESIGN
   Obsidian Dark, Minimalist Glassmorphic Cards, Neon Accents, Tactile UX
   ========================================================================== */

:root {
  /* Premium Dark Color Palette */
  --bg-dark: #070a12;
  --bg-card: rgba(16, 24, 40, 0.65);
  --bg-card-hover: rgba(23, 34, 56, 0.8);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.05);

  --accent-cyan: #06b6d4;
  --accent-indigo: #6366f1;
  --accent-purple: #8b5cf6;
  
  --stage-final: #10b981;
  --stage-final-bg: rgba(16, 185, 129, 0.12);
  --stage-provisional: #f59e0b;
  --stage-provisional-bg: rgba(245, 158, 11, 0.12);
  --stage-cancel: #f43f5e;
  --stage-cancel-bg: rgba(244, 63, 94, 0.12);

  --text-main: #f8fafc;
  --text-sub: #94a3b8;
  --text-muted: #475569;

  --xp-gold: #fbbf24;
  --streak-flame: #ff6b35;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 9999px;

  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* Reset & Base Setup */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  min-height: -webkit-fill-available;
  display: flex;
  flex-direction: column;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.1) 0%, transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(6, 182, 212, 0.08) 0%, transparent 45%);
  background-attachment: fixed;
  overflow-x: hidden;
  padding-top: var(--safe-top);
  padding-bottom: calc(76px + var(--safe-bottom));
}

/* Minimal Top App Bar */
.game-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 10, 18, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-glass);
  padding: 12px 18px;
}

.top-bar-content {
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-cyan));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.3);
}

.app-title {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #ffffff;
}

.subtitle-badge {
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--accent-cyan);
  letter-spacing: 1px;
}

/* Minimal Control Buttons */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-sub);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn:active {
  transform: scale(0.92);
}

.icon-btn.active {
  color: var(--xp-gold);
  border-color: rgba(251, 191, 36, 0.4);
  background: rgba(251, 191, 36, 0.08);
}

/* Compact Daily Brain Dashboard */
.brain-bar-container {
  max-width: 560px;
  margin: 12px auto 0;
  padding: 0 16px;
  width: 100%;
}

.brain-card-compact {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius-md);
  padding: 10px 14px;
}

.brain-compact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.brain-score-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-sub);
}

.brain-score-pill strong {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  color: var(--xp-gold);
  font-weight: 900;
}

.brain-score-pill small {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--text-muted);
}

.streak-pill {
  background: rgba(255, 107, 53, 0.12);
  border: 1px solid rgba(255, 107, 53, 0.3);
  color: var(--streak-flame);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 4px;
}

.level-pill {
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.25);
  color: var(--accent-cyan);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 800;
}

.progress-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-top: 8px;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-indigo), var(--accent-cyan), var(--xp-gold));
  border-radius: var(--radius-pill);
  transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Main Container Layout */
.main-content {
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Minimal Card Container */
.app-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius-lg);
  padding: 18px;
}

.card-header-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
}

/* Input Section */
.bill-input-row {
  display: flex;
  gap: 10px;
}

.input-wrapper {
  position: relative;
  flex: 1;
}

.input-wrapper input {
  width: 100%;
  height: 48px;
  background: rgba(8, 12, 20, 0.8);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0 16px 0 40px;
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  outline: none;
  transition: all 0.2s ease;
}

.input-wrapper input:focus {
  border-color: var(--accent-indigo);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.25);
}

.input-wrapper .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  color: var(--text-muted);
}

/* High Contrast Primary Add Button */
.btn-primary {
  height: 48px;
  padding: 0 20px;
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple));
  border: none;
  border-radius: var(--radius-md);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-primary:active {
  transform: scale(0.95);
}

/* Stage Selector Pills (3-Way Toggle) */
.stage-selector-container {
  margin-top: 14px;
}

.stage-label {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
  display: block;
}

.stage-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.stage-btn {
  height: 42px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  background: rgba(8, 12, 20, 0.5);
  color: var(--text-sub);
  font-weight: 700;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.stage-btn:active {
  transform: scale(0.94);
}

.stage-btn[data-stage="Final"].active {
  background: var(--stage-final-bg);
  border-color: var(--stage-final);
  color: var(--stage-final);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
}

.stage-btn[data-stage="Provisional"].active {
  background: var(--stage-provisional-bg);
  border-color: var(--stage-provisional);
  color: var(--stage-provisional);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.2);
}

.stage-btn[data-stage="Cancel/Change"].active {
  background: var(--stage-cancel-bg);
  border-color: var(--stage-cancel);
  color: var(--stage-cancel);
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.2);
}

/* Bill Cards & Procedure Steps Feed */
.list-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.search-filter-input {
  width: 130px;
  height: 32px;
  background: rgba(8, 12, 20, 0.7);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-pill);
  padding: 0 12px;
  color: #fff;
  font-size: 0.78rem;
  outline: none;
}

.search-filter-input:focus {
  border-color: var(--accent-indigo);
}

.bills-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bill-card-item {
  background: rgba(16, 24, 40, 0.5);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 16px;
  position: relative;
  transition: all 0.2s ease;
  animation: slideIn 0.25s ease-out;
}

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

.bill-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.bill-no-badge {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bill-tag {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 900;
  color: #ffffff;
}

.stage-chip {
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.stage-chip[data-stage="Final"] {
  background: var(--stage-final-bg);
  color: var(--stage-final);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.stage-chip[data-stage="Provisional"] {
  background: var(--stage-provisional-bg);
  color: var(--stage-provisional);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.stage-chip[data-stage="Cancel/Change"] {
  background: var(--stage-cancel-bg);
  color: var(--stage-cancel);
  border: 1px solid rgba(244, 63, 94, 0.4);
}

.bill-date-time {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* Tactile 5 Procedure Checkbox Rows */
.steps-checklist {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.step-row-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(8, 12, 20, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 44px;
}

.step-row-item:active {
  transform: scale(0.98);
}

.step-row-item.checked {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.3);
}

.step-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.custom-checkbox {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1.5px solid var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: transparent;
  transition: all 0.2s ease;
}

.step-row-item.checked .custom-checkbox {
  background: var(--stage-final);
  border-color: var(--stage-final);
  color: #ffffff;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.step-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-sub);
}

.step-row-item.checked .step-label {
  color: #ffffff;
}

.step-xp-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.step-row-item.checked .step-xp-tag {
  color: var(--xp-gold);
}

/* Stage Clear Completion Banner */
.completion-banner {
  margin-top: 10px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid var(--stage-final);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--stage-final);
  font-weight: 800;
  font-size: 0.78rem;
}

/* Delete / Action Footer */
.bill-card-footer {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.delete-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
  transition: color 0.2s ease;
}

.delete-btn:hover {
  color: var(--stage-cancel);
}

/* Empty State Illustration */
.empty-state {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
  opacity: 0.6;
}

.empty-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-sub);
  margin-bottom: 4px;
}

/* Floating XP Popup Animation */
.xp-floater {
  position: fixed;
  pointer-events: none;
  z-index: 999;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--xp-gold);
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.6);
  animation: floatUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes floatUp {
  0% { opacity: 1; transform: translateY(0) scale(0.9); }
  50% { opacity: 1; transform: translateY(-24px) scale(1.1); }
  100% { opacity: 0; transform: translateY(-48px) scale(1); }
}

/* Minimal Bottom Mobile Navbar */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(60px + var(--safe-bottom));
  background: rgba(7, 10, 18, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-glass);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding-bottom: var(--safe-bottom);
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  flex: 1;
  height: 100%;
}

.nav-item.active {
  color: var(--accent-cyan);
}

.nav-icon {
  font-size: 1.1rem;
}

/* Modal Overlay for Game Stats / Badges */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: var(--bg-dark);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 440px;
  padding: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  transform: translateY(16px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-box {
  transform: translateY(0);
}

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

.modal-title {
  font-size: 1.1rem;
  font-weight: 800;
}

.badges-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.badge-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-icon {
  font-size: 1.4rem;
}

.badge-name {
  font-size: 0.78rem;
  font-weight: 800;
}

.badge-desc {
  font-size: 0.62rem;
  color: var(--text-muted);
}
