/* Admin Lobby Management Neon Theme CSS */

body.admin-lobby-management {
  /* Existing styles */
  background-color: var(--background);
  color: var(--text-primary);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Page Header */
.page-header {
  background: linear-gradient(135deg, #0A0A0A, #050505) !important;
  color: var(--text-primary) !important;
  padding: 2rem 0;
  position: relative;
  border-bottom: 1px solid rgba(57,255,20,0.1);
  transform: translateZ(0);
  will-change: transform;
}

.page-header h1 {
  color: var(--text-primary);
  text-shadow: 0 0 10px rgba(57, 255, 20, 0.3);
  font-weight: 800;
  transform: translateZ(0);
}

.page-header .lead {
  color: var(--text-secondary);
  font-weight: 500;
  transform: translateZ(0);
}

.page-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg,#00FF7F,#39FF14,#00FFBF);
  box-shadow: 0 0 10px var(--primary-neon);
  transform: translateZ(0);
}

/* Admin Navigation */
.admin-nav {
  background: #0A0A0A !important;
  padding: 1rem 0;
  transform: translateZ(0);
}

.btn-group .btn {
  border-radius: 8px;
  font-weight: 500;
  min-height: 44px;
  transform: translateZ(0);
  transition: all 0.2s ease;
  will-change: transform;
  margin: 0 2px;
}

.btn-group .btn:hover {
  transform: translateY(-2px);
}

.btn-group .btn-primary {
  background: linear-gradient(90deg, #00C3FF, #00FF7F);
  border: none;
  color: #000;
  box-shadow: 0 0 12px rgba(0, 195, 255, 0.3);
}

.btn-group .btn-primary.active {
  background: linear-gradient(90deg, #00FF7F, #39FF14);
  color: #000;
  box-shadow: 0 0 12px rgba(0, 255, 127, 0.3);
}

.btn-group .btn-outline-primary {
  background: transparent;
  border: 1px solid rgba(57,255,20,0.3);
  color: var(--text-secondary);
  box-shadow: 0 0 8px rgba(57, 255, 20, 0.1);
}

.btn-group .btn-outline-primary:hover {
  background: rgba(57,255,20,0.1);
  border-color: var(--primary-neon);
  color: var(--primary-neon);
  box-shadow: 0 0 12px rgba(57, 255, 20, 0.2);
}

.btn-group .btn-outline-primary.active {
  background: rgba(57,255,20,0.15);
  border-color: var(--primary-neon);
  color: var(--primary-neon);
  box-shadow: 0 0 12px rgba(57, 255, 20, 0.3);
}

/* Existing styles */
:root {
  /* Color Tokens */
  --background: #050505;
  --primary-neon: #39FF14;
  --secondary-neon: #00FF7F;
  --accent-yellow: #FFD54F;
  --accent-red: #FF4444;
  --text-primary: #FFFFFF;
  --text-secondary: #9FFFB0;
  --text-muted: #9CA3AF;
  --glass-panel: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(57, 255, 20, 0.25);
  --slot-empty: rgba(255, 255, 255, 0.15);
  --slot-joined: #39FF14;
  --slot-reserved: #CCFF00;
  
  /* Glow Effects */
  --glow-primary: 0 0 12px #39FF14;
  --glow-secondary: 0 0 12px #00FF7F;
  --glow-warning: 0 0 12px #FFD54F;
  --glow-danger: 0 0 12px #FF4444;
  --glow-holographic: linear-gradient(135deg, #39FF14, #00FFBF);
}

/* Global Styles */
body.admin-lobby-management {
  background-color: var(--background);
  color: var(--text-primary);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Top Header (Lobby Overview) */
.lobby-header {
  background: var(--glow-holographic);
  border: 1px solid rgba(57, 255, 20, 0.3);
  border-radius: 20px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--glow-primary);
  animation: float 6s ease-in-out infinite;
  transform: translateZ(0);
  will-change: transform;
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-5px); }
  100% { transform: translateY(0px); }
}

.lobby-header h1 {
  color: #000;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
  font-weight: 800;
}

.lobby-header .lobby-meta {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 1rem;
  margin-top: 1rem;
}

.lobby-header .match-code {
  font-family: 'Courier New', monospace;
  font-weight: bold;
  color: var(--primary-neon);
  background: rgba(0, 0, 0, 0.3);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lobby-header .match-code:hover {
  background: rgba(0, 0, 0, 0.5);
  box-shadow: var(--glow-primary);
}

.lobby-header .slots-info {
  font-weight: bold;
  color: var(--text-secondary);
}

.lobby-header .btn-neon {
  background: transparent;
  border: 1px solid var(--primary-neon);
  color: var(--primary-neon);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-weight: 600;
  transition: all 0.3s ease;
  transform: translateZ(0);
  will-change: transform, box-shadow;
}

.lobby-header .btn-neon:hover {
  background: var(--primary-neon);
  color: #000;
  box-shadow: var(--glow-primary);
  transform: scale(1.03);
}

/* Glass Cards */
.glass-card {
  background: var(--glass-panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 0 10px rgba(57, 255, 20, 0.1);
  transform: translateZ(0);
  will-change: transform, box-shadow;
  transition: all 0.3s ease;
}

.glass-card:hover {
  box-shadow: var(--glow-primary);
  border-color: var(--primary-neon);
  transform: translateY(-3px);
}

/* Tournament Selection Section */
#tournamentSelect {
  background: rgba(30, 30, 30, 0.8) !important;
  border: 1px solid rgba(57, 255, 20, 0.3) !important;
  color: var(--text-primary) !important;
  border-radius: 8px;
  padding: 0.75rem;
  transition: all 0.3s ease;
}

#tournamentSelect:focus {
  background: rgba(40, 40, 40, 0.8) !important;
  border-color: var(--primary-neon) !important;
  box-shadow: 0 0 0 0.25rem rgba(57, 255, 20, 0.25) !important;
  color: var(--text-primary) !important;
}

#tournamentSelect option {
  background: #121212;
  color: var(--text-primary);
}

/* Tournament Info Stats */
#tournamentInfo .border.rounded {
  border-color: rgba(57, 255, 20, 0.2) !important;
  background: rgba(30, 30, 30, 0.5) !important;
}

