/* ============================================================
   CỔNG NẠP FW XIAOZHI — Global Stylesheet
   Dark Cyberpunk / Neon Tech Theme
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;600;700;900&family=Inter:wght@300;400;500;600&display=swap');

/* ─── CSS Variables ─────────────────────────────────────────── */
:root {
  --bg-base: #050a10;
  --bg-card: #0b1420;
  --bg-card-hover: #0f1e30;
  --border: #1a3a5c;
  --border-glow: #00d4ff;
  --neon-cyan: #00d4ff;
  --neon-green: #00ff9d;
  --neon-purple: #9d00ff;
  --neon-orange: #ff6b00;
  --text-primary: #e8f4fc;
  --text-muted: #5a8aa8;
  --text-dim: #3a5a7a;
  --btn-blue: #0066cc;
  --btn-blue-h: #0088ff;
  --btn-green: #007a44;
  --btn-green-h: #00b862;
  --btn-flash: #cc4400;
  --btn-flash-h: #ff6600;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 20px rgba(0, 212, 255, 0.25);
  --transition: 0.25s ease;
}

/* ─── Reset & Base ──────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background-color: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-base);
}

::-webkit-scrollbar-thumb {
  background: var(--border-glow);
  border-radius: 3px;
}

/* ─── Animated Background Grid ─────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 212, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* ─── Header ─────────────────────────────────────────────────── */
.site-header {
  position: relative;
  z-index: 10;
  padding: 2rem 1.5rem 1.5rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(0, 212, 255, 0.06) 0%, transparent 100%);
  overflow: hidden;
}

.site-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
  animation: scanline 3s ease-in-out infinite;
}

@keyframes scanline {

  0%,
  100% {
    opacity: 0.4;
    transform: scaleX(0.7);
  }

  50% {
    opacity: 1;
    transform: scaleX(1);
  }
}

.header-badge {
  display: inline-block;
  font-family: 'Orbitron', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  color: var(--neon-cyan);
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.3);
  padding: 0.3rem 1rem;
  border-radius: 20px;
  margin-bottom: 1rem;
  animation: pulse-border 2s ease-in-out infinite;
}

@keyframes pulse-border {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(0, 212, 255, 0.15);
  }

  50% {
    box-shadow: 0 0 0 6px rgba(0, 212, 255, 0);
  }
}

.site-title {
  font-family: 'Orbitron', monospace;
  font-weight: 900;
  font-size: clamp(1.4rem, 4vw, 2.6rem);
  line-height: 1.2;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, var(--neon-cyan) 0%, #ffffff 50%, var(--neon-green) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  animation: title-glow 4s ease-in-out infinite alternate;
}

@keyframes title-glow {
  from {
    filter: drop-shadow(0 0 8px rgba(0, 212, 255, 0.4));
  }

  to {
    filter: drop-shadow(0 0 20px rgba(0, 255, 157, 0.5));
  }
}

.site-subtitle {
  margin-top: 0.5rem;
  font-family: 'Orbitron', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.header-deco {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.2rem;
}

.header-deco-line {
  flex: 1;
  max-width: 180px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-glow));
}

.header-deco-line:last-child {
  background: linear-gradient(270deg, transparent, var(--border-glow));
}

.header-deco-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--neon-cyan);
  box-shadow: 0 0 10px var(--neon-cyan);
  animation: blink 1.5s step-start infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* ─── Stats Bar ──────────────────────────────────────────────── */
