/* ==========================================================
   Plants vs. Zombies — Admin Panel & Game Configurator CSS
   Cyberpunk Dark Botanical Theme
   ========================================================== */

:root {
  --bg-main: #0c1017;
  --bg-card: rgba(18, 25, 38, 0.85);
  --bg-card-hover: rgba(26, 36, 54, 0.95);
  --bg-input: #151d2a;
  --bg-modal: #111722;
  
  --border-color: rgba(76, 175, 80, 0.25);
  --border-focus: #4caf50;
  --border-cyber: rgba(0, 229, 255, 0.4);

  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --accent-green: #4caf50;
  --accent-green-glow: rgba(76, 175, 80, 0.4);
  --accent-cyan: #00e5ff;
  --accent-cyan-glow: rgba(0, 229, 255, 0.35);
  --accent-gold: #ffc107;
  --accent-gold-glow: rgba(255, 193, 7, 0.35);
  --accent-red: #ff5252;
  --accent-purple: #b388ff;
  --accent-orange: #ff9800;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 20px var(--accent-green-glow);
  --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(76, 175, 80, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(0, 229, 255, 0.06) 0%, transparent 40%),
    linear-gradient(180deg, #090d13 0%, #0d121c 100%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* App Container */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
  padding: 0 16px;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
}

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

.brand-icon {
  font-size: 32px;
  filter: drop-shadow(0 0 10px rgba(76, 175, 80, 0.6));
  animation: pulse-icon 3s ease-in-out infinite alternate;
}

@keyframes pulse-icon {
  0% { transform: scale(1); }
  100% { transform: scale(1.08); filter: drop-shadow(0 0 14px rgba(0, 229, 255, 0.8)); }
}

.brand-title {
  font-size: 20px;
  font-weight: 800;
  background: linear-gradient(135deg, #a5d6a7, #00e5ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.5px;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(76, 175, 80, 0.12);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  color: #81c784;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4caf50;
  box-shadow: 0 0 8px #4caf50;
}

.status-dot.offline {
  background: #ff5252;
  box-shadow: 0 0 8px #ff5252;
}

/* Nav Tabs */
.tabs-navigation {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  scrollbar-width: thin;
}

.tabs-navigation::-webkit-scrollbar {
  height: 4px;
}
.tabs-navigation::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.nav-tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.nav-tab-btn:hover {
  background: rgba(76, 175, 80, 0.1);
  color: var(--text-main);
  border-color: var(--border-color);
}

.nav-tab-btn.active {
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.25), rgba(0, 229, 255, 0.15));
  color: #a5d6a7;
  border-color: var(--accent-green);
  box-shadow: 0 0 16px rgba(76, 175, 80, 0.25);
}

.badge-count {
  background: var(--accent-red);
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: bold;
}

/* Content Area */
.tab-pane {
  display: none;
  animation: fadeIn 0.25s ease-out;
}

.tab-pane.active {
  display: block;
}

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

/* Cards & Grids */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
}

.stat-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-green);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card), 0 0 15px rgba(76, 175, 80, 0.15);
}

.stat-icon {
  font-size: 36px;
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-info .stat-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.stat-info .stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

/* Panel Sections */
.section-panel {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #a5d6a7;
}

.section-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Event Switch Cards */
.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.event-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: var(--transition);
}

.event-card:hover {
  border-color: var(--border-color);
  background: rgba(76, 175, 80, 0.05);
}

.event-info h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}

.event-info p {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Sliders & Form Controls */
.controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.control-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: var(--transition);
}

.control-item:hover {
  border-color: var(--border-color);
  background: rgba(255, 255, 255, 0.04);
}

.control-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.control-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.control-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: rgba(0, 229, 255, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 229, 255, 0.3);
}

.range-slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #1e293b;
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
  margin: 10px 0;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #4caf50;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(76, 175, 80, 0.8);
  border: 2px solid #ffffff;
  transition: var(--transition);
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  background: #00e5ff;
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.9);
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

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

.admin-table th {
  background: rgba(255, 255, 255, 0.04);
  padding: 12px 16px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.admin-table tbody tr {
  transition: var(--transition);
}

.admin-table tbody tr:hover {
  background: rgba(76, 175, 80, 0.06);
}

/* Badges */
.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
}

.pill-active {
  background: rgba(76, 175, 80, 0.15);
  color: #81c784;
  border: 1px solid rgba(76, 175, 80, 0.3);
}

.pill-banned {
  background: rgba(255, 82, 82, 0.15);
  color: #ff8a80;
  border: 1px solid rgba(255, 82, 82, 0.3);
}

.pill-admin {
  background: rgba(255, 193, 7, 0.15);
  color: #ffd54f;
  border: 1px solid rgba(255, 193, 7, 0.3);
}

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

.btn-primary {
  background: linear-gradient(135deg, #4caf50, #2e7d32);
  color: white;
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #66bb6a, #388e3c);
  box-shadow: 0 6px 16px rgba(76, 175, 80, 0.5);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
}

.btn-danger {
  background: linear-gradient(135deg, #e53935, #c62828);
  color: white;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #ef5350, #d32f2f);
}

.btn-cyber {
  background: linear-gradient(135deg, #00b4d8, #0077b6);
  color: white;
  box-shadow: 0 4px 12px rgba(0, 180, 216, 0.3);
}

.btn-cyber:hover {
  background: linear-gradient(135deg, #0096c7, #023e8a);
}

.btn-sm {
  padding: 4px 10px;
  font-size: 11px;
  border-radius: var(--radius-sm);
}

.btn-icon-only {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: var(--radius-sm);
}

/* Inputs & Form Groups */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 13px;
  outline: none;
  transition: var(--transition);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
}

/* Preset Cards */
.presets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.preset-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.preset-card.active {
  border-color: var(--accent-green);
  background: rgba(76, 175, 80, 0.08);
  box-shadow: 0 0 20px rgba(76, 175, 80, 0.2);
}

.preset-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-cyan);
}

.preset-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.preset-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

.preset-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  padding: 16px;
}

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

.modal-box {
  background: var(--bg-modal);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(76, 175, 80, 0.2);
  animation: modalPop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-box.modal-large {
  max-width: 850px;
}

@keyframes modalPop {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: #a5d6a7;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.modal-close-btn:hover {
  color: var(--accent-red);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

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

.toast {
  background: #1e293b;
  color: white;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  border-left: 4px solid var(--accent-green);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInRight 0.3s ease;
  min-width: 280px;
}

.toast.error {
  border-left-color: var(--accent-red);
}

.toast.warn {
  border-left-color: var(--accent-gold);
}

.toast.info {
  border-left-color: var(--accent-cyan);
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

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

.slider-round {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #334155;
  transition: var(--transition);
  border-radius: 24px;
}

.slider-round:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: var(--transition);
  border-radius: 50%;
}

input:checked + .slider-round {
  background-color: var(--accent-green);
  box-shadow: 0 0 10px var(--accent-green-glow);
}

input:checked + .slider-round:before {
  transform: translateX(20px);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .app-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .header-actions {
    width: 100%;
    justify-content: space-between;
  }
  .controls-grid {
    grid-template-columns: 1fr;
  }
}
