/* ============================================================================
   ADMIN DARK REDESIGN EXTENSION (2025-10-03)
   Alle View-Container: dashboard-view, pools-view, seasons-view,
   registrations-view, users-view, settings-view, escalations-view
   
   Ziel: Komplettes Dark Theme für Admin-Bereich
   ============================================================================ */

/* === ADMIN VIEW CONTAINER: DARK BACKGROUND === */
#dashboard-view,
#pools-view,
#seasons-view,
#registrations-view,
#users-view,
#settings-view,
#escalations-view,
.admin-content {
  background: var(--admin-bg-darkest, #0a0e12) !important;
  color: var(--admin-text-primary, #e8f0f8);
  min-height: calc(100vh - var(--header-height, 60px));
}

/* === TABLES: DARK ALTERNIERENDE ZEILEN (wie Rangliste) === */
#dashboard-view table,
#pools-view table,
#seasons-view table,
#registrations-view table,
#users-view table,
#settings-view table,
#escalations-view table,
.admin-content table {
  background: transparent;
  border-collapse: collapse;
  width: 100%;
}

/* Table Headers */
#dashboard-view table thead,
#pools-view table thead,
#seasons-view table thead,
#registrations-view table thead,
#users-view table thead,
#settings-view table thead,
#escalations-view table thead {
  background: linear-gradient(180deg,
    rgba(20, 26, 32, 0.7) 0%,
    rgba(14, 18, 24, 0.6) 100%);
  border-bottom: 1px solid rgba(0, 255, 198, 0.18);
}

#dashboard-view table th,
#pools-view table th,
#seasons-view table th,
#registrations-view table th,
#users-view table th,
#settings-view table th,
#escalations-view table th {
  padding: 14px 12px;
  text-align: left;
  font-family: var(--font-display, 'Orbitron', sans-serif);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--admin-neon-cyan, #00FFC6);
  background: transparent;
}

/* Table Body - Alternierende Zeilen */
#dashboard-view table tbody tr,
#pools-view table tbody tr,
#seasons-view table tbody tr,
#registrations-view table tbody tr,
#users-view table tbody tr,
#settings-view table tbody tr,
#escalations-view table tbody tr {
  background: rgba(20, 26, 32, 0.45); /* Dunkler Grauton 1 */
  border-bottom: 1px solid rgba(0, 255, 198, 0.08);
  transition: all 0.2s ease;
}

#dashboard-view table tbody tr:nth-child(even),
#pools-view table tbody tr:nth-child(even),
#seasons-view table tbody tr:nth-child(even),
#registrations-view table tbody tr:nth-child(even),
#users-view table tbody tr:nth-child(even),
#settings-view table tbody tr:nth-child(even),
#escalations-view table tbody tr:nth-child(even) {
  background: rgba(26, 34, 42, 0.55); /* Dunkler Grauton 2 */
}

#dashboard-view table tbody tr:hover,
#pools-view table tbody tr:hover,
#seasons-view table tbody tr:hover,
#registrations-view table tbody tr:hover,
#users-view table tbody tr:hover,
#settings-view table tbody tr:hover,
#escalations-view table tbody tr:hover {
  background: linear-gradient(90deg,
    rgba(0, 255, 198, 0.12) 0%,
    rgba(26, 34, 42, 0.6) 100%);
  box-shadow: inset 3px 0 0 rgba(0, 255, 198, 0.4);
}

#dashboard-view table tbody td,
#pools-view table tbody td,
#seasons-view table tbody td,
#registrations-view table tbody td,
#users-view table tbody td,
#settings-view table tbody td,
#escalations-view table tbody td {
  padding: 14px 12px;
  color: var(--admin-text-primary, #e8f0f8);
  font-size: 14px;
  font-weight: 500;
  background: transparent;
}