.stats-bar {
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin-top: 1.2rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 30px;
  padding: 0.45rem 1.4rem;
  backdrop-filter: blur(8px);
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.stat-icon {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.stat-label {
  font-family: 'Orbitron', monospace;
  font-size: 0.58rem;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  white-space: nowrap;
}

.stat-value {
  font-family: 'Orbitron', monospace;
  font-size: 0.95rem;
  font-weight: 900;
  color: var(--neon-cyan);
  min-width: 2.5ch;
  text-align: center;
  letter-spacing: 0.05em;
  text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.stat-value.online {
  color: var(--neon-green);
  text-shadow: 0 0 10px rgba(0, 255, 157, 0.5);
}

.stat-loading {
  opacity: 0.4;
  font-size: 0.75rem;
}

.stat-divider {
  width: 1px;
  height: 28px;
  background: rgba(0, 212, 255, 0.2);
  margin: 0 1.1rem;
}

.stat-dot-live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--neon-green);
  box-shadow: 0 0 8px var(--neon-green);
  flex-shrink: 0;
  animation: live-pulse 1.5s ease-in-out infinite;
}

@keyframes live-pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 8px var(--neon-green);
  }

  50% {
    opacity: 0.5;
    transform: scale(0.7);
    box-shadow: 0 0 4px var(--neon-green);
  }
}


/* ─── Browser Warning ────────────────────────────────────────── */
.browser-warning {
  display: none;
  margin: 1rem auto;
  max-width: 700px;
  padding: 0.75rem 1.25rem;
  background: rgba(255, 107, 0, 0.1);
  border: 1px solid var(--neon-orange);
  border-radius: var(--radius-sm);
  color: var(--neon-orange);
  font-size: 0.85rem;
  text-align: center;
}

/* ─── Main Content ────────────────────────────────────────────── */
.main-content {
  position: relative;
  z-index: 5;
  max-width: 1400px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.section-title {
  font-family: 'Orbitron', monospace;
  font-size: 1rem;
  font-weight: 700;
  color: var(--neon-cyan);
  letter-spacing: 0.15em;
  white-space: nowrap;
}

.section-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--neon-cyan), transparent);
}

.section-count {
  font-family: 'Orbitron', monospace;
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

/* ─── Firmware Grid ───────────────────────────────────────────── */
.fw-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

/* ─── FW Card ─────────────────────────────────────────────────── */
.fw-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
  animation: card-in 0.5s ease both;
}

.fw-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 212, 255, 0.5);
  box-shadow: var(--shadow-card), var(--shadow-glow);
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fw-card__thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: #061220;
}

.fw-card__thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.4s ease;
}

.fw-card:hover .fw-card__thumb {
  transform: scale(1.04);
}

.fw-card__tag {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  font-family: 'Orbitron', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  padding: 0.2rem 0.6rem;
  background: rgba(0, 212, 255, 0.15);
  border: 1px solid rgba(0, 212, 255, 0.4);
  border-radius: 20px;
  color: var(--neon-cyan);
  backdrop-filter: blur(4px);
}

.fw-card__body {
  padding: 1.1rem 1.2rem 0.8rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.fw-card__name {
  font-family: 'Orbitron', monospace;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.fw-card__desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
}

.fw-card__version {
  font-family: 'Orbitron', monospace;
  font-size: 0.65rem;
  color: var(--neon-green);
  letter-spacing: 0.1em;
}

.fw-card__actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 0.5rem;
  padding: 0.8rem 1.2rem 1.2rem;
}

/* ─── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 0.55rem 0.7rem;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1;
}

.btn svg {
  flex-shrink: 0;
}

.btn-schema {
  background: rgba(0, 102, 204, 0.15);
  border: 1px solid rgba(0, 136, 255, 0.4);
  color: #5bc8ff;
}

.btn-schema:hover {
  background: rgba(0, 136, 255, 0.25);
  border-color: #0088ff;
  box-shadow: 0 0 12px rgba(0, 136, 255, 0.3);
}

.btn-buy {
  background: rgba(0, 122, 68, 0.15);
  border: 1px solid rgba(0, 184, 98, 0.4);
  color: #4ddb8a;
}

.btn-buy:hover {
  background: rgba(0, 184, 98, 0.25);
  border-color: #00b862;
  box-shadow: 0 0 12px rgba(0, 184, 98, 0.3);
}

.btn-flash {
  background: linear-gradient(135deg, #cc4400, #ff6600);
  border: 1px solid rgba(255, 102, 0, 0.6);
  color: #fff;
  font-family: 'Orbitron', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  position: relative;
  overflow: hidden;
}

.btn-flash::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -60%;
  width: 40%;
  height: 200%;
  background: rgba(255, 255, 255, 0.15);
  transform: skewX(-20deg);
  transition: left 0.4s ease;
}

.btn-flash:hover::before {
  left: 150%;
}

.btn-flash:hover {
  background: linear-gradient(135deg, #e04d00, #ff8833);
  box-shadow: 0 0 20px rgba(255, 102, 0, 0.5);
  transform: scale(1.03);
}

/* ─── Empty State ─────────────────────────────────────────────── */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 5rem 2rem;
  color: var(--text-dim);
}

