:root {
  --bg-dark-100: #0a0a0c;
  --bg-dark-200: #121215;
  --bg-dark-300: #1a1a1e;
  --primary: #f53b3b;
  --primary-hover: #ff5c5c;
  --text-main: #ffffff;
  --text-muted: #a0a0a0;
  --border: #2a2a30;
  --success: #00ff9d;
  --warning: #ffb800;
  --danger: #ff0055;
  --glass-bg: rgba(26, 26, 30, 0.6);
  --glass-border: rgba(255, 255, 255, 0.05);
  --sidebar-width: 280px;
}

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

body {
  font-family: "Inter", sans-serif;
  background-color: var(--bg-dark-100);
  color: var(--text-main);
  overflow: hidden;
  height: 100vh;
  display: flex;
}

.bg-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background:
    radial-gradient(
      circle at 15% 50%,
      rgba(245, 59, 59, 0.08),
      transparent 25%
    ),
    radial-gradient(circle at 85% 30%, rgba(245, 59, 59, 0.05), transparent 25%);
}

.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-dark-200);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 3rem;
  padding: 0.5rem;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), #d00000);
  border-radius: 12px;
  display: grid;
  place-items: center;
  box-shadow: 0 0 20px rgba(245, 59, 59, 0.3);
}

.logo-icon i {
  font-size: 1.2rem;
  color: white;
}

.brand h1 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, #fff, #bbb);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.2rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 500;
  position: relative;
  overflow: hidden;
}

.nav-item i {
  font-size: 1.2rem;
  transition: transform 0.3s ease;
}

.nav-item:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
}

.nav-item:hover i {
  transform: translateX(3px);
  color: var(--primary);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(245, 59, 59, 0.1), transparent);
  color: var(--primary);
  border-left: 3px solid var(--primary);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  margin-top: auto;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s ease;
}

.user-profile:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--glass-border);
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-dark-300);
  position: relative;
  padding: 2px;
  border: 2px solid var(--primary);
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.user-info h4 {
  font-size: 0.9rem;
  font-weight: 600;
}

.user-info span {
  font-size: 0.75rem;
  color: var(--success);
  display: flex;
  align-items: center;
  gap: 4px;
}

.user-info span::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--success);
}

.status-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 1rem 1.5rem;
  background: linear-gradient(to top, rgba(18, 18, 21, 0.95), transparent);
  border-top: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.status-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-dot.active {
  background: var(--success);
  box-shadow: 0 0 10px var(--success);
  animation: pulse 2s infinite;
}

.status-dot.warning {
  background: var(--warning);
  box-shadow: 0 0 10px var(--warning);
}

.main-content {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
  position: relative;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
}

.header-title h2 {
  font-size: 1.8rem;
  font-weight: 700;
}

.header-title p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

.header-actions {
  display: flex;
  gap: 1rem;
}

.btn {
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 20px rgba(245, 59, 59, 0.25);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(245, 59, 59, 0.35);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--text-muted);
}

.view-container {
  display: none;
  animation: fadeIn 0.4s ease-out;
}

.view-container.active {
  display: block;
}

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

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.5);
    opacity: 0.5;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-dark-200);
  border-radius: 16px;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), transparent);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  place-items: center;
  margin-bottom: 1rem;
}

.stat-icon i {
  font-size: 1.5rem;
  color: var(--primary);
}

