/* ==========================================================================
   Growtopia Live Player & Banwave Radar CSS
   ========================================================================== */

:root {
  --bg-dark: #090d16;
  --bg-card: rgba(22, 30, 49, 0.65);
  --border-card: rgba(255, 255, 255, 0.08);
  --border-card-hover: rgba(99, 102, 241, 0.35);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --primary: #6366f1;
  --primary-glow: rgba(99, 102, 241, 0.4);
  --accent-green: #10b981;
  --accent-green-glow: rgba(16, 185, 129, 0.3);
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;
  --accent-red-glow: rgba(239, 68, 68, 0.5);
  --accent-blue: #3b82f6;

  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;

  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;

  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  padding-bottom: 40px;
}

/* Background Glowing Orbs */
.app-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.25;
}

.orb-1 {
  top: -100px;
  left: -100px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
}

.orb-2 {
  bottom: -150px;
  right: -100px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #8b5cf6 0%, transparent 70%);
}

/* Emergency Banwave Banner */
.banwave-alert-banner {
  background: linear-gradient(90deg, #dc2626 0%, #b91c1c 50%, #dc2626 100%);
  color: #ffffff;
  padding: 12px 20px;
  text-align: center;
  font-weight: 700;
  font-family: var(--font-heading);
  letter-spacing: 0.5px;
  box-shadow: 0 4px 20px var(--accent-red-glow);
  position: relative;
  z-index: 100;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  animation: bannerGlow 2s infinite alternate;
}

@keyframes bannerGlow {
  from { box-shadow: 0 0 15px rgba(239, 68, 68, 0.6); }
  to { box-shadow: 0 0 30px rgba(239, 68, 68, 0.9); }
}

.banner-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 14px;
}

.siren-icon {
  font-size: 18px;
  animation: rotateSiren 1s linear infinite;
}

@keyframes rotateSiren {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* Container */
.dashboard-container {
  position: relative;
  z-index: 1;
  max-width: 1350px;
  margin: 0 auto;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Glassmorphism Card Style */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: border-color var(--transition-normal), transform var(--transition-normal);
}

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

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
}

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

.logo-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #fff;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.brand-text h1 {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--text-main);
  line-height: 1.1;
}

.brand-text h1 span {
  color: var(--primary);
}

.brand-text .subtitle {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 16px;
}

.server-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 8px 14px;
  border-radius: 30px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-green);
  letter-spacing: 0.5px;
  transition: all var(--transition-fast);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-green);
  box-shadow: 0 0 10px var(--accent-green);
  animation: pulseAnimation 1.8s infinite;
}

@keyframes pulseAnimation {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.refresh-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-card);
  padding: 8px 14px;
  border-radius: 30px;
  font-size: 12px;
  color: var(--text-muted);
}

.spinning-icon {
  animation: spin 3s linear infinite;
  color: var(--primary);
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Hero Section */
.hero-section {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 20px;
}

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

.main-counter-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(30, 41, 71, 0.8) 0%, rgba(15, 23, 42, 0.9) 100%);
  border: 1px solid rgba(99, 102, 241, 0.25);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), inset 0 0 20px rgba(99, 102, 241, 0.08);
}

.card-header-sm {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.trend-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
}

.counter-display {
  margin: 20px 0;
}

.counter-display h2 {
  font-family: var(--font-heading);
  font-size: 54px;
  font-weight: 800;
  line-height: 1;
  color: #ffffff;
  text-shadow: 0 0 25px var(--primary-glow);
  letter-spacing: -1px;
}

.counter-display .unit {
  font-size: 14px;
  color: var(--text-muted);
  display: block;
  margin-top: 6px;
  font-weight: 500;
}

.card-footer-sm {
  font-size: 12px;
  color: var(--text-dim);
}

.card-footer-sm strong {
  color: var(--text-muted);
}

/* Quick Stats Grid */
.quick-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

