/* 🔧 DEBUG TOGGLE & PANEL STYLES */

/* Debug Toggle Button */
#debug-toggle {
  position: fixed;
  top: 15px;
  right: 15px;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10001; /* Über allem anderen */
  transition: all 0.3s ease;
  user-select: none;
}

#debug-toggle:hover {
  background: var(--bg-hover);
  border-color: var(--accent-red);
  transform: scale(1.1);
}

/* Offen heisst: Akzent, nicht Status. Gruen bleibt "laeuft" vorbehalten. */
#debug-toggle.aktiv {
  background: var(--accent-red);
  color: var(--bg-primary);
}

#debug-toggle span {
  font-size: 20px;
  line-height: 1;
}

/* Debug Panel Overlay */
.debug-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-overlay);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.debug-panel-content {
  background: var(--bg-elevated);
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  max-width: 1200px;
  max-height: 90vh;
  width: 100%;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

.debug-panel-header {
  background: var(--accent-red);
  color: white;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 12px 12px 0 0;
}

.debug-panel-header h3 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
}

.debug-close-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.debug-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.debug-panel-scrollable {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.debug-panel-content > div {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

/* Admin Sections in Debug Panel */
.admin-section {
  margin-bottom: 30px;
  padding: 20px;
  background: var(--bg-elevated);
  border-radius: 8px;
  border-left: 4px solid var(--accent-red);
}

.admin-section h3 {
  margin: 0 0 15px 0;
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 600;
}

.admin-section h4 {
  margin: 15px 0 10px 0;
  color: var(--text-secondary);
  font-size: 16px;
  font-weight: 500;
}

/* Button Groups */
.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 15px;
}

.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-success {
  background: var(--accent-green);
  color: white;
}

.btn-success:hover {
  background: var(--accent-green);
  transform: translateY(-1px);
}

.btn-info {
  background: var(--info-color);
  color: white;
}

.btn-info:hover {
  background: var(--info-color);
  transform: translateY(-1px);
}

.btn-warning {
  background: var(--accent-yellow);
  color: var(--bg-primary);
}

.btn-warning:hover {
  background: var(--accent-yellow);
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--error-color);
  color: white;
}

.btn-danger:hover {
  background: var(--error-color);
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent-red);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-red);
  transform: translateY(-1px);
}

.btn-outline-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--text-secondary);
}

.btn-outline-secondary:hover {
  background: var(--text-secondary);
  color: white;
}

.btn-outline-info {
  background: transparent;
  color: var(--info-color);
  border: 1px solid var(--info-color);
}

.btn-outline-info:hover {
  background: var(--info-color);
  color: white;
}

/* Debug Console */
.debug-console {
  background: var(--bg-primary);
  border-radius: 6px;
  overflow: hidden;
}

.debug-output {
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 15px;
  min-height: 200px;
  max-height: 300px;
  overflow-y: auto;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.4;
  white-space: pre-wrap;
}

.debug-input-group {
  display: flex;
  padding: 10px;
  background: var(--bg-primary);
}

.debug-input {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 4px 0 0 4px;
  background: var(--text-primary);
  color: var(--bg-primary);
  font-family: 'Courier New', monospace;
  font-size: 13px;
}

.debug-input:focus {
  outline: none;
  background: var(--text-primary);
}

.debug-input-group .btn {
  border-radius: 0 4px 4px 0;
  margin: 0;
}

/* Network Diagnostic */
.diagnostic-output {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 15px;
  margin-top: 10px;
  min-height: 100px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  white-space: pre-wrap;
  color: var(--text-secondary);
}

/* System Info */
#systemInfo p {
  margin: 8px 0;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border-radius: 4px;
  border-left: 3px solid var(--accent-red);
}

#systemInfo strong {
  color: var(--text-secondary);
  min-width: 120px;
  display: inline-block;
}

/* Responsive Design */
@media (max-width: 768px) {
  .debug-panel {
    padding: 10px;
  }

  .debug-panel-content {
    max-height: 95vh;
  }

  .debug-panel-header {
    padding: 15px;
  }

  .debug-panel-header h3 {
    font-size: 20px;
  }

  .admin-section {
    padding: 15px;
    margin-bottom: 20px;
  }

  .btn-group {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  #debug-toggle {
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
  }

  #debug-toggle span {
    font-size: 18px;
  }
}

/* Support */
.debug-panel-content {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.admin-section {
  background: var(--bg-secondary);
  border-left-color: var(--accent-red);
}

.admin-section h3,
.admin-section h4 {
  color: var(--text-primary);
}

.debug-input {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.debug-input:focus {
  background: var(--bg-primary);
}

.diagnostic-output {
  background: var(--bg-secondary);
  border-color: var(--border-color);
  color: var(--text-primary);
}

#systemInfo p {
  background: var(--bg-secondary);
  border-left-color: var(--accent-red);
  color: var(--text-primary);
}
