@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --neon: #39ff14;
  --neon-dim: #1aff0080;
  --neon-glow: 0 0 8px #39ff14, 0 0 20px #39ff1466, 0 0 40px #39ff1422;
  --neon-text-glow: 0 0 6px #39ff14, 0 0 12px #39ff1488;
  --black: #000000;
  --black-1: #0a0a0a;
  --black-2: #111111;
  --black-3: #1a1a1a;
  --black-4: #222222;
  --black-5: #2d2d2d;
  --gray: #555555;
  --gray-light: #888888;
  --white: #ffffff;
  --white-dim: rgba(255, 255, 255, 0.06);
  --danger: #ff3b3b;
  --warning: #ffaa00;
  --sidebar-w: 280px;
  --header-h: 80px; /* Increased for a more spacious header */
  --radius: 8px;
  --radius-lg: 14px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--black-1);
  color: var(--white);
  min-height: 100vh;
  display: flex;
  overflow: hidden;
  position: relative;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  position: relative;
}

.main::before {
    content: '';
    position: fixed;
    /* Vertically center in the content area below header */
    top: calc(var(--header-h) + (100vh - var(--header-h)) / 2);
    left: calc(var(--sidebar-w) + (100vw - var(--sidebar-w)) / 2);
    width: 100vw; height: 100vh;
    transform: translate(-50%, -50%);
    background-image: url('assets/logo.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 1000px; 
    opacity: 0.05;
    pointer-events: none;
    z-index: -1;
}

::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: var(--black-2);
}
::-webkit-scrollbar-thumb {
  background: var(--black-5);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--neon);
}

.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  height: 100vh;
  background: var(--black-1);
  border-right: 1px solid var(--black-5);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--black-4);
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 38px;
  height: 38px;
  background: var(--white);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 4px;
}

.logo-icon svg {
  width: 22px;
  height: 22px;
}

.logo-text {
  line-height: 1.1;
}
.logo-text .brand {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--white);
}
.logo-text .sub {
  font-size: 10px;
  font-weight: 500;
  color: var(--gray-light);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.nav-section {
  padding: 12px 12px 0;
}
.nav-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gray);
  padding: 0 8px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-light);
  transition: all var(--transition);
  margin-bottom: 2px;
  position: relative;
  text-decoration: none;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity var(--transition);
}

.nav-item:hover {
  background: var(--white-dim);
  color: var(--white);
}
.nav-item:hover svg {
  opacity: 1;
}

.nav-item.active {
  background: rgba(57, 255, 20, 0.08);
  color: var(--neon);
  font-weight: 600;
}
.nav-item.active svg {
  opacity: 1;
  filter: drop-shadow(0 0 4px var(--neon));
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 3px;
  background: var(--neon);
  border-radius: 0 2px 2px 0;
  box-shadow: var(--neon-glow);
}

.nav-badge {
  margin-left: auto;
  background: var(--black-4);
  color: var(--gray-light);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  transition: all var(--transition);
}
.nav-item.active .nav-badge {
  background: rgba(57, 255, 20, 0.15);
  color: var(--neon);
}

.sidebar-footer {
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid var(--black-4);
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(57, 255, 20, 0.05);
  border: 1px solid rgba(57, 255, 20, 0.15);
  border-radius: var(--radius);
  font-size: 11px;
  color: var(--neon);
  font-weight: 500;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--neon);
  box-shadow: var(--neon-glow);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(0.8);
  }
}

.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

#btn-menu {
    display: none !important; /* Hidden on desktop */
}

.topbar-center {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 1000; /* Ensure it is above other elements */
}

.small-logo {
    width: 180px; /* Increased size as requested */
    height: auto;
    max-height: 58px;
    object-fit: contain;
}

.topbar {
  height: var(--header-h);
  background: var(--black-1);
  border-bottom: 1px solid var(--black-4);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  flex-shrink: 0;
  position: relative; /* Added to center the logo correctly */
}

