/* Premium Glassmorphism Dark Mode Theme for SHLX */
:root {
  --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #020617 100%);
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-hover: rgba(255, 255, 255, 0.15);
  --glass-glow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  /* Neon Colors */
  --neon-blue: #38bdf8;
  --neon-purple: #c084fc;
  --neon-green: #4ade80;
  --neon-orange: #fb923c;
  --neon-gold: #facc15;
  --neon-grey: #94a3b8;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Glassmorphism Common Styles */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-glow);
  border-radius: 16px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-panel:hover {
  border-color: var(--glass-border-hover);
}

/* Layout */
.container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 24px;
}

/* Header Area */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 28px;
  margin-bottom: 24px;
}

.logo-section h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, #38bdf8, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-section p {
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: 4px;
}

.stats-bar {
  display: flex;
  gap: 16px;
}

/* Quick Navigation in Header */
.quick-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}

.nav-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.01);
  transition: all 0.2s ease-in-out;
}

.nav-btn:hover {
  background: rgba(56, 189, 248, 0.08);
  border-color: var(--neon-blue);
  color: var(--neon-blue);
  transform: translateY(-1px);
}

.nav-btn i {
  font-size: 11px;
}

.stat-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 20px;
  min-width: 100px;
}

.stat-value {
  font-size: 20px;
  font-weight: 700;
}

.stat-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

/* Dashboard Board and Columns */
.board {
  display: grid;
  gap: 20px;
  align-items: start;
  min-height: 70vh;
}

/* Auto layouts depending on columns count */
.board-4-cols {
  grid-template-columns: repeat(4, minmax(280px, 1fr));
}

.board-2-cols {
  grid-template-columns: repeat(2, minmax(350px, 1fr));
}

.board-column {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 600px;
  padding: 16px;
}

.column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.column-title {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.column-badge {
  font-size: 12px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 8px;
  border-radius: 9999px;
  color: var(--text-secondary);
}

.candidates-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(65px, 1fr));
  gap: 8px;
  align-content: flex-start;
  flex-grow: 1;
  overflow-y: auto;
  max-height: 680px;
  padding: 6px;
}

/* Custom Scrollbar for columns */
.candidates-list::-webkit-scrollbar {
  width: 4px;
}

.candidates-list::-webkit-scrollbar-track {
  background: transparent;
}

.candidates-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 99px;
}

/* Column Glow Effects */
.col-cho-thi { border-top: 4px solid var(--neon-grey); }
.col-ly-thuyet { border-top: 4px solid var(--neon-blue); }
.col-mo-phong { border-top: 4px solid var(--neon-purple); }
.col-sa-hinh { border-top: 4px solid var(--neon-green); }
.col-duong-truong { border-top: 4px solid var(--neon-orange); }
.col-thuc-hanh { border-top: 4px solid var(--neon-green); }
.col-hoan-thanh { border-top: 4px solid var(--neon-gold); }

/* Candidate Card */
.candidate-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: grab;
}

.candidate-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.2);
}

.candidate-card.newly-moved {
  animation: highlightGlow 1.5s ease-out;
}

@keyframes highlightGlow {
  0% {
    box-shadow: 0 0 0 0px rgba(56, 189, 248, 0.4);
    border-color: var(--neon-blue);
    background: rgba(56, 189, 248, 0.15);
  }
  100% {
    box-shadow: 0 0 0 10px rgba(56, 189, 248, 0);
    border-color: var(--glass-border);
    background: rgba(255, 255, 255, 0.02);
  }
}

.candidate-sbd-display {
  font-size: 18px;
  font-weight: 800;
  margin: 0;
  padding: 0;
  color: var(--neon-blue);
  letter-spacing: 0.5px;
  line-height: 1;
}

.candidate-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11px;
  color: var(--text-secondary);
}

.badge {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
}

.badge-sbd {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.2);
  color: var(--neon-blue);
  font-weight: 700;
}

.badge-hang {
  background: rgba(192, 132, 252, 0.1);
  border-color: rgba(192, 132, 252, 0.2);
  color: var(--neon-purple);
}

.candidate-time {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 10px;
  color: var(--text-muted);
}

/* Upload Interface Styles */
.upload-container {
  max-width: 600px;
  margin: 100px auto;
  padding: 40px;
  text-align: center;
}

.upload-icon {
  font-size: 48px;
  color: var(--neon-blue);
  margin-bottom: 20px;
}

.upload-box {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 30px;
  margin: 24px 0;
  cursor: pointer;
  transition: all 0.3s;
}

.upload-box:hover {
  border-color: var(--neon-blue);
  background: rgba(56, 189, 248, 0.02);
}

.btn {
  background: linear-gradient(135deg, #38bdf8 0%, #4f46e5 100%);
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.5);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  box-shadow: none;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: none;
}

.error-message {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  padding: 12px;
  border-radius: 8px;
  margin-top: 16px;
  font-size: 14px;
}

/* Scanner Interface Styles */
.scanner-container {
  max-width: 500px;
  margin: 40px auto;
  padding: 24px;
}

.scan-region {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  margin: 20px 0;
  border: 2px solid var(--glass-border);
  position: relative;
}

#reader {
  width: 100% !important;
  height: 100% !important;
}

.scan-laser {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--neon-blue);
  box-shadow: 0 0 10px var(--neon-blue);
  animation: laserScan 2s linear infinite;
  z-index: 10;
  pointer-events: none;
}

@keyframes laserScan {
  0% { top: 0%; }
  50% { top: 100%; }
  100% { top: 0%; }
}

.scanner-info {
  text-align: center;
  margin-top: 16px;
}

.gun-input-box {
  width: 1px;
  height: 1px;
  opacity: 0.01;
  position: absolute;
  left: -9999px;
}

.feedback-flash {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(74, 222, 128, 0.2);
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}

.feedback-flash.flash-active {
  opacity: 1;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--neon-blue);
  padding: 12px 24px;
  border-radius: 30px;
  box-shadow: var(--glass-glow);
  z-index: 9999;
  animation: slideUp 0.3s forwards;
}

@keyframes slideUp {
  from { bottom: 0; opacity: 0; }
  to { bottom: 24px; opacity: 1; }
}

/* Utilities */
.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }

/* Responsive adjustments */
@media (max-width: 1200px) {
  .board-4-cols {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 768px) {
  .board-4-cols, .board-2-cols {
    grid-template-columns: 1fr;
  }
  .header {
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
    text-align: center;
  }
  .stats-bar {
    justify-content: center;
  }
  .quick-nav {
    align-items: center;
  }
  .nav-links {
    justify-content: center;
  }
}

/* Quick Search Styles */
.search-bar-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 180px;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  width: 100%;
  padding: 8px 32px 8px 32px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  outline: none;
  transition: all 0.3s;
}

.search-input:focus {
  border-color: var(--neon-blue);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.search-icon {
  position: absolute;
  left: 12px;
  font-size: 12px;
  color: var(--text-muted);
  pointer-events: none;
}

.clear-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.clear-btn:hover {
  color: var(--neon-orange);
}

/* Highlight effects */
.board.search-active .candidate-card {
  opacity: 0.15;
  filter: blur(0.5px);
}

.board.search-active .candidate-card.search-match {
  opacity: 1;
  filter: none;
  transform: scale(1.1);
  border-color: var(--neon-gold) !important;
  box-shadow: 0 0 15px rgba(250, 204, 21, 0.7);
  z-index: 100;
}