.stat-value {
  font-size: 2.2rem;
  font-weight: 700;
  margin: 0.5rem 0;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.stat-trend {
  font-size: 0.85rem;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(0, 255, 157, 0.1);
  color: var(--success);
}

.stat-trend.negative {
  background: rgba(255, 0, 85, 0.1);
  color: var(--danger);
}

.charts-section {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.chart-container {
  background: var(--bg-dark-200);
  border-radius: 16px;
  padding: 1.5rem;
  min-height: 350px;
}

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

.section-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

.recent-activity {
  background: var(--bg-dark-200);
  border-radius: 16px;
  padding: 1.5rem;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  transition: background 0.2s;
}

.activity-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.activity-time {
  font-size: 0.8rem;
  color: var(--text-muted);
  min-width: 60px;
}

.activity-content {
  flex: 1;
}

.activity-title {
  font-weight: 600;
  margin-bottom: 2px;
}

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

.threat-high {
  border-left: 3px solid var(--danger);
}

.threat-medium {
  border-left: 3px solid var(--warning);
}

.threat-low {
  border-left: 3px solid var(--success);
}

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-dark-100);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

@media (max-width: 1200px) {
  .charts-section {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  body {
    flex-direction: column;
    overflow-y: auto;
  }

  .sidebar {
    width: 100%;
    height: auto;
    flex-direction: row;
    padding: 1rem;
    align-items: center;
    overflow-x: auto;
  }

  .nav-menu {
    flex-direction: row;
    margin-bottom: 0;
  }

  .user-profile {
    display: none;
  }

  .main-content {
    overflow-y: visible;
  }
}

.filter-controls {
  display: flex;
  gap: 1rem;
}

.filter-select {
  background: var(--bg-dark-300);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  cursor: pointer;
}

.filter-select:focus {
  border-color: var(--primary);
}

.live-feed-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 0.5rem;
}

.live-feed-table th {
  text-align: left;
  padding: 1rem;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.9rem;
}

.live-feed-table td {
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
}

.live-feed-table tr td:first-child {
  border-radius: 8px 0 0 8px;
}

.live-feed-table tr td:last-child {
  border-radius: 0 8px 8px 0;
}

.badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-risk-high {
  background: rgba(255, 0, 85, 0.15);
  color: var(--danger);
}
.badge-risk-med {
  background: rgba(255, 184, 0, 0.15);
  color: var(--warning);
}
.badge-risk-low {
  background: rgba(0, 255, 157, 0.15);
  color: var(--success);
}

.scanners-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.scanner-card {
  background: var(--bg-dark-200);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid var(--border);
}

.scanner-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.scanner-title {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-weight: 600;
}

.scanner-status {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
}

.scanner-status.active {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.scanner-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.metric-item {
  display: flex;
  flex-direction: column;
}

.metric-value {
  font-size: 1.2rem;
  font-weight: 700;
}

.metric-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.scanner-logs-container {
  margin-top: 2rem;
  background: #000;
  border-radius: 8px;
  padding: 1rem;
  font-family: "Consolas", monospace;
  height: 300px;
  overflow-y: auto;
  border: 1px solid var(--border);
}

.log-entry {
  padding: 4px 0;
  font-size: 0.85rem;
  color: #ccc;
  border-bottom: 1px solid #1a1a1e;
}

.log-time {
  color: var(--primary);
  margin-right: 0.5rem;
}

.analysis-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}

.heatmap-container {
  background: var(--bg-dark-200);
  border-radius: 16px;
  padding: 1.5rem;
  min-height: 400px;
  display: flex;
  flex-direction: column;
}

.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(20, 1fr);
  gap: 4px;
  margin-top: 1rem;
  flex: 1;
}

.heat-cell {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
  transition: all 0.2s;
}

.heat-cell:hover {
  transform: scale(1.2);
  z-index: 2;
  border: 1px solid white;
}

.heat-level-0 {
  background: rgba(255, 255, 255, 0.02);
}
.heat-level-1 {
  background: rgba(245, 59, 59, 0.2);
}
.heat-level-2 {
  background: rgba(245, 59, 59, 0.4);
}
.heat-level-3 {
  background: rgba(245, 59, 59, 0.6);
}
.heat-level-4 {
  background: rgba(245, 59, 59, 0.8);
}
.heat-level-5 {
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary);
}

.date-controls {
  display: flex;
  gap: 1rem;
}

.date-input {
  background: var(--bg-dark-100);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0.5rem;
  border-radius: 6px;
  font-family: inherit;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 2rem;
}

.settings-card {
  background: var(--bg-dark-200);
  border-radius: 16px;
  padding: 2rem;
}

.settings-group {
  margin-bottom: 2rem;
}

.settings-group h4 {
  margin-bottom: 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.setting-info h5 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.setting-info p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-dark-300);
  transition: 0.4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--primary);
}

input:checked + .slider:before {
  transform: translateX(24px);
}

.setting-input {
  width: 100%;
  background: var(--bg-dark-100);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0.8rem;
  border-radius: 8px;
  margin-top: 0.5rem;
}

.notification-dropdown {
  position: absolute;
  top: 80px;
  right: 2rem;
  width: 320px;
  background: var(--bg-dark-200);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  display: none;
  z-index: 1000;
  max-height: 400px;
  overflow-y: auto;
}

.notification-dropdown.active {
  display: block;
  animation: slideDown 0.2s ease-out;
}

.notification-item {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

.notification-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.notification-item.unread {
  background: rgba(245, 59, 59, 0.05);
  border-left: 3px solid var(--primary);
}

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

.header-search {
  position: relative;
}

.search-input {
  background: var(--bg-dark-300);
  border: 1px solid var(--border);
  padding: 0.6rem 1rem 0.6rem 2.5rem;
  border-radius: 8px;
  color: var(--text-main);
  width: 250px;
  transition: all 0.3s ease;
}

.search-input:focus {
  width: 300px;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(245, 59, 59, 0.1);
  outline: none;
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: var(--bg-dark-200);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 0.5rem;
  display: none;
  z-index: 1000;
}

.search-results.active {
  display: block;
}

.search-result-item {
  padding: 0.8rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.search-result-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.fa-spin {
  animation: fa-spin 2s infinite linear;
}

@keyframes fa-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.token-box {
  background: var(--bg-dark-100);
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-family: monospace;
  word-break: break-all;
  margin-top: 0.5rem;
  user-select: all;
  color: var(--success);
}

.discord-login-btn {
  background-color: #5865f2;
  color: white;
  padding: 10px 20px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s;
}

.discord-login-btn:hover {
  background-color: #4752c4;
}

.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.login-card {
  background: var(--bg-dark-200);
  padding: 3rem;
  border-radius: 16px;
  text-align: center;
  border: 1px solid var(--border);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}
