/* ==================== CHAT CONTAINER ====================*/
.chat-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100vh;
  background: var(--bg-primary, #000);
  color: var(--text-primary, #fff);
  font-family: inherit;
  gap: 0.75rem;
}

/* ==================== HEADER ====================*/
.chat-header {
  background: rgba(11, 108, 255, 0.08);
  border-bottom: 1px solid rgba(11, 108, 255, 0.2);
  padding: 1rem;
  flex-shrink: 0;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.chat-title {
  font-size: 1.4rem;
  font-weight: bold;
  color: var(--accent, #0b6cff);
  margin: 0;
}

.header-buttons {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.btn-admin-login {
  background: rgba(255, 193, 7, 0.1);
  border: 1px solid rgba(255, 193, 7, 0.3);
  color: #ffc107;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-admin-login:hover {
  background: rgba(255, 193, 7, 0.2);
  border-color: #ffc107;
  transform: translateY(-1px);
}

.btn-close {
  background: none;
  border: none;
  color: var(--accent, #0b6cff);
  font-size: 1.8rem;
  cursor: pointer;
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s;
}

.btn-close:hover {
  background: rgba(11, 108, 255, 0.1);
}

.user-status {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.9rem;
  flex-wrap: wrap;
}

.user-badge {
  background: rgba(11, 108, 255, 0.15);
  color: var(--accent, #0b6cff);
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.85rem;
}

.admin-badge {
  background: rgba(255, 193, 7, 0.15);
  color: #ffc107;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-weight: bold;
  font-size: 0.85rem;
}

/* ==================== ADMIN CONTROLS ====================*/
.admin-controls {
  padding: 0 1rem;
  position: relative;
}

.admin-menu {
  position: relative;
  display: flex;
  gap: 0.5rem;
}

.admin-menu-btn {
  background: rgba(255, 193, 7, 0.1);
  border: 1px solid rgba(255, 193, 7, 0.3);
  color: #ffc107;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.admin-menu-btn:hover {
  background: rgba(255, 193, 7, 0.2);
}

.admin-panel {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg-secondary, #1a1a1a);
  border: 1px solid rgba(11, 108, 255, 0.3);
  border-radius: 4px;
  padding: 1rem;
  margin-top: 0.5rem;
  min-width: 180px;
  z-index: 100;
}

.admin-panel h4 {
  margin: 0 0 0.75rem 0;
  color: #ffc107;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-action-btn {
  display: block;
  width: 100%;
  background: rgba(11, 108, 255, 0.1);
  border: 1px solid rgba(11, 108, 255, 0.3);
  color: var(--accent, #0b6cff);
  padding: 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  transition: all 0.2s;
}

.admin-action-btn:hover {
  background: rgba(11, 108, 255, 0.2);
  border-color: var(--accent, #0b6cff);
}

.admin-action-btn.danger {
  background: rgba(255, 107, 107, 0.1);
  border-color: rgba(255, 107, 107, 0.3);
  color: #ff6b6b;
}

.admin-action-btn.danger:hover {
  background: rgba(255, 107, 107, 0.2);
  border-color: #ff6b6b;
}

/* ==================== MESSAGES CONTAINER ====================*/
.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.messages-container::-webkit-scrollbar {
  width: 8px;
}

.messages-container::-webkit-scrollbar-track {
  background: rgba(11, 108, 255, 0.05);
  border-radius: 4px;
}

.messages-container::-webkit-scrollbar-thumb {
  background: rgba(11, 108, 255, 0.2);
  border-radius: 4px;
}

.messages-container::-webkit-scrollbar-thumb:hover {
  background: rgba(11, 108, 255, 0.3);
}

/* Welcome Message */
.welcome-message {
  text-align: center;
  padding: 2rem 1rem;
  color: rgba(255, 255, 255, 0.6);
  margin: auto;
}

.welcome-message p {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
}

.welcome-message small {
  display: block;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.4);
}

/* Message Items */
.message-item {
  display: flex;
  justify-content: flex-start;
  animation: slideIn 0.3s ease-out;
}

.message-item.own-message {
  justify-content: flex-end;
}

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

.message-content {
  max-width: 85%;
  background: rgba(11, 108, 255, 0.08);
  border-left: 3px solid rgba(11, 108, 255, 0.3);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  position: relative;
}

.message-item.own-message .message-content {
  background: rgba(11, 108, 255, 0.2);
  border-left: none;
  border-right: 3px solid var(--accent, #0b6cff);
}

.message-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
}

.username {
  font-weight: 600;
  color: var(--accent, #0b6cff);
}

.timestamp {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8rem;
}

.btn-delete {
  margin-left: auto;
  background: none;
  border: none;
  color: #ff6b6b;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  opacity: 0.6;
  transition: all 0.2s;
}

.btn-delete:hover {
  opacity: 1;
  background: rgba(255, 107, 107, 0.1);
}

.message-text {
  margin: 0;
  word-wrap: break-word;
  line-height: 1.4;
  color: var(--text-primary, #fff);
}

/* ==================== CHAT FOOTER ====================*/
.chat-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid rgba(11, 108, 255, 0.2);
  flex-shrink: 0;
}

#messageForm {
  display: flex;
  gap: 0.5rem;
}

#messageInput {
  flex: 1;
  background: rgba(11, 108, 255, 0.05);
  border: 1px solid rgba(11, 108, 255, 0.2);
  color: var(--text-primary, #fff);
  padding: 0.75rem;
  border-radius: 20px;
  font-family: inherit;
  font-size: 0.95rem;
  transition: all 0.2s;
}

#messageInput:focus {
  outline: none;
  border-color: var(--accent, #0b6cff);
  background: rgba(11, 108, 255, 0.1);
  box-shadow: 0 0 8px rgba(11, 108, 255, 0.15);
}

#messageInput::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.btn-send {
  background: var(--accent, #0b6cff);
  border: none;
  color: #000;
  padding: 0.75rem 1.5rem;
  border-radius: 20px;
  cursor: pointer;
  font-weight: bold;
  font-size: 0.95rem;
  transition: all 0.2s;
}

.btn-send:hover {
  opacity: 0.9;
  transform: scale(1.02);
}

.btn-send:active {
  transform: scale(0.98);
}

/* ==================== WELCOME MODAL ====================*/
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.welcome-card {
  background: var(--bg-primary, #000);
  border: 2px solid rgba(11, 108, 255, 0.3);
  border-radius: 12px;
  padding: 2.5rem;
  max-width: 450px;
  width: 90%;
  backdrop-filter: blur(10px);
  animation: cardFadeIn 0.4s ease-out;
}

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

.welcome-card h2 {
  color: var(--accent, #0b6cff);
  font-size: 2rem;
  text-align: center;
  margin: 0 0 0.5rem 0;
  font-weight: bold;
}

.welcome-subtitle {
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
  margin: 0 0 2rem 0;
  font-size: 0.95rem;
}

#usernameForm {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
  font-size: 0.95rem;
}

.form-group input {
  background: rgba(11, 108, 255, 0.05);
  border: 2px solid rgba(11, 108, 255, 0.2);
  color: var(--text-primary, #fff);
  padding: 0.85rem;
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent, #0b6cff);
  background: rgba(11, 108, 255, 0.1);
  box-shadow: 0 0 12px rgba(11, 108, 255, 0.2);
}

.form-group input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.form-group small {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8rem;
}

.btn-primary {
  background: var(--accent, #0b6cff);
  border: none;
  color: #000;
  padding: 0.9rem;
  border-radius: 8px;
  font-weight: bold;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  margin-top: 0.5rem;
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(11, 108, 255, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
}

.error-message {
  color: #ff6b6b;
  font-size: 0.85rem;
  text-align: center;
  min-height: 1rem;
}

/* ==================== BANNED USERS MODAL ====================*/
.modal-content {
  background: var(--bg-primary, #000);
  border: 2px solid rgba(11, 108, 255, 0.3);
  border-radius: 12px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(11, 108, 255, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  color: var(--accent, #0b6cff);
}

.modal-body {
  padding: 1.5rem;
}

.modal-body .form-group {
  margin-bottom: 1rem;
}

.modal-body .form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
}

.banned-list {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
}

.empty-state {
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  padding: 2rem 0;
  font-style: italic;
}

.banned-user-item {
  background: rgba(11, 108, 255, 0.05);
  border: 1px solid rgba(11, 108, 255, 0.2);
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.user-info {
  flex: 1;
}

.user-info strong {
  color: var(--accent, #0b6cff);
  font-size: 1rem;
  display: block;
  margin-bottom: 0.25rem;
}

.user-info small {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8rem;
  display: block;
  margin-bottom: 0.5rem;
}

.ban-reason {
  margin: 0.5rem 0 0 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  font-style: italic;
}

.btn-unban {
  background: rgba(81, 207, 102, 0.15);
  border: 1px solid rgba(81, 207, 102, 0.3);
  color: #51cf66;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-unban:hover {
  background: rgba(81, 207, 102, 0.25);
  border-color: #51cf66;
}

.modal-footer {
  padding: 1.5rem;
  border-top: 1px solid rgba(11, 108, 255, 0.2);
  display: flex;
  justify-content: flex-end;
}

.btn-secondary {
  background: rgba(11, 108, 255, 0.1);
  border: 1px solid rgba(11, 108, 255, 0.3);
  color: var(--accent, #0b6cff);
  padding: 0.65rem 1.5rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: rgba(11, 108, 255, 0.2);
}

/* Badge for Admin Messages */
.badge-admin {
  color: #ffc107;
  font-weight: bold;
  margin-right: 0.25rem;
}

/* Logout Button */
.btn-logout {
  background: #ff4444;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-logout:hover {
  background: #dd3333;
  box-shadow: 0 2px 8px rgba(255, 68, 68, 0.3);
}

/* ==================== RESPONSIVE ====================*/
@media (max-width: 768px) {
  .welcome-card {
    padding: 1.5rem;
  }

  .welcome-card h2 {
    font-size: 1.6rem;
  }

  .message-content {
    max-width: 90%;
  }

  .modal-content {
    width: 95%;
  }

  .chat-container {
    gap: 0.5rem;
  }

  .messages-container {
    padding: 0.75rem;
    gap: 0.5rem;
  }

  .chat-footer {
    padding: 0.5rem;
  }

  #messageForm {
    gap: 0.4rem;
  }

  .btn-send {
    padding: 0.65rem 1rem;
    font-size: 0.85rem;
  }

  .admin-panel {
    position: fixed;
    left: 1rem;
    right: 1rem;
    width: auto;
    min-width: unset;
  }
}