.empty-state__icon {
  font-size: 4rem;
  display: block;
  margin-bottom: 1rem;
  opacity: 0.4;
}

.empty-state__title {
  font-family: 'Orbitron', monospace;
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.empty-state__text {
  font-size: 0.85rem;
}

.empty-state__link {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 0.6rem 1.5rem;
  border: 1px solid var(--neon-cyan);
  border-radius: var(--radius-sm);
  color: var(--neon-cyan);
  text-decoration: none;
  font-size: 0.85rem;
  font-family: 'Orbitron', monospace;
  letter-spacing: 0.1em;
  transition: all var(--transition);
}

.empty-state__link:hover {
  background: rgba(0, 212, 255, 0.1);
  box-shadow: 0 0 16px rgba(0, 212, 255, 0.3);
}

/* ─── Admin Nav Link ─────────────────────────────────────────── */
.admin-link {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 100;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  background: rgba(11, 20, 32, 0.9);
  border: 1px solid var(--border);
  border-radius: 30px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.75rem;
  font-family: 'Orbitron', monospace;
  letter-spacing: 0.1em;
  backdrop-filter: blur(8px);
  transition: all var(--transition);
}

.admin-link:hover {
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
  box-shadow: 0 0 16px rgba(0, 212, 255, 0.2);
}

/* ============================================================
   FLASH MODAL
   ============================================================ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(5, 10, 16, 0.85);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.8), 0 0 40px rgba(0, 212, 255, 0.08);
  animation: modal-in 0.3s ease;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.modal__title {
  font-family: 'Orbitron', monospace;
  font-size: 1rem;
  font-weight: 700;
  color: var(--neon-cyan);
  letter-spacing: 0.1em;
}

.modal__close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color var(--transition);
  line-height: 1;
}

.modal__close:hover {
  color: var(--text-primary);
}

.modal__fw-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

/* Steps inside modal */
.flash-step {
  display: none;
}

.flash-step.active {
  display: block;
}

/* Step — Connect */
.connect-icon {
  text-align: center;
  font-size: 3.5rem;
  margin: 0.5rem 0 1.5rem;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

.flash-instructions {
  background: rgba(0, 212, 255, 0.05);
  border: 1px solid rgba(0, 212, 255, 0.15);
  border-radius: var(--radius-sm);
  padding: 1rem 1.2rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.flash-instructions b {
  color: var(--neon-cyan);
}

.baud-select-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.baud-select-wrap label {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.baud-select {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  font-family: 'Orbitron', monospace;
}

.btn-connect {
  width: 100%;
  padding: 0.8rem;
  font-size: 0.85rem;
  font-family: 'Orbitron', monospace;
  letter-spacing: 0.12em;
  background: linear-gradient(135deg, #005a99, #0088ee);
  border: 1px solid rgba(0, 136, 238, 0.5);
  color: #fff;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-connect:hover {
  box-shadow: 0 0 20px rgba(0, 136, 238, 0.4);
  transform: translateY(-1px);
}

/* Step — Flashing */
.flash-device-name {
  font-family: 'Orbitron', monospace;
  font-size: 0.75rem;
  color: var(--neon-green);
  text-align: center;
  margin-bottom: 1.5rem;
  letter-spacing: 0.1em;
}

.progress-wrap {
  margin-bottom: 1.2rem;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.progress-label span:last-child {
  font-family: 'Orbitron', monospace;
  color: var(--neon-cyan);
}

.progress-track {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0066cc, var(--neon-cyan));
  border-radius: 6px;
  transition: width 0.3s ease;
  position: relative;
  overflow: hidden;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 40px;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4));
  animation: shimmer 1s linear infinite;
}

@keyframes shimmer {
  from {
    transform: translateX(-40px);
  }

  to {
    transform: translateX(40px);
  }
}

.flash-log {
  background: #020608;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  font-family: 'Courier New', monospace;
  font-size: 0.72rem;
  color: #4a8a6a;
  height: 100px;
  overflow-y: auto;
  line-height: 1.6;
}

/* Step — Success */
.success-icon {
  text-align: center;
  font-size: 4rem;
  margin: 0.5rem 0 1rem;
  animation: pop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes pop {
  from {
    transform: scale(0);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.success-title {
  font-family: 'Orbitron', monospace;
  font-size: 1.2rem;
  font-weight: 900;
  text-align: center;
  color: var(--neon-green);
  margin-bottom: 0.5rem;
  text-shadow: 0 0 20px rgba(0, 255, 157, 0.5);
}

.success-sub {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.confetti-box {
  text-align: center;
  font-size: 1.5rem;
  letter-spacing: 0.5em;
  animation: bounce 0.8s ease infinite alternate;
}

@keyframes bounce {
  from {
    transform: translateY(0);
  }

  to {
    transform: translateY(-6px);
  }
}

/* Step — Error */
.error-icon {
  text-align: center;
  font-size: 3.5rem;
  margin-bottom: 1rem;
}

.error-title {
  font-family: 'Orbitron', monospace;
  font-size: 1rem;
  color: #ff4444;
  text-align: center;
  margin-bottom: 0.5rem;
}

.error-msg {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  line-height: 1.5;
  background: rgba(255, 68, 68, 0.06);
  border: 1px solid rgba(255, 68, 68, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
}

.error-actions {
  display: flex;
  gap: 0.75rem;
}

.btn-retry {
  flex: 1;
  padding: 0.7rem;
  font-family: 'Orbitron', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  background: rgba(255, 68, 68, 0.1);
  border: 1px solid rgba(255, 68, 68, 0.4);
  color: #ff6666;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-retry:hover {
  background: rgba(255, 68, 68, 0.2);
}

.btn-cancel {
  flex: 1;
  padding: 0.7rem;
  font-family: 'Orbitron', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-cancel:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
}

/* Close btn for success */
.btn-done {
  width: 100%;
  padding: 0.8rem;
  font-family: 'Orbitron', monospace;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  background: linear-gradient(135deg, #007a44, #00b862);
  border: 1px solid rgba(0, 184, 98, 0.5);
  color: #fff;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-done:hover {
  box-shadow: 0 0 20px rgba(0, 184, 98, 0.4);
  transform: translateY(-1px);
}

/* ─── Schema Modal ─────────────────────────────────────────── */
.schema-modal .modal__body {
  text-align: center;
}

.schema-img-wrap {
  width: 100%;
  background: #000;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 1rem;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.schema-img-wrap img {
  max-width: 100%;
  max-height: 500px;
  object-fit: contain;
}

.schema-open-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--neon-cyan);
  font-size: 0.85rem;
  text-decoration: none;
  transition: opacity var(--transition);
}

.schema-open-link:hover {
  opacity: 0.75;
}

/* ─── Footer ─────────────────────────────────────────────────── */
.site-footer {
  position: relative;
  z-index: 5;
  text-align: center;
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: 'Orbitron', monospace;
  letter-spacing: 0.15em;
}

.site-footer span {
  color: var(--neon-cyan);
}

/* ============================================================
   ADMIN PANEL STYLES
   ============================================================ */
.admin-body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  padding: 0;
}

.admin-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: linear-gradient(180deg, rgba(0, 212, 255, 0.06) 0%, transparent 100%);
}

.admin-header__title {
  font-family: 'Orbitron', monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--neon-cyan);
  letter-spacing: 0.1em;
}

.admin-header__back {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  font-family: 'Orbitron', monospace;
  letter-spacing: 0.1em;
  transition: color var(--transition);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.admin-header__back:hover {
  color: var(--neon-cyan);
}

.admin-main {
  max-width: 1600px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
}

.admin-form-split {
  display: grid;
  grid-template-columns: 1fr 355px;
  gap: 2rem;
}

@media (max-width: 1100px) {
  .admin-main {
    grid-template-columns: 1fr;
  }

  .admin-form-split {
    grid-template-columns: 1fr;
  }
}

/* Gate */
.pw-gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pw-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  width: 100%;
  max-width: 360px;
  text-align: center;
}

.pw-card__icon {
  font-size: 2.5rem;
  margin-bottom: 1.2rem;
}

.pw-card__title {
  font-family: 'Orbitron', monospace;
  font-size: 1rem;
  color: var(--neon-cyan);
  margin-bottom: 1.5rem;
  letter-spacing: 0.1em;
}

.pw-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 1rem;
  margin-bottom: 1rem;
  text-align: center;
  letter-spacing: 0.2em;
  transition: border-color var(--transition);
}

.pw-input:focus {
  outline: none;
  border-color: var(--neon-cyan);
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.2);
}

.pw-error {
  color: #ff4444;
  font-size: 0.8rem;
  min-height: 1.2rem;
  margin-bottom: 0.75rem;
}

.btn-login {
  width: 100%;
  padding: 0.8rem;
  font-family: 'Orbitron', monospace;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  background: linear-gradient(135deg, #0066cc, #0088ff);
  border: none;
  color: #fff;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-login:hover {
  box-shadow: 0 0 20px rgba(0, 136, 255, 0.4);
  transform: translateY(-1px);
}

/* Admin list */
.admin-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  flex: 1;
}

.admin-panel__header {
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-panel__title {
  font-family: 'Orbitron', monospace;
  font-size: 0.85rem;
  color: var(--neon-cyan);
  letter-spacing: 0.1em;
}

.btn-add-new {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 1rem;
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.4);
  border-radius: var(--radius-sm);
  color: var(--neon-cyan);
  font-family: 'Orbitron', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-add-new:hover {
  background: rgba(0, 212, 255, 0.2);
}

.fw-list {
  padding: 1rem;
}

.fw-list-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  transition: border-color var(--transition), background var(--transition);
  cursor: pointer;
}

.fw-list-item:hover {
  border-color: rgba(0, 212, 255, 0.3);
  background: rgba(0, 212, 255, 0.03);
}

.fw-list-item.selected {
  border-color: var(--neon-cyan);
  background: rgba(0, 212, 255, 0.06);
}

.fw-list-item__thumb {
  width: 60px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
  background: #061220;
  flex-shrink: 0;
}

.fw-list-item__info {
  flex: 1;
  min-width: 0;
}

.fw-list-item__name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fw-list-item__ver {
  font-family: 'Orbitron', monospace;
  font-size: 0.65rem;
  color: var(--neon-green);
  margin-top: 0.2rem;
}

.fw-list-item__del {
  background: none;
  border: 1px solid rgba(255, 68, 68, 0.3);
  color: #ff6666;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}

.fw-list-item__del:hover {
  background: rgba(255, 68, 68, 0.15);
}

.fw-list-empty {
  text-align: center;
  padding: 2rem;
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* Admin form sidebar */
.admin-form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  height: fit-content;
  position: sticky;
  top: 1rem;
}

.admin-form-card__header {
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--border);
  font-family: 'Orbitron', monospace;
  font-size: 0.85rem;
  color: var(--neon-cyan);
  letter-spacing: 0.1em;
}

.admin-form {
  padding: 1.2rem 1.5rem;
}

.form-group {
  margin-bottom: 1.1rem;
}

.form-label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  letter-spacing: 0.05em;
}

.form-label span {
  color: #ff6666;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 0.65rem 0.9rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: 'Inter', sans-serif;
  transition: border-color var(--transition);
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--neon-cyan);
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.15);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-file-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  width: 100%;
  justify-content: center;
}