#tournamentInfo .text-muted {
  color: var(--text-secondary) !important;
}

#tournamentInfo .fw-bold.text-light {
  color: var(--text-primary) !important;
}

/* Slot Grid UI */
.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

/* Limit max width of cards on large screens */
@media (min-width: 1200px) {
  .slot-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 300px));
  }
}

@media (max-width: 768px) {
  .slot-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .slot-grid {
    grid-template-columns: 1fr;
  }
}

/* Slot Box UI */
.slot-card {
  background: var(--glass-panel);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 1.25rem;
  transition: all 0.3s ease;
  box-shadow: 0 0 8px rgba(57, 255, 20, 0.1);
  position: relative;
  overflow: hidden;
  transform: translateZ(0);
  will-change: transform, box-shadow;
  min-height: 180px;
  display: flex;
  flex-direction: column;
}

.slot-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--glow-primary);
}

/* Slot States */
.slot-card.empty {
  border: 1px solid var(--slot-empty);
  background: rgba(255, 255, 255, 0.02);
  animation: pulseGlow 3s ease-in-out infinite;
  cursor: pointer;
}

.slot-card.joined {
  border: 1px solid var(--slot-joined);
  background: linear-gradient(135deg, rgba(57, 255, 20, 0.1), rgba(0, 255, 127, 0.05));
  box-shadow: 0 0 12px rgba(57, 255, 20, 0.2);
}

.slot-card.reserved {
  border: 1px solid var(--slot-reserved);
  background: linear-gradient(135deg, rgba(204, 255, 0, 0.1), rgba(255, 213, 79, 0.05));
  box-shadow: 0 0 8px rgba(204, 255, 0, 0.2);
}

.slot-card.reserved::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 10px,
    rgba(204, 255, 0, 0.1) 10px,
    rgba(204, 255, 0, 0.1) 20px
  );
}

/* Slot Content */
.slot-card .slot-number {
  font-weight: bold;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
}

.slot-card .team-info {
  flex-grow: 1;
}

.slot-card .team-name {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  word-break: break-word;
}