.topbar-title {
  font-size: 16px;
  font-weight: 700;
}
.topbar-sub {
  font-size: 12px;
  color: var(--gray-light);
  margin-left: 2px;
}
.topbar-sep {
  width: 1px;
  height: 20px;
  background: var(--black-5);
  margin: 0 4px;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.content {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
}

.page {
  display: none;
}
.page.active {
  display: block;
}
.page-anim {
  animation: fadeSlide 0.25s ease;
}
@keyframes fadeSlide {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.section-title {
  font-size: 22px;
  font-weight: 800;
}
.section-title span {
  color: var(--neon);
}
.section-desc {
  font-size: 13px;
  color: var(--gray-light);
  margin-top: 3px;
}

.card {
  background: var(--black-2);
  border: 1px solid var(--black-4);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color var(--transition);
}

.card:hover {
  border-color: var(--black-5);
}

.card-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-light);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--neon);
  box-shadow: 0 0 6px var(--neon);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: var(--neon);
  color: var(--black);
  box-shadow: 0 0 12px rgba(57, 255, 20, 0.25);
}
.btn-primary:hover {
  background: #52ff2d;
  box-shadow: var(--neon-glow);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(0);
}

.btn-ghost {
  background: transparent;
  color: var(--white);
  border: 1px solid var(--black-5);
}
.btn-ghost:hover {
  background: var(--white-dim);
  border-color: var(--gray);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(255, 59, 59, 0.3);
}
.btn-danger:hover {
  background: rgba(255, 59, 59, 0.08);
}

.btn-neon-outline {
  background: transparent;
  color: var(--neon);
  border: 1px solid rgba(57, 255, 20, 0.4);
}
.btn-neon-outline:hover {
  background: rgba(57, 255, 20, 0.06);
  box-shadow: 0 0 10px rgba(57, 255, 20, 0.15);
}

.btn-lg {
  padding: 14px 28px;
  font-size: 15px;
  border-radius: 10px;
}
.btn-sm {
  padding: 7px 12px;
  font-size: 12px;
}
.btn-icon {
  padding: 9px;
}
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.form-group {
  margin-bottom: 16px;
}
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.form-input,
.form-select {
  width: 100%;
  background: var(--black-3);
  border: 1px solid var(--black-5);
  border-radius: var(--radius);
  color: var(--white);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  padding: 10px 14px;
  transition: all var(--transition);
  outline: none;
}

.form-input:focus,
.form-select:focus {
  border-color: var(--neon);
  box-shadow: 0 0 0 3px rgba(57, 255, 20, 0.1);
}

.form-select {
  cursor: pointer;
}
.form-select option {
  background: var(--black-3);
}

.upload-area {
  border: 2px dashed var(--black-5);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

.upload-area:hover,
.upload-area.drag-over {
  border-color: var(--neon);
  background: rgba(57, 255, 20, 0.03);
}

.upload-icon {
  width: 40px;
  height: 40px;
  color: var(--gray);
  margin: 0 auto 12px;
}
.upload-text {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}
.upload-sub {
  font-size: 12px;
  color: var(--gray-light);
}
.upload-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.stat-card {
  background: var(--black-2);
  border: 1px solid var(--black-4);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-value {
  font-size: 32px;
  font-weight: 900;
  color: var(--neon);
  text-shadow: var(--neon-text-glow);
  line-height: 1;
}

.stat-label {
  font-size: 12px;
  color: var(--gray-light);
  font-weight: 500;
}
.stat-change {
  font-size: 11px;
  color: var(--gray);
  margin-top: 2px;
}

.table-wrap {
  border-radius: var(--radius-lg);
  border: 1px solid var(--black-4);
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  background: var(--black-3);
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-light);
  text-align: left;
  border-bottom: 1px solid var(--black-4);
}

tbody tr {
  border-bottom: 1px solid var(--black-3);
  transition: background var(--transition);
}
tbody tr:last-child {
  border-bottom: none;
}
tbody tr:hover {
  background: var(--white-dim);
}

tbody td {
  padding: 13px 16px;
  font-size: 13px;
  color: var(--white);
}

.td-mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--gray-light);
}
.td-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
}

