/* Design System Variables */
:root {
  --bg-obsidian: #09090c;
  --bg-panel: rgba(18, 18, 26, 0.65);
  --bg-card: rgba(26, 26, 36, 0.45);
  
  --accent-gold: #ffb703;
  --accent-gold-hover: #fb8500;
  --accent-gold-glow: rgba(255, 183, 3, 0.2);
  
  --emerald: #06d6a0;
  --emerald-glow: rgba(6, 214, 160, 0.3);
  
  --crimson: #ff4d6d;
  --crimson-hover: #ff0054;
  --crimson-glow: rgba(255, 77, 109, 0.3);
  
  --gray-light: #e2e8f0;
  --gray-medium: #94a3b8;
  --gray-dark: #334155;
  
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(255, 183, 3, 0.4);
  
  --shadow-premium: 0 16px 40px -10px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.1);
  --shadow-glow: 0 0 30px rgba(255, 183, 3, 0.15);
  --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Global Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Outfit', sans-serif;
}

body {
  background-color: var(--bg-obsidian);
  color: var(--gray-light);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

/* Background Glowing Accents */
.glow-bg {
  position: fixed;
  top: -10%;
  left: 30%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-gold-glow) 0%, rgba(9, 9, 12, 0) 70%);
  z-index: -1;
  pointer-events: none;
  filter: blur(80px);
}

/* Main Container Layout */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 40px 20px;
  display: flex;
  flex-direction: column;
  gap: 30px;
  z-index: 1;
}

/* Glassmorphism Base Utility */
.glass {
  background: var(--bg-panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  box-shadow: var(--shadow-premium);
  border-radius: 16px;
}

/* App Header Section */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-icon {
  background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-hover) 100%);
  color: var(--bg-obsidian);
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 8px 24px var(--accent-gold-glow);
}

.logo-icon i {
  width: 28px;
  height: 28px;
}

.logo-text h1 {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 1px;
}

.logo-text h1 span {
  color: var(--accent-gold);
  text-shadow: 0 0 15px var(--accent-gold-glow);
}

.logo-text p {
  color: var(--gray-medium);
  font-size: 0.9rem;
  font-weight: 300;
}

/* Status Indicator panel */
.status-panel {
  padding: 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  position: relative;
}

.status-dot.connected {
  background-color: var(--emerald);
  box-shadow: 0 0 10px var(--emerald);
  animation: pulse-green 2s infinite;
}

.status-dot.disconnected {
  background-color: var(--crimson);
  box-shadow: 0 0 10px var(--crimson);
  animation: pulse-red 2s infinite;
}

.status-label {
  font-size: 0.95rem;
  font-weight: 600;
}

.status-info {
  font-size: 0.8rem;
  color: var(--gray-medium);
}

.status-info strong {
  color: var(--gray-light);
}

/* Controls (Stats cards & filter) */
.controls-panel {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 2fr 1.2fr;
  gap: 20px;
  align-items: stretch;
}

.stat-card {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.amount-icon {
  background-color: rgba(255, 183, 3, 0.1);
  color: var(--accent-gold);
  border: 1px solid rgba(255, 183, 3, 0.2);
}

.uptime-icon {
  background-color: rgba(6, 214, 160, 0.1);
  color: var(--emerald);
  border: 1px solid rgba(6, 214, 160, 0.2);
}

.stat-content {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.2;
}

.stat-desc {
  font-size: 0.8rem;
  color: var(--gray-medium);
}

/* Search Input Styling */
.search-bar {
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  background: var(--bg-card);
}

.search-bar i {
  color: var(--gray-medium);
  width: 20px;
  height: 20px;
}

.search-bar input {
  background: transparent;
  border: none;
  color: var(--gray-light);
  font-size: 1rem;
  width: 100%;
  outline: none;
}

.search-bar input::placeholder {
  color: var(--gray-dark);
}

.search-bar:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 15px rgba(255, 183, 3, 0.1);
}

/* Actions Section */
.actions-area {
  display: flex;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition-smooth);
  width: 100%;
}

.btn:active {
  transform: scale(0.97);
}