@media (max-width: 576px) {
  .quick-stats-grid {
    grid-template-columns: 1fr;
  }
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.peak-icon {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
}

.low-icon {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
}

.avg-icon {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
}

.ban-icon {
  background: rgba(139, 92, 246, 0.15);
  color: #8b5cf6;
}

.stat-info .stat-label {
  font-size: 12px;
  color: var(--text-muted);
  display: block;
  margin-bottom: 2px;
}

.stat-info h3 {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.stat-info .stat-sub {
  font-size: 11px;
  color: var(--text-dim);
}

/* Main Layout Grid */
.main-layout {
  display: grid;
  grid-template-columns: 2.2fr 1fr;
  gap: 20px;
}

@media (max-width: 992px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
}

/* Chart Section */
.chart-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 420px;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.chart-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chart-title i {
  font-size: 24px;
  color: var(--primary);
}

.chart-title h3 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
}

.chart-title p {
  font-size: 12px;
  color: var(--text-muted);
}

.timeframe-selector {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-card);
}

.tf-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tf-btn:hover {
  color: var(--text-main);
}

.tf-btn.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 10px var(--primary-glow);
}

.chart-canvas-container {
  position: relative;
  flex-grow: 1;
  width: 100%;
  min-height: 320px;
}

/* Side Column (Radar & Webhook) */
.side-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.radar-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card-header-badge {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.radar-status-box {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 16px;
  border-radius: var(--radius-md);
  transition: all var(--transition-normal);
}

.status-gauge-ring {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--accent-green);
  flex-shrink: 0;
}

.radar-status-info h4 {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: var(--accent-green);
}

.radar-status-info p {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.3;
}

/* Sound Toggle */
.sound-toggle-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  font-size: 12px;
  color: var(--text-muted);
}

.sound-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Switch Toggle Styling */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: .3s;
  border-radius: 34px;
}

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

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

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

/* Webhook Card */
.webhook-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.webhook-card h4 {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #5865f2;
}

.card-sub-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

.webhook-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-group label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.input-group input, .custom-select {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-card);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 13px;
  outline: none;
  transition: border-color var(--transition-fast);
}

.input-group input:focus, .custom-select:focus {
  border-color: var(--primary);
}

.custom-select option {
  background: #0f172a;
  color: #fff;
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.tools-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
  background: #4f46e5;
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(88, 101, 242, 0.15);
  color: #5865f2;
  border: 1px solid rgba(88, 101, 242, 0.3);
}

.btn-secondary:hover {
  background: rgba(88, 101, 242, 0.25);
  transform: translateY(-1px);
}

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

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

/* Table Section */
.table-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.table-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.table-header h3 {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 700;
}

.badge-sub {
  font-size: 11px;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.04);
  padding: 4px 10px;
  border-radius: 20px;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.data-table th {
  background: rgba(15, 23, 42, 0.6);
  color: var(--text-muted);
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-card);
  font-size: 11px;
  letter-spacing: 0.5px;
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-main);
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* Badges for Banwave Severity */
.badge-severity {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}

.badge-critical {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.badge-high {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.badge-moderate {
  background: rgba(99, 102, 241, 0.2);
  color: #6366f1;
  border: 1px solid rgba(99, 102, 241, 0.4);
}

.badge-ended {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.text-center {
  text-align: center;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 1;
  transition: opacity var(--transition-fast);
}

.modal-backdrop.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal-content {
  background: var(--bg-dark);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  max-width: 650px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
}

.modal-header {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-card);
}

.modal-header h3 {
  font-family: var(--font-heading);
  font-size: 18px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.btn-close:hover {
  color: var(--text-main);
}

.export-modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

@media (max-width: 576px) {
  .export-action-grid {
    grid-template-columns: 1fr;
  }
}

.export-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.export-box h4 {
  font-family: var(--font-heading);
  font-size: 15px;
  color: var(--text-main);
}

.export-box p {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

.btn-group-export {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--border-card);
  backdrop-filter: blur(12px);
  color: var(--text-main);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast-success i { color: var(--accent-green); }
.toast-error i { color: var(--accent-red); }

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

.hidden {
  display: none !important;
}

/* Footer */
.footer {
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 10px;
}