.badge-green {
  background: rgba(57, 255, 20, 0.12);
  color: var(--neon);
}
.badge-gray {
  background: var(--black-4);
  color: var(--gray-light);
}
.badge-yellow {
  background: rgba(255, 170, 0, 0.12);
  color: var(--warning);
}

.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  padding: 20px 0 0;
}

.page-btn {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  border: 1px solid var(--black-5);
  background: transparent;
  color: var(--gray-light);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', sans-serif;
}

.page-btn:hover {
  border-color: var(--neon);
  color: var(--neon);
}
.page-btn.active {
  background: var(--neon);
  border-color: var(--neon);
  color: var(--black);
}
.page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.search-wrap {
  position: relative;
  max-width: 320px;
}

.search-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--gray);
  pointer-events: none;
}

.search-input {
  width: 100%;
  background: var(--black-3);
  border: 1px solid var(--black-5);
  border-radius: var(--radius);
  color: var(--white);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  padding: 9px 14px 9px 38px;
  outline: none;
  transition: all var(--transition);
}

.search-input:focus {
  border-color: var(--neon);
  box-shadow: 0 0 0 3px rgba(57, 255, 20, 0.08);
}
.search-input::placeholder {
  color: var(--gray);
}

#page-sorteador {
    height: calc(100vh - var(--header-h));
    display: flex;
    flex-direction: column;
}

.sorteador-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center; /* Centers the result card vertically */
    align-items: center;
    gap: 32px;
    padding: 40px 0;
    position: relative;
    z-index: 10;
}

.mode-toggle {
    display: flex;
    background: var(--black-2);
    border: 1px solid var(--black-4);
    border-radius: 10px;
    padding: 4px;
    gap: 4px;
    z-index: 100;
}

.mode-btn {
  padding: 12px 28px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--gray-light);
  font-family: 'Inter', sans-serif;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}

.mode-btn svg {
  width: 18px;
  height: 18px;
}

.mode-btn.active {
  background: var(--neon);
  color: var(--black);
  box-shadow: 0 0 16px rgba(57, 255, 20, 0.3);
}

.roulette-stage {
    width: 100%;
    max-width: 850px; 
    position: relative;
    margin-top: 60px; /* Pushed further down to center better in the viewport */
}

.roulette-frame {
    background: var(--black-2);
    border: 1px solid var(--black-4);
    border-radius: 20px;
    padding: 64px 40px; /* Increased padding */
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 320px; /* Increased height */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.roulette-frame::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at 50% 0%,
    rgba(57, 255, 20, 0.06) 0%,
    transparent 60%
  );
  pointer-events: none;
}

.roulette-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--gray);
  margin-bottom: 20px;
}

.roulette-name {
  font-size: clamp(28px, 5vw, 52px);
  font-weight: 900;
  color: var(--white);
  letter-spacing: -0.02em;
  line-height: 1.1;
  transition: all 0.08s ease;
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  word-break: break-word;
}

.roulette-name.spinning {
  color: var(--neon);
  text-shadow: var(--neon-text-glow);
  animation: shake 0.1s ease infinite;
}

@keyframes shake {
  0%,
  100% {
    transform: translateY(0);
  }
  25% {
    transform: translateY(-2px);
  }
  75% {
    transform: translateY(2px);
  }
}