.form-file-btn:hover {
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
}

.form-file-name {
  font-size: 0.72rem;
  color: var(--neon-green);
  margin-top: 0.35rem;
  display: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.form-thumb-preview {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-top: 0.5rem;
  display: none;
  border: 1px solid var(--border);
}

.form-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 1.2rem;
}

.btn-save {
  flex: 1;
  padding: 0.7rem;
  font-family: 'Orbitron', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  background: linear-gradient(135deg, #007a44, #00b862);
  border: none;
  color: #fff;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-save:hover {
  box-shadow: 0 0 16px rgba(0, 184, 98, 0.4);
}

.btn-clear {
  padding: 0.7rem 1rem;
  font-family: 'Orbitron', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-clear:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
}

.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--bg-card);
  border: 1px solid var(--neon-green);
  border-radius: 30px;
  padding: 0.65rem 1.5rem;
  font-family: 'Orbitron', monospace;
  font-size: 0.75rem;
  color: var(--neon-green);
  letter-spacing: 0.1em;
  box-shadow: 0 0 20px rgba(0, 255, 157, 0.2);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
  opacity: 0;
  z-index: 9999;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 600px) {
  .site-title {
    font-size: 1.2rem;
  }

  .fw-grid {
    grid-template-columns: 1fr;
  }

  .fw-card__actions {
    grid-template-columns: 1fr 1fr;
  }

  .fw-card__actions .btn-flash {
    grid-column: 1 / -1;
  }

  .modal {
    padding: 1.5rem;
  }
}

