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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: #1a1a2e;
  color: #eee;
  min-height: 100vh;
  padding: 2rem;
}

.admin-container {
  max-width: 1400px;
  margin: 0 auto;
}

.admin-header {
  background: #0f3460;
  padding: 2rem;
  border-radius: 12px;
  margin-bottom: 2rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.admin-header h1 {
  color: #e94560;
  margin-bottom: 1rem;
}

.admin-nav {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.tab-btn {
  padding: 0.8rem 1.5rem;
  background: #16213e;
  color: #eee;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.3s;
}

.tab-btn:hover {
  background: #1a3a5c;
}

.tab-btn.active {
  background: #e94560;
  color: white;
}

.back-link {
  margin-left: auto;
  padding: 0.8rem 1.5rem;
  background: #28a745;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.3s;
}

.back-link:hover {
  background: #218838;
}

.tab-content {
  display: none;
  background: #0f3460;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

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

.tab-content h2 {
  color: #e94560;
  margin-bottom: 1.5rem;
}

.tab-content h3 {
  color: #eee;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #16213e;
  border-radius: 8px;
  overflow: hidden;
}

.data-table thead {
  background: #1a3a5c;
}

.data-table th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: #e94560;
  text-transform: uppercase;
  font-size: 0.85rem;
}

.data-table td {
  padding: 1rem;
  border-top: 1px solid #0f3460;
}

.data-table tbody tr:hover {
  background: #1a3a5c;
}

.status-badge {
  padding: 0.3rem 0.8rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
}

.status-badge.admin {
  background: #6c5ce7;
  color: white;
}

.status-badge.banned {
  background: #dc3545;
  color: white;
}

.status-badge.muted {
  background: #ffc107;
  color: #000;
}

.status-badge.active {
  background: #28a745;
  color: white;
}

.action-buttons {
  display: flex;
  gap: 0.5rem;
}

.btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: opacity 0.2s;
}

.btn:hover {
  opacity: 0.8;
}

.btn-primary {
  background: #007bff;
  color: white;
}

.btn-danger {
  background: #dc3545;
  color: white;
}

.btn-warning {
  background: #ffc107;
  color: #000;
}

.btn-success {
  background: #28a745;
  color: white;
}

.add-ban-form, .add-channel-form {
  background: #16213e;
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 2rem;
}

.add-ban-form h3, .add-channel-form h3 {
  margin-top: 0;
  margin-bottom: 1rem;
}

.add-ban-form input, .add-channel-form input {
  display: block;
  width: 100%;
  padding: 0.8rem;
  margin-bottom: 1rem;
  border: 1px solid #0f3460;
  border-radius: 6px;
  background: #0f3460;
  color: #eee;
  font-size: 1rem;
}

.add-ban-form input:focus, .add-channel-form input:focus {
  outline: none;
  border-color: #e94560;
}

.add-ban-form button, .add-channel-form button {
  padding: 0.8rem 2rem;
  background: #e94560;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
}

.add-ban-form button:hover, .add-channel-form button:hover {
  background: #d63650;
}

.success-message {
  color: #28a745;
  background: rgba(40, 167, 69, 0.2);
  padding: 0.8rem;
  border-radius: 6px;
  margin-top: 0.5rem;
}

.error-message {
  color: #dc3545;
  background: rgba(220, 53, 69, 0.2);
  padding: 0.8rem;
  border-radius: 6px;
  margin-top: 0.5rem;
}

/* Message Viewer */
.messages-viewer {
  max-height: 400px;
  overflow-y: auto;
  background: #16213e;
  padding: 1rem;
  border-radius: 6px;
}

.message-item {
  background: #0f3460;
  padding: 0.8rem;
  margin-bottom: 0.8rem;
  border-radius: 6px;
  border-left: 3px solid #e94560;
}

.message-header-admin {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  gap: 1rem;
}

.message-content-admin {
  color: #eee;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.btn-small {
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
}

.modal-large {
  max-width: 900px;
  width: 95%;
}

/* Modal */
.modal {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: #0f3460;
  padding: 2rem;
  border-radius: 12px;
  max-width: 800px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-content h2 {
  color: #e94560;
  margin-bottom: 1rem;
}

.close {
  position: absolute;
  right: 1.5rem;
  top: 1.5rem;
  color: #aaa;
  font-size: 2rem;
  font-weight: bold;
  cursor: pointer;
}

.close:hover {
  color: #e94560;
}

#user-details {
  background: #16213e;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

#user-details p {
  margin-bottom: 0.5rem;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #0f3460;
}

::-webkit-scrollbar-thumb {
  background: #16213e;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #1a3a5c;
}

/* Form elements */
.modal-content form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-content label {
  color: #eee;
  font-weight: 600;
  margin-bottom: -0.5rem;
}

.modal-content input {
  padding: 0.8rem;
  border: 1px solid #16213e;
  border-radius: 6px;
  background: #16213e;
  color: #eee;
  font-size: 1rem;
}

.modal-content input:focus {
  outline: none;
  border-color: #e94560;
}

.channel-message {
  margin-top: 1rem;
  padding: 0.8rem;
  border-radius: 6px;
  text-align: center;
  display: none;
}

.channel-message.success {
  background: rgba(40, 167, 69, 0.2);
  color: #28a745;
  display: block;
}

.channel-message.error {
  background: rgba(220, 53, 69, 0.2);
  color: #dc3545;
  display: block;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
  body {
    padding: 1rem;
  }

  .admin-header {
    padding: 1.5rem;
  }

  .admin-header h1 {
    font-size: 1.5rem;
  }

  .admin-nav {
    flex-direction: column;
    gap: 0.5rem;
  }

  .tab-btn {
    width: 100%;
    text-align: center;
  }

  .back-link {
    width: 100%;
    text-align: center;
    margin-left: 0;
  }

  .tab-content {
    padding: 1.5rem;
  }

  .tab-content h2 {
    font-size: 1.3rem;
  }

  .tab-content h3 {
    font-size: 1.1rem;
  }

  /* Data tables - responsive */
  .data-table {
    font-size: 0.85rem;
  }

  .data-table th,
  .data-table td {
    padding: 0.6rem;
  }

  .data-table th {
    font-size: 0.75rem;
  }

  /* Hide some columns on mobile to save space */
  .data-table th:nth-child(1),
  .data-table td:nth-child(1) {
    display: none; /* Hide ID column */
  }

  /* Action buttons - stack vertically */
  .action-buttons {
    flex-direction: column;
    gap: 0.3rem;
  }

  .btn,
  .btn-small {
    width: 100%;
    font-size: 0.85rem;
    padding: 0.5rem;
  }

  /* Forms - full width inputs */
  .add-ban-form,
  .add-channel-form {
    padding: 1rem;
  }

  .add-ban-form input,
  .add-channel-form input {
    font-size: 16px; /* Prevent iOS zoom */
  }

  .add-ban-form button,
  .add-channel-form button {
    width: 100%;
  }

  /* Modals - full screen on mobile */
  .modal-content {
    width: 95%;
    max-width: 95%;
    padding: 1.5rem;
    margin: 1rem;
  }

  .modal-content h2 {
    font-size: 1.2rem;
    padding-right: 2rem;
  }

  .modal-content.modal-large {
    width: 98%;
    max-width: 98%;
  }

  .close {
    right: 1rem;
    top: 1rem;
    font-size: 1.8rem;
  }

  /* Modal forms */
  .modal-content input {
    font-size: 16px; /* Prevent iOS zoom */
  }

  .modal-content form {
    gap: 0.8rem;
  }

  /* Messages viewer */
  .messages-viewer {
    max-height: 300px;
    font-size: 0.9rem;
  }

  .message-item {
    padding: 0.6rem;
  }

  .message-header-admin {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .message-content-admin {
    font-size: 0.85rem;
  }

  /* Status badges */
  .status-badge {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
  }
}

/* Extra small screens */
@media (max-width: 480px) {
  body {
    padding: 0.5rem;
  }

  .admin-header {
    padding: 1rem;
  }

  .admin-header h1 {
    font-size: 1.3rem;
  }

  .tab-content {
    padding: 1rem;
  }

  .data-table {
    font-size: 0.8rem;
  }

  .data-table th,
  .data-table td {
    padding: 0.5rem;
  }

  /* Hide more columns on very small screens */
  .data-table th:nth-child(3),
  .data-table td:nth-child(3),
  .data-table th:nth-child(5),
  .data-table td:nth-child(5) {
    display: none;
  }

  .modal-content {
    padding: 1rem;
  }

  .messages-viewer {
    max-height: 250px;
  }
}