.btn-danger {
  background: linear-gradient(135deg, var(--crimson) 0%, #d90429 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(255, 77, 109, 0.2);
}

.btn-danger:hover {
  background: linear-gradient(135deg, #ff758f 0%, var(--crimson-hover) 100%);
  box-shadow: 0 6px 20px rgba(255, 77, 109, 0.35);
}

.btn-secondary {
  background: var(--gray-dark);
  color: var(--gray-light);
}

.btn-secondary:hover {
  background: #475569;
}

.glass-btn {
  background: rgba(255, 77, 109, 0.1);
  border: 1px solid rgba(255, 77, 109, 0.2);
  color: #ff758f;
}

.glass-btn:hover {
  background: rgba(255, 77, 109, 0.2);
}

/* Table Card Panel */
.main-content {
  overflow: hidden;
  padding: 10px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th {
  padding: 18px 24px;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-medium);
  border-bottom: 2px solid var(--border-glass);
}

th i {
  vertical-align: middle;
  margin-right: 6px;
  width: 16px;
  height: 16px;
}

td {
  padding: 16px 24px;
  font-size: 1rem;
  border-bottom: 1px solid var(--border-glass);
  vertical-align: middle;
}

/* Table Row Entrances */
tbody tr:not(.empty-state-row) {
  animation: slide-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* Table Item Customizations */
.username-cell {
  font-weight: 600;
  color: var(--gray-light);
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3a86c8 0%, #833ab4 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: white;
}

.slot-cell {
  font-weight: 500;
  color: #fff;
  letter-spacing: 0.3px;
}

.amount-cell {
  font-weight: 700;
  color: var(--accent-gold);
  text-shadow: 0 0 10px rgba(255, 183, 3, 0.15);
  font-size: 1.1rem;
}

.time-cell {
  color: var(--gray-medium);
  font-size: 0.9rem;
  font-weight: 300;
}

.actions-cell, .actions-header {
  text-align: right;
}

/* Action Delete Button inside rows */
.btn-delete-row {
  background: transparent;
  border: 1px solid rgba(255, 77, 109, 0.2);
  color: var(--crimson);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-delete-row:hover {
  background: var(--crimson);
  color: white;
  border-color: var(--crimson);
  box-shadow: 0 4px 12px var(--crimson-glow);
  transform: translateY(-2px);
}

.btn-delete-row i {
  width: 18px;
  height: 18px;
}

/* Empty State Styling */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  gap: 16px;
  color: var(--gray-medium);
}

.empty-state i {
  width: 54px;
  height: 54px;
  stroke-width: 1;
  color: var(--gray-dark);
}

.empty-state p {
  font-size: 1.1rem;
  text-align: center;
  max-width: 400px;
}

.empty-state p span {
  display: block;
  font-weight: 600;
  color: var(--accent-gold);
  margin-top: 6px;
  font-size: 0.95rem;
}

/* Dialog Modal Overlay styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  width: 90%;
  max-width: 440px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: var(--bg-obsidian);
  border-color: rgba(255, 77, 109, 0.2);
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--crimson);
}

.modal-header i {
  width: 28px;
  height: 28px;
}

.modal-header h3 {
  font-size: 1.3rem;
  font-weight: 700;
}

.modal-body {
  font-size: 1.05rem;
  color: var(--gray-medium);
  line-height: 1.5;
}

.modal-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}

/* Animations */
@keyframes pulse-green {
  0% { box-shadow: 0 0 0 0 rgba(6, 214, 160, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(6, 214, 160, 0); }
  100% { box-shadow: 0 0 0 0 rgba(6, 214, 160, 0); }
}

@keyframes pulse-red {
  0% { box-shadow: 0 0 0 0 rgba(255, 77, 109, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(255, 77, 109, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 77, 109, 0); }
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-pop {
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .animate-pop {
  transform: scale(1);
}

/* Responsive Breakpoints */
@media (max-width: 992px) {
  .controls-panel {
    grid-template-columns: 1fr 1fr;
  }
  .search-bar {
    grid-column: span 2;
  }
  .actions-area {
    grid-column: span 2;
  }
}

@media (max-width: 600px) {
  .container {
    margin: 20px 10px;
    gap: 20px;
  }
  .app-header {
    flex-direction: column;
    align-items: stretch;
  }
  .status-panel {
    align-items: flex-start;
  }
  .controls-panel {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .search-bar, .actions-area {
    grid-column: span 1;
  }
  td, th {
    padding: 12px 14px;
  }
  .user-avatar {
    display: none;
  }
}