/* === CARDS/PANELS: DARK GLASS === */
#dashboard-view .card,
#pools-view .card,
#seasons-view .card,
#registrations-view .card,
#users-view .card,
#settings-view .card,
#escalations-view .card,
.admin-content .card,
.admin-content .panel,
.admin-content .section {
  background: var(--admin-glass-bg, rgba(20, 26, 32, 0.75)) !important;
  backdrop-filter: blur(12px);
  border: 1px solid var(--admin-glass-border, rgba(0, 255, 198, 0.18)) !important;
  border-left: 3px solid var(--admin-neon-cyan, #00FFC6) !important;
  border-radius: 12px;
  padding: 20px;
  color: var(--admin-text-primary, #e8f0f8);
  box-shadow: 
    inset 1px 1px 0 rgba(255, 255, 255, 0.02),
    0 4px 16px rgba(0, 0, 0, 0.35) !important;
}

/* Card Titles */
#dashboard-view .card h2,
#dashboard-view .card h3,
#pools-view .card h2,
#pools-view .card h3,
#seasons-view .card h2,
#seasons-view .card h3,
#registrations-view .card h2,
#registrations-view .card h3,
#users-view .card h2,
#users-view .card h3,
#settings-view .card h2,
#settings-view .card h3,
#escalations-view .card h2,
#escalations-view .card h3,
.admin-content .card h2,
.admin-content .card h3 {
  color: var(--admin-text-primary, #e8f0f8);
  font-family: var(--font-display, 'Orbitron', sans-serif);
  text-shadow: 0 0 6px rgba(0, 255, 198, 0.25);
}

/* === FORMS: DARK INPUTS === */
#dashboard-view input,
#dashboard-view select,
#dashboard-view textarea,
#pools-view input,
#pools-view select,
#pools-view textarea,
#seasons-view input,
#seasons-view select,
#seasons-view textarea,
#registrations-view input,
#registrations-view select,
#registrations-view textarea,
#users-view input,
#users-view select,
#users-view textarea,
#settings-view input,
#settings-view select,
#settings-view textarea,
#escalations-view input,
#escalations-view select,
#escalations-view textarea,
.admin-content input,
.admin-content select,
.admin-content textarea {
  background: rgba(14, 18, 24, 0.5) !important;
  border: 1px solid var(--admin-border-dark, rgba(0, 255, 198, 0.12)) !important;
  color: var(--admin-text-primary, #e8f0f8) !important;
  border-radius: 6px;
  padding: 10px 12px;
  transition: all 0.2s ease;
}

#dashboard-view input:focus,
#dashboard-view select:focus,
#dashboard-view textarea:focus,
#pools-view input:focus,
#pools-view select:focus,
#pools-view textarea:focus,
#seasons-view input:focus,
#seasons-view select:focus,
#seasons-view textarea:focus,
#registrations-view input:focus,
#registrations-view select:focus,
#registrations-view textarea:focus,
#users-view input:focus,
#users-view select:focus,
#users-view textarea:focus,
#settings-view input:focus,
#settings-view select:focus,
#settings-view textarea:focus,
#escalations-view input:focus,
#escalations-view select:focus,
#escalations-view textarea:focus {
  background: rgba(14, 18, 24, 0.7) !important;
  border-color: var(--admin-neon-cyan, #00FFC6) !important;
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 255, 198, 0.25);
}

/* === BUTTONS: NEON PRIMARY/SECONDARY === */
#dashboard-view .btn,
#pools-view .btn,
#seasons-view .btn,
#registrations-view .btn,
#users-view .btn,
#settings-view .btn,
#escalations-view .btn,
.admin-content .btn {
  border-radius: 8px;
  padding: 10px 18px;
  font-weight: 600;
  font-family: var(--font-display, 'Orbitron', sans-serif);
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.05em;
  transition: all 0.2s ease;
}

#dashboard-view .btn-primary,
#pools-view .btn-primary,
#seasons-view .btn-primary,
#registrations-view .btn-primary,
#users-view .btn-primary,
#settings-view .btn-primary,
#escalations-view .btn-primary,
.admin-content .btn-primary {
  background: linear-gradient(135deg, var(--admin-neon-cyan, #00FFC6) 0%, var(--admin-electric-blue, #00C2FF) 100%) !important;
  color: #0a0e12 !important;
  border: none !important;
  box-shadow: 0 0 12px rgba(0, 255, 198, 0.3);
}

#dashboard-view .btn-primary:hover,
#pools-view .btn-primary:hover,
#seasons-view .btn-primary:hover,
#registrations-view .btn-primary:hover,
#users-view .btn-primary:hover,
#settings-view .btn-primary:hover,
#escalations-view .btn-primary:hover,
.admin-content .btn-primary:hover {
  background: linear-gradient(135deg, #00FFD9 0%, #00D4FF 100%) !important;
  box-shadow: 0 0 20px rgba(0, 255, 198, 0.5);
  transform: translateY(-2px);
}

#dashboard-view .btn-secondary,
#dashboard-view .btn-danger,
#pools-view .btn-secondary,
#pools-view .btn-danger,
#seasons-view .btn-secondary,
#seasons-view .btn-danger,
#registrations-view .btn-secondary,
#registrations-view .btn-danger,
#users-view .btn-secondary,
#users-view .btn-danger,
#settings-view .btn-secondary,
#settings-view .btn-danger,
#escalations-view .btn-secondary,
#escalations-view .btn-danger,
.admin-content .btn-secondary,
.admin-content .btn-danger {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  color: var(--admin-text-secondary, #b8c4d0) !important;
}

#dashboard-view .btn-secondary:hover,
#pools-view .btn-secondary:hover,
#seasons-view .btn-secondary:hover,
#registrations-view .btn-secondary:hover,
#users-view .btn-secondary:hover,
#settings-view .btn-secondary:hover,
#escalations-view .btn-secondary:hover,
.admin-content .btn-secondary:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.06) 100%) !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
  color: var(--admin-text-primary, #e8f0f8) !important;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.1);
}

/* Danger Button (Rot-Neon Akzent) */
#dashboard-view .btn-danger:hover,
#pools-view .btn-danger:hover,
#seasons-view .btn-danger:hover,
#registrations-view .btn-danger:hover,
#users-view .btn-danger:hover,
#settings-view .btn-danger:hover,
#escalations-view .btn-danger:hover,
.admin-content .btn-danger:hover {
  background: linear-gradient(135deg, #FF6B6B 0%, #FF4444 100%) !important;
  border-color: #FF4444 !important;
  color: white !important;
  box-shadow: 0 0 16px rgba(255, 68, 68, 0.4);
}

/* === CHALLENGE VIEW MOBILE OPTIMIERUNG === */
@media (max-width: 768px) {
  /* Challenge Cards: Volle Breite auf Mobile */
  #dashboard-view .challenge-item,
  #dashboard-view .challenge-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: var(--admin-glass-bg, rgba(20, 26, 32, 0.75));
    border: 1px solid var(--admin-glass-border, rgba(0, 255, 198, 0.18));
    border-left: 3px solid var(--admin-neon-cyan, #00FFC6);
    border-radius: 10px;
    margin-bottom: 12px;
  }
  
  /* Challenge Buttons: Stack auf Mobile */
  #dashboard-view .challenge-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }
  
  #dashboard-view .challenge-actions .btn {
    width: 100%;
    padding: 12px;
    font-size: 14px;
  }
  
  /* Challenge Info: Besser lesbar */
  #dashboard-view .challenge-info,
  #dashboard-view .challenge-meta {
    font-size: 14px;
    color: var(--admin-text-secondary, #b8c4d0);
    line-height: 1.6;
  }
  
  #dashboard-view .challenge-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--admin-text-primary, #e8f0f8);
    margin-bottom: 8px;
  }
  
  /* Tables auf Mobile: Responsive Cards */
  #dashboard-view table,
  #pools-view table,
  #seasons-view table,
  #registrations-view table,
  #users-view table,
  #settings-view table,
  #escalations-view table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Admin Cards: Mehr Padding auf Mobile */
  #dashboard-view .card,
  #pools-view .card,
  #seasons-view .card,
  #registrations-view .card,
  #users-view .card,
  #settings-view .card,
  #escalations-view .card {
    padding: 16px;
    margin: 0 8px 16px 8px;
  }
  
  /* View Container: Padding */
  #dashboard-view,
  #pools-view,
  #seasons-view,
  #registrations-view,
  #users-view,
  #settings-view,
  #escalations-view {
    padding: 12px;
  }
}

/* === BADGES/LABELS: NEON AKZENTE === */
.admin-content .badge,
.admin-content .label,
.admin-content .tag {
  background: linear-gradient(135deg, rgba(0, 255, 198, 0.2) 0%, rgba(0, 194, 255, 0.15) 100%);
  color: var(--admin-text-primary, #e8f0f8);
  border: 1px solid var(--admin-border-dark, rgba(0, 255, 198, 0.12));
  border-radius: 12px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* === SCROLLBARS: DARK === */
#dashboard-view::-webkit-scrollbar,
#pools-view::-webkit-scrollbar,
#seasons-view::-webkit-scrollbar,
#registrations-view::-webkit-scrollbar,
#users-view::-webkit-scrollbar,
#settings-view::-webkit-scrollbar,
#escalations-view::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

#dashboard-view::-webkit-scrollbar-track,
#pools-view::-webkit-scrollbar-track,
#seasons-view::-webkit-scrollbar-track,
#registrations-view::-webkit-scrollbar-track,
#users-view::-webkit-scrollbar-track,
#settings-view::-webkit-scrollbar-track,
#escalations-view::-webkit-scrollbar-track {
  background: rgba(20, 26, 32, 0.3);
}

#dashboard-view::-webkit-scrollbar-thumb,
#pools-view::-webkit-scrollbar-thumb,
#seasons-view::-webkit-scrollbar-thumb,
#registrations-view::-webkit-scrollbar-thumb,
#users-view::-webkit-scrollbar-thumb,
#settings-view::-webkit-scrollbar-thumb,
#escalations-view::-webkit-scrollbar-thumb {
  background: rgba(0, 255, 198, 0.15);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: content-box;
}

#dashboard-view::-webkit-scrollbar-thumb:hover,
#pools-view::-webkit-scrollbar-thumb:hover,
#seasons-view::-webkit-scrollbar-thumb:hover,
#registrations-view::-webkit-scrollbar-thumb:hover,
#users-view::-webkit-scrollbar-thumb:hover,
#settings-view::-webkit-scrollbar-thumb:hover,
#escalations-view::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 255, 198, 0.25);
  border: 2px solid transparent;
}

/* ============================================================================
   ADMIN NAVIGATION: NEON DARK THEME
   ============================================================================ */

.admin-nav {
  background: linear-gradient(180deg,
    rgba(12, 18, 24, 0.95) 0%,
    rgba(14, 18, 24, 0.92) 100%);
  backdrop-filter: blur(12px) saturate(130%);
  -webkit-backdrop-filter: blur(12px) saturate(130%);
  border-bottom: 1px solid rgba(0, 255, 198, 0.25);
  box-shadow: 
    0 4px 20px -6px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(0, 255, 198, 0.15);
  position: sticky;
  top: 0;
  z-index: 980;
}

.admin-nav-container {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
}

/* Mobile Menu Toggle: Only show on mobile devices */
.admin-menu-toggle {
  display: none; /* Hidden by default on desktop */
  background: rgba(0, 255, 198, 0.08);
  border: 1px solid rgba(0, 255, 198, 0.22);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--admin-neon-cyan, #00FFC6);
  font-family: var(--font-body, 'Exo 2', sans-serif);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.admin-menu-toggle:hover {
  background: rgba(0, 255, 198, 0.15);
  border-color: rgba(0, 255, 198, 0.35);
  box-shadow: 0 0 12px rgba(0, 255, 198, 0.25);
}

.admin-menu-toggle i {
  margin-right: 6px;
}

#admin-nav-menu {
  display: flex;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

/* Admin Nav Items: Neon Cyan Theme */
.admin-nav-item,
.admin-nav-neon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-family: var(--font-body, 'Exo 2', sans-serif);
  font-size: 14px;
  font-weight: 500;
  color: var(--admin-text-secondary, #b0b8c0);
  text-decoration: none;
  background: rgba(20, 26, 32, 0.5);
  border: 1px solid rgba(0, 255, 198, 0.12);
  border-radius: 10px;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

/* Icon Styling */
.admin-nav-item i,
.admin-nav-neon i {
  font-size: 16px;
  color: var(--admin-neon-cyan, #00FFC6);
  transition: transform 0.22s ease;
}

/* Hover State */
.admin-nav-item:hover,
.admin-nav-neon:hover {
  color: var(--admin-text-primary, #e8f0f8);
  background: linear-gradient(135deg,
    rgba(0, 255, 198, 0.15) 0%,
    rgba(0, 194, 255, 0.12) 100%);
  border-color: rgba(0, 255, 198, 0.35);
  box-shadow: 
    0 0 12px rgba(0, 255, 198, 0.25),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  transform: translateY(-1px);
}

.admin-nav-item:hover i,
.admin-nav-neon:hover i {
  transform: scale(1.1);
  color: var(--admin-neon-cyan, #00FFC6);
  text-shadow: 0 0 8px rgba(0, 255, 198, 0.6);
}

/* Active State (Current Page) */
.admin-nav-item.active,
.admin-nav-neon.active {
  color: #ffffff;
  background: linear-gradient(135deg,
    rgba(0, 255, 198, 0.25) 0%,
    rgba(0, 194, 255, 0.18) 100%);
  border: 2px solid rgba(0, 255, 198, 0.5);
  box-shadow: 
    0 0 16px rgba(0, 255, 198, 0.35),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  font-weight: 600;
}

.admin-nav-item.active i,
.admin-nav-neon.active i {
  color: var(--admin-neon-cyan, #00FFC6);
  text-shadow: 0 0 12px rgba(0, 255, 198, 0.8);
}

/* Focus Visible (Accessibility) */
.admin-nav-item:focus-visible,
.admin-nav-neon:focus-visible {
  outline: 2px solid rgba(0, 255, 198, 0.6);
  outline-offset: 2px;
}

/* Mobile: Show hamburger menu toggle, collapse navigation */
@media (max-width: 768px) {
  /* Show hamburger menu button */
  .admin-menu-toggle {
    display: inline-flex;
    align-items: center;
  }
  
  /* Hide navigation by default, show when expanded */
  #admin-nav-menu {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--admin-bg-darker, #0e1218);
    border-top: 1px solid rgba(0, 255, 198, 0.25);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    padding: 12px 16px;
    z-index: 999;
  }
  
  #admin-nav-menu.expanded {
    display: flex;
  }
  
  #admin-nav-menu li {
    width: 100%;
  }
  
  .admin-nav-item,
  .admin-nav-neon {
    width: 100%;
    justify-content: flex-start;
    padding: 12px 16px;
    font-size: 14px;
  }
  
  .admin-nav-item i,
  .admin-nav-neon i {
    font-size: 16px;
  }
}

/* Very small screens: Keep text visible in mobile menu */
@media (max-width: 640px) {
  .admin-nav-text {
    display: inline; /* Keep text visible in expanded mobile menu */
  }
  
  .admin-nav-item,
  .admin-nav-neon {
    padding: 12px 16px;
    justify-content: flex-start;
  }
}

/* Desktop: Kompaktere Buttons */
@media (min-width: 769px) and (max-width: 1024px) {
  .admin-nav-item,
  .admin-nav-neon {
    padding: 8px 12px;
    font-size: 13px;
  }
  
  .admin-nav-item i,
  .admin-nav-neon i {
    font-size: 14px;
  }
}