.roulette-name.winner {
  color: var(--neon);
  text-shadow:
    0 0 20px var(--neon),
    0 0 40px rgba(57, 255, 20, 0.5);
  animation: winner-pop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes winner-pop {
  0% {
    transform: scale(0.7);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.roulette-sub {
  font-size: 13px;
  color: var(--gray-light);
  margin-top: 10px;
  min-height: 20px;
}

.winner-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(57, 255, 20, 0.1);
  border: 1px solid rgba(57, 255, 20, 0.3);
  border-radius: 99px;
  padding: 4px 14px;
  font-size: 11px;
  font-weight: 700;
  color: var(--neon);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 12px;
  animation: fadeIn 0.3s ease 0.3s both;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.shuffle-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.shuffle-overlay.visible {
  opacity: 0.15;
}

.shuffle-pill {
  background: var(--neon);
  color: var(--black);
  font-size: 9px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  white-space: nowrap;
  animation: pill-flash 0.15s ease infinite alternate;
}

@keyframes pill-flash {
  from {
    opacity: 0.3;
  }
  to {
    opacity: 1;
  }
}

.sortear-btn {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: var(--black-2);
  border: 2px solid var(--black-5);
  color: var(--white);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  margin-top: 140px; /* Pushed further down to reveal 'NORTE' text */
  z-index: 11;
}

.sortear-btn::before {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 1px solid var(--black-5);
  transition: border-color 0.3s;
}

.sortear-btn svg {
  width: 36px;
  height: 36px;
  transition: transform 0.3s;
}

.sortear-btn:not(:disabled):hover {
  border-color: var(--neon);
  box-shadow:
    var(--neon-glow),
    inset 0 0 40px rgba(57, 255, 20, 0.05);
  color: var(--neon);
  transform: scale(1.02);
}

.sortear-btn:not(:disabled):hover svg {
  transform: rotate(180deg);
}
.sortear-btn:not(:disabled):hover::before {
  border-color: rgba(57, 255, 20, 0.3);
}

.sortear-btn.spinning {
  border-color: var(--neon);
  animation: spin-pulse 0.8s ease-in-out infinite alternate;
  cursor: not-allowed;
  color: var(--neon);
}

@keyframes spin-pulse {
  from {
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.3);
  }
  to {
    box-shadow:
      0 0 40px rgba(57, 255, 20, 0.7),
      inset 0 0 40px rgba(57, 255, 20, 0.05);
  }
}

.sortear-btn.spinning svg {
  animation: rotate-spin 0.6s linear infinite;
}
@keyframes rotate-spin {
  to {
    transform: rotate(360deg);
  }
}

.progress-track {
  width: 100%;
  max-width: 400px;
  height: 3px;
  background: var(--black-4);
  border-radius: 99px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--neon);
  box-shadow: 0 0 8px var(--neon);
  border-radius: 99px;
  transition: width 0.1s linear;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--black-2);
  border: 1px solid var(--black-4);
  border-radius: var(--radius-lg);
  margin-bottom: 10px;
  transition: all var(--transition);
}

.history-item:hover {
  border-color: var(--black-5);
}

.history-rank {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(57, 255, 20, 0.08);
  border: 1px solid rgba(57, 255, 20, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: var(--neon);
  flex-shrink: 0;
}

.history-info {
  flex: 1;
}
.history-name {
  font-size: 15px;
  font-weight: 700;
}
.history-meta {
  font-size: 12px;
  color: var(--gray-light);
  margin-top: 2px;
}

#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  background: var(--black-3);
  border: 1px solid var(--black-5);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  font-size: 13px;
  font-weight: 500;
  min-width: 260px;
  max-width: 360px;
  animation: toast-in 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: all;
}

@keyframes toast-in {
  from {
    transform: translateX(120%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast.out {
  animation: toast-out 0.3s ease forwards;
}

@keyframes toast-out {
  to {
    transform: translateX(120%);
    opacity: 0;
  }
}

.toast-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.toast-success {
  border-left: 3px solid var(--neon);
}
.toast-error {
  border-left: 3px solid var(--danger);
}
.toast-info {
  border-left: 3px solid #3b9eff;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
  color: var(--gray);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  opacity: 0.4;
}
.empty-state h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-light);
  margin-bottom: 6px;
}
.empty-state p {
  font-size: 13px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--black-2);
  border: 1px solid var(--black-4);
  border-radius: 16px;
  padding: 28px;
  width: 100%;
  max-width: 480px;
  transform: scale(0.95);
  transition: transform 0.2s;
}

.modal-overlay.open .modal {
  transform: scale(1);
}

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

.modal-title {
  font-size: 17px;
  font-weight: 800;
}

.divider {
  height: 1px;
  background: var(--black-4);
  margin: 20px 0;
}

