/* Admin Dashboard Styling - Premium Space Theme */

/* 1. LOGIN CONTAINER */
@keyframes meshGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.admin-login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(-45deg, #060813, #150a25, #061825, #030408);
  background-size: 400% 400%;
  animation: meshGradient 15s ease infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 16px;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 28px;
  width: 100%;
  max-width: 400px;
  padding: 40px 32px;
  box-shadow: 
    0 12px 40px rgba(0, 0, 0, 0.6),
    0 0 24px rgba(112, 21, 220, 0.2);
  backdrop-filter: blur(var(--blur-amount));
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo span {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  background: var(--grad-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 10px rgba(0, 242, 254, 0.3));
}

/* 2. ADMIN MAIN LAYOUT */
.admin-container {
  display: flex;
  min-height: 100vh;
  background: var(--bg-main);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(112, 21, 220, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 90% 80%, rgba(0, 242, 254, 0.04) 0%, transparent 40%);
  background-attachment: fixed;
}

.admin-sidebar {
  width: 280px;
  background: rgba(5, 6, 11, 0.6);
  backdrop-filter: blur(12px);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  padding: 32px 24px;
}

.admin-sidebar-header {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 40px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-menu-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition-smooth);
}

.admin-menu-item:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.03);
}

.admin-menu-item.active {
  background: var(--grad-accent);
  color: #fff;
  box-shadow: var(--shadow-accent-glow);
  border: none;
}

.admin-content {
  flex: 1;
  padding: 40px;
  overflow-y: auto;
}

.admin-panel {
  display: none;
}

.admin-panel.active {
  display: block;
  animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.admin-panel h2 {
  font-size: 1.8rem;
  margin-bottom: 8px;
  color: var(--text-primary);
}

/* 3. FORMS & INPUTS */
.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
  letter-spacing: 0.02em;
}

.form-control {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 12px 18px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition-smooth);
}

.form-control:focus {
  border-color: var(--accent-cyan);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.2);
}

select.form-control {
  cursor: pointer;
}

textarea.form-control {
  resize: vertical;
  min-height: 140px;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 12px;
  padding: 12px 24px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition-smooth);
  text-decoration: none;
}

.btn-primary {
  background: var(--grad-accent);
  color: #fff;
  box-shadow: var(--shadow-accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 242, 254, 0.45);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
}

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

.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #f87171;
}

.btn-danger:hover {
  background: #ef4444;
  border-color: #ef4444;
  color: #fff;
  transform: translateY(-1px);
}

/* 4. CRUD TABLES (Card-Row Style) */
.admin-table-container {
  background: transparent;
  border-radius: 18px;
  overflow-x: auto;
  margin-top: 24px;
}

.admin-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 10px;
  text-align: left;
}

.admin-table th {
  padding: 8px 24px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  border: none;
}

.admin-table td {
  padding: 18px 24px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  font-size: 0.9rem;
  color: var(--text-primary);
  transition: var(--transition-smooth);
}

.admin-table td:first-child {
  border-radius: 16px 0 0 16px;
  border-left: 1px solid var(--border-light);
}

.admin-table td:last-child {
  border-radius: 0 16px 16px 0;
  border-right: 1px solid var(--border-light);
}

.admin-table tbody tr:hover td {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.12);
}

.admin-table td.actions {
  display: flex;
  gap: 10px;
}

.admin-table img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 2px;
}

/* Server select list in Events/Channels CRUD */
.server-input-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.server-input-row input {
  border-radius: 8px;
}

/* Alert Boxes */
.alert {
  padding: 14px 20px;
  border-radius: 12px;
  margin-bottom: 24px;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

/* Switch sliders styling */
.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-light);
  border-radius: 34px;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: #fff;
  border-radius: 50%;
  transition: .4s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.switch input:checked + .slider {
  background-color: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

.switch input:checked + .slider:before {
  transform: translateX(22px);
}

/* Select Option dropdown list style fix */
select.form-control option {
  background-color: #0f111a;
  color: var(--text-primary);
}

/* Dashboard Statistics Grid */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 18px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition-smooth);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-accent-glow);
}

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

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

.stat-val {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}

.stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* 5. MOBILE HEADER & HAMBURGER STYLES */
.btn-hamburger {
  display: none;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-light);
  color: #fff;
  cursor: pointer;
  padding: 10px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  transition: var(--transition-smooth);
}

.btn-hamburger:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
}

.admin-mobile-header {
  display: none;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  background: rgba(5, 6, 11, 0.6);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-light);
  border-radius: 18px;
  width: 100%;
  margin-bottom: 24px;
}

.admin-mobile-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  background: var(--grad-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.01em;
}

.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(3, 4, 8, 0.85);
  backdrop-filter: blur(8px);
  z-index: 990;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-smooth);
}

.sidebar-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* 6. RESPONSIVE MEDIA QUERIES */
@media (max-width: 1023px) {
  .btn-hamburger {
    display: inline-flex;
  }

  .admin-mobile-header {
    display: flex;
  }

  .admin-container {
    flex-direction: column;
  }

  .admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    z-index: 1000;
    transform: translateX(-100%);
    background: #080a14;
    border-right: 1px solid var(--border-light);
    box-shadow: 12px 0 32px rgba(0, 0, 0, 0.7);
    transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);
  }

  .admin-sidebar.open {
    transform: translateX(0);
  }

  .admin-content {
    padding: 20px 16px;
  }

  .admin-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
  }

  .stat-card {
    padding: 16px;
    gap: 12px;
    border-radius: 14px;
  }

  .stat-val {
    font-size: 1.2rem;
  }

  .stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
  }

  .stat-icon svg {
    width: 18px;
    height: 18px;
  }

  .admin-panel h2 {
    font-size: 1.45rem;
  }

  /* Table styles adjustments */
  .admin-table th, .admin-table td {
    padding: 12px 14px;
    font-size: 0.82rem;
  }

  .admin-table img {
    width: 32px;
    height: 32px;
  }

  .btn {
    padding: 10px 18px;
    font-size: 0.85rem;
    border-radius: 10px;
  }
}

@media (max-width: 600px) {
  .admin-stats-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .server-input-row {
    flex-direction: column;
    gap: 8px;
    background: rgba(255, 255, 255, 0.02);
    padding: 12px;
    border-radius: 10px;
    border: 1px solid var(--border-light);
  }
}