.slot-card .team-id {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.slot-card .player-count {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Status Indicator */
.slot-status {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 0.5rem;
}

.slot-status.empty {
  background: var(--slot-empty);
  box-shadow: 0 0 4px var(--slot-empty);
}

.slot-status.joined {
  background: var(--slot-joined);
  box-shadow: 0 0 8px var(--slot-joined);
}

.slot-status.reserved {
  background: var(--slot-reserved);
  box-shadow: 0 0 8px var(--slot-reserved);
}

/* Action Buttons */
.slot-card .action-buttons {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-top: auto;
  padding-top: 0.5rem;
}

.slot-card .btn-action {
  min-width: 30px;
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Kick/Replace Button */
.btn-kick-replace {
  background: transparent;
  border: 1px solid var(--accent-red);
  color: var(--accent-red);
  border-radius: 6px;
  padding: 0.25rem;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  transform: translateZ(0);
  will-change: transform;
}

.btn-kick-replace:hover {
  background: var(--accent-red);
  color: #000;
  box-shadow: var(--glow-danger);
  transform: scale(1.1);
}

.btn-kick-replace:active {
  transform: scale(0.95);
}

/* Team List Panel */
.team-list-panel {
  max-height: 500px;
  overflow-y: auto;
}

.team-list-item {
  background: var(--glass-panel);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  transform: translateZ(0);
  will-change: transform;
}

.team-list-item:hover {
  border-color: var(--primary-neon);
  box-shadow: var(--glow-primary);
  transform: translateX(5px);
}

.team-list-item.active {
  border-color: var(--primary-neon);
  box-shadow: 0 0 12px rgba(57, 255, 20, 0.3);
}

.team-list-item .team-name {
  font-weight: 600;
  color: var(--text-primary);
}

.team-list-item .player-count {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Team Action Buttons */
.team-list-item .btn-action {
  min-width: 30px;
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Create Lobby Form */
.create-lobby-form .form-control,
.create-lobby-form .form-select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(57, 255, 20, 0.3);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 0.75rem;
  transition: all 0.3s ease;
}

.create-lobby-form .form-control:focus,
.create-lobby-form .form-select:focus {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--primary-neon);
  box-shadow: 0 0 0 0.25rem rgba(57, 255, 20, 0.25);
  color: var(--text-primary);
}

.create-lobby-form .btn-create {
  background: var(--glow-holographic);
  border: none;
  color: #000;
  font-weight: 700;
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  transition: all 0.3s ease;
  box-shadow: 0 0 15px rgba(57, 255, 20, 0.5);
  transform: translateZ(0);
  will-change: transform, box-shadow;
}

.create-lobby-form .btn-create:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 0 25px rgba(57, 255, 20, 0.8);
  animation: pulseGlowButton 1.5s ease-in-out infinite;
}

@keyframes pulseGlow {
  0% { box-shadow: 0 0 5px rgba(57, 255, 20, 0.3); }
  50% { box-shadow: 0 0 15px rgba(57, 255, 20, 0.6); }
  100% { box-shadow: 0 0 5px rgba(57, 255, 20, 0.3); }
}

@keyframes pulseGlowButton {
  0% { box-shadow: 0 0 15px rgba(57, 255, 20, 0.5); }
  50% { box-shadow: 0 0 25px rgba(57, 255, 20, 0.8); }
  100% { box-shadow: 0 0 15px rgba(57, 255, 20, 0.5); }
}

/* Date/Time and Match Count Styling */
.date-time-display {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
}

.date-time-display i {
  color: var(--primary-neon);
  margin-right: 0.25rem;
}

.match-count-display {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
}

.match-count-display i {
  color: var(--primary-neon);
  margin-right: 0.25rem;
}

/* Team Information Section Styling */
.team-info-section {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 0.75rem;
  margin-top: 0.5rem;
  border: 1px solid rgba(57, 255, 20, 0.1);
}

.team-info-section .team-name-display {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.team-info-section .captain-info {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

.team-info-section .game-uid {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

.team-info-section .member-count {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.team-info-section i {
  color: var(--primary-neon);
  margin-right: 0.25rem;
}

/* Drop Zone Styling */
.drop-zone {
  background: rgba(0, 0, 0, 0.2);
  border: 2px dashed rgba(57, 255, 20, 0.3);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  color: var(--text-secondary);
  font-weight: 500;
  transition: all 0.3s ease;
}

.drop-zone:hover,
.drop-zone.drag-over {
  background: rgba(57, 255, 20, 0.1);
  border-color: var(--primary-neon);
  box-shadow: 0 0 10px rgba(57, 255, 20, 0.2);
}

.drop-zone i {
  color: var(--primary-neon);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

/* Form Field Styling */
.form-field-label {
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.form-field-label i {
  color: var(--primary-neon);
  margin-right: 0.5rem;
}

.form-field-hint {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.form-field-hint i {
  color: var(--primary-neon);
  margin-right: 0.25rem;
}

/* Room Details Section */
.room-details-section {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 0.75rem;
  margin-top: 0.5rem;
  border: 1px solid rgba(57, 255, 20, 0.1);
}

.room-details-section .detail-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.25rem;
  padding: 0.25rem 0;
}

.room-details-section .detail-label {
  color: var(--text-secondary);
  font-weight: 500;
}

.room-details-section .detail-value {
  color: var(--text-primary);
  font-weight: 600;
}

.room-details-section i {
  color: var(--primary-neon);
  margin-right: 0.25rem;
}

/* Maps Section */
.maps-section {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 0.75rem;
  margin-top: 0.5rem;
  border: 1px solid rgba(57, 255, 20, 0.1);
}

.maps-section .section-title {
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
}

.maps-section .section-title i {
  color: var(--primary-neon);
  margin-right: 0.5rem;
}

.maps-section .no-maps-message {
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  padding: 1rem;
}

/* Stage Name Badge */
.stage-name-badge {
  background: linear-gradient(135deg, #39FF14, #00FFBF);
  color: #000;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  border-radius: 20px;
  font-size: 0.75rem;
}

/* Modal Styling */
.modal-content {
  background: #121212;
  color: var(--text-primary);
  border: 1px solid rgba(57, 255, 20, 0.3);
}

.modal-header {
  border-bottom: 1px solid rgba(57, 255, 20, 0.2);
}

.modal-footer {
  border-top: 1px solid rgba(57, 255, 20, 0.2);
}

.modal-content .form-control,
.modal-content .form-select {
  background: rgba(30, 30, 30, 0.8);
  border: 1px solid rgba(57, 255, 20, 0.3);
  color: var(--text-primary);
}

.modal-content .form-control:focus,
.modal-content .form-select:focus {
  background: rgba(40, 40, 40, 0.8);
  border-color: var(--primary-neon);
  box-shadow: 0 0 0 0.25rem rgba(57, 255, 20, 0.25);
}

.modal-content .form-select option {
  background: #121212;
  color: var(--text-primary);
}

/* Team Details Modal Specific Styling */
.modal-content .table-dark {
  --bs-table-bg: rgba(30, 30, 30, 0.8);
  --bs-table-striped-bg: rgba(40, 40, 40, 0.8);
  --bs-table-hover-bg: rgba(50, 50, 50, 0.8);
  --bs-table-border-color: rgba(57, 255, 20, 0.2);
}

.modal-content .table-dark th {
  color: var(--text-secondary);
  border-color: rgba(57, 255, 20, 0.2);
}

.modal-content .table-dark td {
  color: var(--text-primary);
  border-color: rgba(57, 255, 20, 0.2);
}

/* Animations - GPU Optimized */
.slot-card,
.team-list-item,
.btn-neon,
.btn-create {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  will-change: transform, box-shadow;
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Navigation Glow */
.nav-link[href="admin-lobby-simple.html"],
.nav-link[href="lobby.html"] {
  color: var(--primary-neon) !important;
  font-weight: 600;
  transform: scale(1.05);
  box-shadow: var(--glow-secondary), 0 0 24px #39FF14;
  text-shadow: 0 0 8px var(--primary-neon);
  border-radius: 8px;
  padding: 8px 12px;
  margin: 0 2px;
  transition: all 0.3s ease;
}

/* Toast Notifications */
.toast {
  background: var(--glass-panel);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  box-shadow: var(--glow-primary);
  color: var(--text-primary);
}

.toast-success {
  border-color: var(--slot-joined);
  box-shadow: 0 0 12px rgba(57, 255, 20, 0.3);
}

.toast-error {
  border-color: var(--accent-red);
  box-shadow: 0 0 12px rgba(255, 68, 68, 0.3);
}

.toast-warning {
  border-color: var(--accent-yellow);
  box-shadow: 0 0 12px rgba(255, 213, 79, 0.3);
}

/* Placeholder Text Styles */
.placeholder-text {
  color: var(--text-secondary);
}

.placeholder-heading {
  color: var(--text-primary);
}

/* Responsive Design */
@media (max-width: 768px) {
  .lobby-header {
    padding: 1rem;
  }
  
  .glass-card {
    padding: 1rem;
  }
  
  .slot-grid {
    gap: 1rem;
  }
  
  .slot-card {
    padding: 1rem;
  }
  
  .create-lobby-form .btn-create {
    width: 100%;
  }
  
  /* Ensure buttons are visible on mobile */
  .slot-card .action-buttons {
    justify-content: center;
  }
  
  .slot-card .btn-action,
  .team-list-item .btn-action {
    min-width: auto;
    padding: 0.25rem 0.4rem;
    font-size: 0.75rem;
  }
  
  /* Adjust team list item layout for mobile */
  .team-list-item .d-flex {
    flex-wrap: wrap;
  }
  
  .team-list-item .d-flex > div:first-child {
    flex-basis: 100%;
    margin-bottom: 0.5rem;
  }
}

/* Loading States */
.loading-placeholder {
  background: linear-gradient(90deg, rgba(255,255,255,0.05), rgba(255,255,255,0.1), rgba(255,255,255,0.05));
  background-size: 200% 100%;
  animation: loading 1.5s ease-in-out infinite;
  border-radius: 12px;
  height: 20px;
  margin-bottom: 1rem;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}