.flex {
  display: flex;
}
.flex-col {
  flex-direction: column;
}
.gap-2 {
  gap: 8px;
}
.gap-3 {
  gap: 12px;
}
.gap-4 {
  gap: 16px;
}
.items-center {
  align-items: center;
}
.justify-between {
  justify-content: space-between;
}
.mt-4 {
  margin-top: 16px;
}
.mt-6 {
  margin-top: 24px;
}
.mb-4 {
  margin-bottom: 16px;
}

.text-neon {
  color: var(--neon);
}
.text-muted {
  color: var(--gray-light);
}
.text-sm {
  font-size: 12px;
}
.text-xs {
  font-size: 11px;
}
.font-bold {
  font-weight: 700;
}

.neon-border {
  border-color: rgba(57, 255, 20, 0.3) !important;
}
.neon-glow-box {
  box-shadow: 0 0 20px rgba(57, 255, 20, 0.15);
}

.confetti-piece {
  position: fixed;
  width: 8px;
  height: 8px;
  background: var(--neon);
  top: -10px;
  border-radius: 2px;
  animation: confetti-fall linear forwards;
  z-index: 9998;
  pointer-events: none;
}

@keyframes confetti-fall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(110vh) rotate(720deg);
    opacity: 0;
  }
}

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main {
    margin-left: 0;
  }
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .grid-3 {
    grid-template-columns: 1fr 1fr;
  }
  .topbar {
    padding: 0 16px;
  }
  .content {
    padding: 16px;
  }
}

@media (max-width: 600px) {
  .grid-3 {
    grid-template-columns: 1fr;
  }
  .mode-btn {
    padding: 10px 16px;
    font-size: 12px;
  }
}

.result-card-premium {
  width: 100%;
  max-width: 650px;
  margin-top: 32px;
  background: linear-gradient(145deg, var(--black-2), var(--black-1));
  border: 1px solid rgba(57, 255, 20, 0.3);
  box-shadow: 0 0 30px rgba(57, 255, 20, 0.05), inset 0 0 20px rgba(57, 255, 20, 0.02);
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 32px;
  border-radius: var(--radius-lg);
  animation: result-pop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes result-pop {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.result-icon-box {
  width: 70px;
  height: 70px;
  background: rgba(57, 255, 20, 0.1);
  border: 1px solid rgba(57, 255, 20, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--neon);
  box-shadow: 0 0 15px rgba(57, 255, 20, 0.2);
  flex-shrink: 0;
}

.result-icon-box svg {
  width: 32px;
  height: 32px;
}

.result-content {
  flex: 1;
}

.result-label {
  text-transform: uppercase;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--neon);
  margin-bottom: 6px;
}

.result-name {
  font-size: 28px;
  font-weight: 900;
  color: var(--white);
  line-height: 1.2;
}

.result-meta {
  display: flex;
  gap: 16px;
  margin-top: 8px;
}

/* DB Manager Premium Styles */
.db-manager-card {
    margin-bottom: 24px;
    background: linear-gradient(145deg, var(--black-2), var(--black-3));
    border: 1px solid var(--black-4);
    position: relative;
    /* overflow: hidden; REMOVED to allow dropdown to overlap */
}

.db-manager-card::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 150px; height: 150px;
    background: radial-gradient(circle, rgba(57, 255, 20, 0.03) 0%, transparent 70%);
    pointer-events: none;
}

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

.badge-count {
    background: var(--black-4);
    color: var(--neon);
    font-size: 10px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid rgba(57, 255, 20, 0.2);
}

.custom-select-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.db-selector {
    padding-right: 40px !important;
    background-color: var(--black-1) !important;
    border-color: var(--black-4) !important;
    cursor: pointer;
    font-weight: 500;
}

.db-selector:hover {
    border-color: var(--neon);
}

.select-arrow {
    position: absolute;
    right: 15px;
    width: 10px; height: 10px;
    border-right: 2px solid var(--gray-light);
    border-bottom: 2px solid var(--gray-light);
    transform: rotate(45deg);
    pointer-events: none;
    transition: 0.3s;
}

.db-selector:focus + .select-arrow {
    border-color: var(--neon);
    transform: rotate(-135deg);
}

