@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700&display=swap');

:root {
  --bg-dark: #0f172a;
  --bg-panel: rgba(30, 41, 59, 0.7);
  --border-color: rgba(255, 255, 255, 0.1);
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --danger: #ef4444;
  --success: #10b981;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --font-body: 'Inter', sans-serif;
  --font-heading: 'Outfit', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: transparent; /* Rely on Vanta background */
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  overflow: hidden;
}

/* Glassmorphism utility */
.glass {
  background: var(--bg-panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
}

/* Login Overlay */
#login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.3s ease;
}

.login-box {
  padding: 3rem;
  border-radius: 24px;
  text-align: center;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.login-box h2 {
  font-family: var(--font-heading);
  margin-bottom: 2rem;
  font-size: 2rem;
  background: linear-gradient(to right, #818cf8, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.5);
  color: white;
  font-size: 1rem;
  margin-bottom: 1.5rem;
  outline: none;
  transition: border-color 0.3s;
}

input[type="text"]:focus,
input[type="password"]:focus {
  border-color: var(--primary);
}

button {
  width: 100%;
  padding: 1rem;
  border-radius: 12px;
  border: none;
  background: var(--primary);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: var(--font-body);
}

button:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
}

/* Main Layout */
.app-container {
  display: flex;
  width: 100%;
  height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 300px;
  height: 100%;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 2rem;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-header h1 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#moderation-sidebar-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.group-list {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Custom Scrollbar for a premium look */
.group-list::-webkit-scrollbar {
  width: 5px;
}

.group-list::-webkit-scrollbar-track {
  background: transparent;
}

.group-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.group-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

.group-item {
  padding: 1rem;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.group-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.group-item.active {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.5);
}

.group-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.group-id {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.group-badge {
  background: var(--danger);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  min-width: 20px;
  text-align: center;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
  animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.content-header {
  margin-bottom: 2rem;
}

.content-header h2 {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

/* Table Design */
.table-container {
  border-radius: 16px;
  overflow: visible;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th, td {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(0, 0, 0, 0.2);
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.unban-btn {
  background: transparent;
  border: 1px solid var(--success);
  color: var(--success);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  width: auto;
}

.unban-btn:hover {
  background: var(--success);
  color: white;
}

.tag-reason {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 500;
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(255,255,255,0.1);
  border-radius: 50%;
  border-top-color: var(--primary);
  animation: spin 1s ease-in-out infinite;
  margin: 2rem auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.hidden {
  display: none !important;
}

/* Toast */
#toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 1rem 2rem;
  border-radius: 12px;
  color: white;
  font-weight: 500;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

#toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }

/* Dropdown */
.action-dropdown {
  position: relative;
  display: inline-block;
}

.action-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-color);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.action-btn:hover {
  background: rgba(255,255,255,0.1);
}

.dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  top: 110%;
  background-color: var(--bg-dark);
  min-width: 220px;
  box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.5);
  z-index: 100;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.dropdown-content.show {
  display: block;
}

.dropdown-content button {
  color: white;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-radius: 0;
  font-size: 0.9rem;
}

.dropdown-content button:hover {
  background-color: rgba(255,255,255,0.05);
}

.dropdown-content .btn-danger:hover {
  background-color: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

/* Modal */
#custom-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  padding: 2rem;
  border-radius: 16px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
}

.modal-content h3 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

#modal-message {
    text-align: right;
    direction: rtl;
    line-height: 1.6;
}

/* Nav Tabs */
.tab-btn {
    flex: 1;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.tab-btn:hover:not(.active) {
    background: rgba(255,255,255,0.05);
}

#user-display {
    font-weight: 600;
    color: white;
}

/* --- MOBILE RESPONSIVENESS --- */

.mobile-header {
  display: none;
  padding: 1rem;
  align-items: center;
  gap: 1rem;
  z-index: 1001;
}

.mobile-header h1 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
}

#sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  z-index: 999;
}

@media (max-width: 768px) {
  .app-container {
    flex-direction: column;
  }

  .mobile-header {
    display: flex;
  }

  .sidebar {
    position: fixed;
    left: -300px; /* Hidden by default */
    top: 0;
    height: 100vh;
    z-index: 1000;
    width: 280px;
    background: var(--bg-dark);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .sidebar.open {
    left: 0;
  }

  .main-content {
    padding: 1rem;
    height: calc(100vh - 60px); 
  }

  .content-header h2 {
    font-size: 1.75rem;
  }

  .login-box {
    padding: 1.5rem;
    width: 90%;
  }

  .table-container {
    overflow-x: auto; /* Enable horizontal scroll for table */
    width: 100%;
    margin-top: 1rem;
  }

  table {
    min-width: 600px; /* Ensure table doesn't compress too much */
  }

  th, td {
    padding: 0.75rem;
    font-size: 0.85rem;
  }

  .group-list {
    padding: 0.5rem;
  }

  .sidebar-header {
    padding: 1rem;
  }
}