/* ─── Blog & Clickable Thumbnails ─────────────────────── */
.fw-card__thumb-wrap {
  cursor: pointer;
}

.fw-card__thumb-wrap::before {
  content: '+ Xem chi tiết';
  position: absolute;
  inset: 0;
  background: rgba(5, 10, 16, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Orbitron', monospace;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  color: var(--neon-cyan);
  opacity: 0;
  transition: opacity var(--transition);
  z-index: 2;
  text-shadow: 0 0 10px rgba(0, 212, 255, 0.7);
}

.fw-card__thumb-wrap:hover::before {
  opacity: 1;
}

.blog-modal {
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.blog-content {
  overflow-y: auto;
  padding-right: 0.5rem;
  line-height: 1.8;
  font-size: 0.92rem;
  color: var(--text-primary);
  max-height: calc(90vh - 120px);
}

.blog-content h1,
.blog-content h2,
.blog-content h3 {
  font-family: 'Orbitron', monospace;
  color: var(--neon-cyan);
  margin: 1.5rem 0 0.8rem;
  font-weight: 700;
}

.blog-content h1 {
  font-size: 1.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.blog-content h2 {
  font-size: 1.25rem;
}

.blog-content h3 {
  font-size: 1.1rem;
}

.blog-content p {
  margin-bottom: 1.2rem;
  color: #c5d6e2;
}

.blog-content strong {
  color: var(--neon-green);
}

.blog-content ul,
.blog-content ol {
  margin: 0 0 1.2rem 1.5rem;
  color: #c5d6e2;
}

.blog-content li {
  margin-bottom: 0.4rem;
}

.blog-content img {
  max-width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin: 1rem 0;
}

.blog-content a {
  color: var(--neon-cyan);
  text-decoration: underline;
  transition: opacity var(--transition);
}

.blog-content a:hover {
  opacity: 0.8;
}

.blog-content blockquote {
  border-left: 3px solid var(--neon-cyan);
  background: rgba(0, 212, 255, 0.05);
  padding: 0.8rem 1.2rem;
  margin: 1.2rem 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
}

.blog-content iframe {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin: 1rem 0;
}

.blog-content code {
  font-family: 'Courier New', Courier, monospace;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  color: #ff9d00;
  font-size: 0.85rem;
}

.blog-content pre {
  background: #020608;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  overflow-x: auto;
  margin: 1.2rem 0;
}

/* Fullscreen modal style */
.modal__maximize:hover {
  color: var(--neon-cyan) !important;
}

.blog-modal.fullscreen {
  max-width: 100vw !important;
  width: 100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  border-radius: 0 !important;
  border: none !important;
  margin: 0 !important;
  box-shadow: none !important;
  display: flex;
  flex-direction: column;
}

.blog-modal.fullscreen .modal__header {
  border-radius: 0 !important;
  border-bottom: 1px solid var(--border) !important;
}

.blog-modal.fullscreen .blog-content {
  max-height: calc(100vh - 80px) !important;
  height: 100% !important;
  font-size: 1.05rem !important;
  padding: 2rem 4rem !important;
}

@media (max-width: 768px) {
  .blog-modal.fullscreen .blog-content {
    padding: 1.5rem 1rem !important;
  }
}


/* ─── Quill Editor Premium Dark Tech Theme-ify ───────── */
.ql-toolbar.ql-snow {
  border: 1px solid var(--border) !important;
  background: var(--bg-card) !important;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  padding: 8px !important;
}

.ql-container.ql-snow {
  border: 1px solid var(--border) !important;
  border-top: none !important;
  background: rgba(255, 255, 255, 0.02) !important;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  color: var(--text-primary) !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 0.85rem !important;
}

.ql-editor {
  min-height: 200px;
  max-height: 400px;
  overflow-y: auto;
}

.ql-editor.ql-blank::before {
  color: var(--text-dim) !important;
  font-style: normal !important;
  opacity: 0.6;
}

.ql-snow .ql-stroke {
  stroke: var(--text-muted) !important;
}

.ql-snow .ql-fill {
  fill: var(--text-muted) !important;
}

.ql-snow .ql-picker {
  color: var(--text-muted) !important;
}

.ql-snow .ql-picker-options {
  background-color: var(--bg-card) !important;
  border-color: var(--border) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
  border-radius: 6px;
}

.ql-snow .ql-picker-item {
  color: var(--text-muted) !important;
}

.ql-snow .ql-picker-item:hover,
.ql-snow .ql-picker-item.ql-selected {
  color: var(--neon-cyan) !important;
  background: rgba(0, 212, 255, 0.08) !important;
}

.ql-snow.ql-toolbar button:hover .ql-stroke,
.ql-snow .ql-toolbar button:hover .ql-stroke,
.ql-snow.ql-toolbar button.ql-active .ql-stroke,
.ql-snow .ql-toolbar button.ql-active .ql-stroke,
.ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke,
.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke {
  stroke: var(--neon-cyan) !important;
}

.ql-snow.ql-toolbar button:hover .ql-fill,
.ql-snow .ql-toolbar button:hover .ql-fill,
.ql-snow.ql-toolbar button.ql-active .ql-fill,
.ql-snow .ql-toolbar button.ql-active .ql-fill,
.ql-snow.ql-toolbar .ql-picker-label:hover .ql-fill,
.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-fill {
  fill: var(--neon-cyan) !important;
}

.ql-snow.ql-toolbar button:hover,
.ql-snow .ql-toolbar button:hover,
.ql-snow.ql-toolbar button.ql-active,
.ql-snow .ql-toolbar button.ql-active,
.ql-snow .ql-picker-label:hover,
.ql-snow .ql-picker-label.ql-active {
  color: var(--neon-cyan) !important;
}

.ql-tooltip {
  background-color: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-primary) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
  border-radius: 4px;
}

.ql-tooltip input[type=text] {
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-primary) !important;
  border-radius: 4px;
}

.ql-tooltip a.ql-action::after {
  border-right: 1px solid var(--border) !important;
}

.ql-tooltip a {
  color: var(--neon-cyan) !important;
}