/* Base Details Stats */
.stat-card {
    background: var(--black-1);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--black-4);
    transition: 0.3s;
}

.stat-card:hover {
    border-color: var(--black-5);
    transform: translateY(-2px);
}

/* Danger Zone Polish */
.card-danger-zone {
    border: 1px solid rgba(255, 59, 59, 0.2) !important;
    background: linear-gradient(to bottom right, rgba(255, 59, 59, 0.02), transparent) !important;
    box-shadow: 0 10px 30px rgba(255, 0, 0, 0.05);
}

.card-danger-zone .card-title {
    color: #ff4d4d !important;
}

/* Table Enhancements */
.table-container {
    max-height: 500px;
    overflow-y: auto;
}

table tr {
    transition: 0.2s;
}

table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.td-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 6px;
}
/* Fully Custom Select Component */
.un-select {
    position: relative;
    width: 100%;
    user-select: none;
}

.un-select-trigger {
    background: var(--black-1);
    border: 1px solid var(--black-4);
    padding: 12px 18px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.un-select-trigger:hover {
    border-color: var(--neon);
    box-shadow: 0 0 15px rgba(57, 255, 20, 0.05);
}

.un-select.open .un-select-trigger {
    border-color: var(--neon);
    background: var(--black-2);
}

.un-select-current {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-light);
}

.un-select-arrow {
    width: 8px; height: 8px;
    border-right: 2px solid var(--gray-light);
    border-bottom: 2px solid var(--gray-light);
    transform: rotate(45deg);
    transition: 0.4s;
    margin-right: 5px;
}

.un-select.open .un-select-arrow {
    transform: rotate(-135deg);
    border-color: var(--neon);
}

.un-select.open {
    z-index: 2000;
}

.un-select-options {
    position: absolute;
    top: calc(100% + 5px);
    left: 0; right: 0;
    background: #1a1a1a; /* Solid background to avoid seeing content behind */
    backdrop-filter: blur(15px);
    border: 1px solid var(--neon);
    border-radius: 12px;
    z-index: 2001;
    max-height: 350px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 20px rgba(57, 255, 20, 0.1);
}

.un-select.open .un-select-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.un-option {
    padding: 12px 18px;
    font-size: 14px;
    color: var(--gray-light);
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.un-option:last-child {
    border-bottom: none;
}

.un-option:hover {
    background: rgba(57, 255, 20, 0.05);
    color: var(--white);
    padding-left: 24px;
}

.un-option.selected {
    background: rgba(57, 255, 20, 0.1);
    color: var(--neon);
    font-weight: 600;
}

.un-option-icon {
    font-size: 16px;
}

/* Custom Scrollbar for Select */
.un-select-options::-webkit-scrollbar {
    width: 6px;
}
.un-select-options::-webkit-scrollbar-track {
    background: transparent;
}
.un-select-options::-webkit-scrollbar-thumb {
    background: var(--black-5);
    border-radius: 10px;
}
.un-select-options::-webkit-scrollbar-thumb:hover {
    background: var(--neon);
}

.badge-green { background: rgba(57, 255, 20, 0.1); color: var(--neon); border: 1px solid rgba(57, 255, 20, 0.2); }
.badge-yellow { background: rgba(255, 215, 0, 0.1); color: #ffd700; border: 1px solid rgba(255, 215, 0, 0.2); }

/* Responsive Sidebar & Logo Centering */
@media (max-width: 1024px) {
    .sidebar {
        position: fixed;
        left: -300px;
        z-index: 5000;
        transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 20px 0 50px rgba(0,0,0,0.5);
    }

    .sidebar.open {
        left: 0;
    }

    .main {
        margin-left: 0 !important;
        width: 100% !important;
    }

    .main::before {
        left: 50% !important; /* Full center on mobile */
        background-size: 500px; /* Scale down for mobile screens */
    }

    #btn-menu {
        display: flex !important;
        margin-right: 15px;
    }

    .topbar {
        padding: 0 15px;
    }

    .topbar-left {
        display: none;
    }
}

@media (max-width: 600px) {
    .small-logo {
        height: 24px;
    }
}
