/* ============================================
   CUSTOM CHAT SYSTEM
   ============================================ */

/* Chat Header */
.chat-header {
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, var(--bg-secondary), var(--primary-light));
  border-bottom: 1px solid rgba(255, 215, 0, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-header-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.chat-header-title i {
  color: var(--accent-color);
  font-size: 1.125rem;
}

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

.chat-sound-toggle {
  background: transparent;
  border: 1px solid rgba(255, 215, 0, 0.3);
  color: var(--accent-color);
  padding: 0.375rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.chat-sound-toggle:hover {
  background: rgba(255, 215, 0, 0.1);
  border-color: var(--accent-color);
}

.chat-sound-toggle:active {
  transform: scale(0.95);
}

.chat-sound-toggle.muted {
  color: var(--text-muted);
  border-color: rgba(255, 215, 0, 0.2);
}

.chat-sound-toggle.muted:hover {
  color: var(--text-secondary);
}

.chat-online-count {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.online-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

/* Chat Header User Info */
/* User info bar - appears below header when logged in */
.chat-user-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(255, 215, 0, 0.05);
  border-bottom: 1px solid rgba(255, 215, 0, 0.1);
  gap: 0.75rem;
}

.chat-user-info-content {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

.chat-user-info-content i {
  color: var(--accent-color);
  font-size: 1.125rem;
}

.chat-username-display {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.chat-anonymous-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.375rem;
  background: rgba(147, 51, 234, 0.15);
  border: 1px solid rgba(147, 51, 234, 0.3);
  border-radius: 4px;
  font-size: 0.6875rem;
  color: #a855f7;
  font-weight: 600;
  white-space: nowrap;
}

.chat-anonymous-badge i {
  font-size: 0.625rem;
}

.chat-header-logout {
  background: transparent;
  border: 1px solid rgba(255, 215, 0, 0.3);
  color: var(--text-secondary);
  padding: 0.375rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
}

.chat-header-logout:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
  color: #ef4444;
}

.chat-admin-password-panel {
  padding: 0.5rem 1rem 0.65rem;
  border-bottom: 1px solid rgba(255, 215, 0, 0.08);
  background: rgba(15, 23, 42, 0.35);
}

.chat-admin-password-panel[hidden] {
  display: none !important;
}

.chat-admin-password-toggle {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.35rem 0.5rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  background: transparent;
  border: 1px dashed rgba(148, 163, 184, 0.35);
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.chat-admin-password-toggle:hover {
  color: var(--accent-color);
  border-color: rgba(255, 215, 0, 0.45);
  background: rgba(255, 215, 0, 0.06);
}

.chat-admin-password-form {
  margin-top: 0.55rem;
}

.chat-admin-password-form .chat-form-group {
  margin-bottom: 0.4rem;
}

.chat-admin-password-form .chat-form-group input {
  font-size: 0.8rem;
  padding: 0.4rem 0.55rem;
}

.chat-admin-password-submit {
  width: 100%;
  margin-top: 0.25rem;
  font-size: 0.8rem !important;
  padding: 0.45rem 0.65rem !important;
}

/* Auth Modal */
.chat-auth-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.chat-auth-modal-content {
  background: linear-gradient(180deg, rgba(20, 20, 25, 0.98), rgba(15, 15, 20, 0.98));
  border-radius: 12px;
  width: 100%;
  max-width: 320px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 215, 0, 0.2);
  animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-auth-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid rgba(255, 215, 0, 0.1);
}

.chat-auth-modal-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chat-auth-modal-header i {
  color: var(--accent-color);
}

.chat-modal-close {
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid rgba(255, 215, 0, 0.2);
  color: var(--text-secondary);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
}

.chat-modal-close:hover {
  background: var(--accent-color);
  color: var(--primary-dark);
  transform: rotate(90deg);
}

/* Auth Container */
.chat-auth-container {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-auth-tabs {
  display: flex;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  gap: 0.25rem;
  padding: 0.5rem;
}

.chat-auth-tab {
  flex: 1;
  padding: 0.5rem;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 6px;
  border-bottom: 2px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
}

.chat-auth-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 215, 0, 0.05);
}

.chat-auth-tab.active {
  color: var(--accent-color);
  background: rgba(255, 215, 0, 0.15);
  border-color: rgba(255, 215, 0, 0.3);
}

/* Auth Forms */
.chat-auth-form {
  display: none;
  padding: 1.25rem 1rem;
  overflow-y: auto;
}

.chat-auth-form.active {
  display: flex;
  flex-direction: column;
}

.chat-form-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.chat-form-header i {
  font-size: 3rem;
  color: var(--accent-color);
  margin-bottom: 0.75rem;
  display: block;
}

.chat-form-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.chat-form-header p {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Form Groups */
.chat-form-group {
  margin-bottom: 0.75rem;
}

.chat-form-group label {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.chat-form-group label i {
  color: var(--accent-color);
  font-size: 0.875rem;
}

.chat-form-group input {
  width: 100%;
  padding: 0.75rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: all 0.3s ease;
}

.chat-form-group input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1);
}

.chat-form-group small {
  display: block;
  margin-top: 0.375rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Anonymous Login Info Box */
.chat-anonymous-info {
  margin-bottom: 1.5rem;
}

.chat-info-box {
  background: rgba(255, 215, 0, 0.05);
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  gap: 0.75rem;
}

.chat-info-box > i {
  color: var(--accent-color);
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-top: 0.25rem;
}

.chat-info-box h4 {
  margin: 0 0 0.75rem 0;
  font-size: 0.875rem;
  color: var(--text-primary);
  font-weight: 600;
}

.chat-info-box ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.chat-info-box li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.chat-info-box li i.fa-check {
  color: #10b981;
  font-size: 0.75rem;
}

.chat-info-box li i.fa-times {
  color: #ef4444;
  font-size: 0.75rem;
}

/* Submit Button */
.chat-submit-btn {
  width: 100%;
  padding: 0.875rem;
  background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
  color: var(--primary-dark);
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.chat-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(255, 215, 0, 0.4);
}

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

.chat-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Form Messages */
.chat-form-message {
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: 8px;
  font-size: 0.875rem;
  text-align: center;
  display: none;
}

.chat-form-message.success {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  display: block;
}

.chat-form-message.error {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
  display: block;
}

/* Messages Container */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1rem;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: var(--accent-color);
}

.chat-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2rem;
  color: var(--text-secondary);
}

.chat-loading i {
  font-size: 1.5rem;
  color: var(--accent-color);
}

/* Message: meta row (name + actions), then full message text (wraps, no ellipsis) */
.chat-message {
  display: block;
  animation: messageSlide 0.3s ease;
}

@keyframes messageSlide {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-message-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.2rem;
  font-size: 0.8125rem;
  line-height: 1.4;
  padding: 0.15rem 0;
  border-radius: 6px;
  min-width: 0;
}

.chat-message-meta {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.45rem;
  min-width: 0;
}

.chat-message-username {
  flex-shrink: 0;
  font-weight: 700;
  color: var(--accent-color);
  word-break: break-word;
}

.chat-admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0 5px;
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-radius: 8px;
  flex-shrink: 0;
  line-height: 1.2;
}

.chat-admin-badge i {
  font-size: 0.55rem;
}

.chat-message-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
  font-size: 0.68rem;
}

.chat-message-action {
  padding: 0;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s ease;
}

.chat-message-action:hover {
  color: var(--accent-color);
}

.chat-message-action--danger {
  color: rgba(248, 113, 113, 0.85);
}

.chat-message-action--danger:hover {
  color: #fca5a5;
}

.chat-message-action-sep {
  color: rgba(148, 163, 184, 0.45);
  user-select: none;
  pointer-events: none;
}

.chat-message-body {
  width: 100%;
  min-width: 0;
  color: var(--text-primary);
  font-size: 0.8125rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow: visible;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.chat-message-text {
  display: inline;
}

.chat-inline-reply {
  display: block;
  color: var(--text-muted);
  font-style: italic;
  margin: 0 0 0.2rem;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.chat-inline-reply i {
  font-size: 0.65rem;
  margin-right: 0.15rem;
  color: var(--accent-color);
  font-style: normal;
}

/* Admin clickable links */
.chat-message-body .chat-link {
  color: var(--accent-color);
  text-decoration: underline;
  transition: all 0.2s ease;
  cursor: pointer;
  word-break: break-all;
  overflow-wrap: anywhere;
}

.chat-message-body .chat-link:hover {
  color: var(--accent-hover);
  text-decoration: none;
}

.chat-message-body .chat-link:active {
  opacity: 0.7;
}

.chat-own-marker {
  color: #ef4444;
  font-weight: 700;
  font-size: 1em;
  line-height: 1;
  flex-shrink: 0;
  margin-right: 0.2rem;
  align-self: center;
}

/* Reply Input Indicator */
.chat-replying-to {
  padding: 0.5rem 0.75rem;
  background: rgba(255, 215, 0, 0.1);
  border-left: 3px solid var(--accent-color);
  border-radius: 4px 4px 0 0;
  font-size: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 9px;

}

.chat-replying-to-text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.chat-replying-to-user {
  color: var(--accent-color);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.chat-replying-to-message {
  color: var(--text-muted);
  font-style: italic;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 250px;
}

.chat-cancel-reply {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: all 0.2s ease;
  font-size: 1rem;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-cancel-reply:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

/* Input Container */
.chat-input-container {
  padding: 1rem;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
}

.chat-input-wrapper {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}

.chat-input-wrapper textarea {
  flex: 1;
  padding: 0.75rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: inherit;
  resize: none;
  max-height: 120px;
  transition: all 0.3s ease;
}

.chat-input-wrapper textarea:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1);
}

.chat-send-btn {
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
  color: var(--primary-dark);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-send-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
}

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

.chat-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.chat-input-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.char-count {
  color: var(--text-muted);
}

.char-count.warning {
  color: #f59e0b;
}

.char-count.danger {
  color: #ef4444;
}

.rate-limit-info {
  color: #ef4444;
  font-weight: 600;
}

/* Empty State */
.chat-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
  text-align: center;
}

.chat-empty i {
  font-size: 3rem;
  color: var(--accent-color);
  opacity: 0.5;
  margin-bottom: 1rem;
}

.chat-empty p {
  font-size: 0.875rem;
}

/* Chat Welcome State (for guests) */
.chat-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  text-align: center;
  height: 100%;
}

.chat-welcome-icon {
  margin-bottom: 1.5rem;
}

.chat-welcome-icon i {
  font-size: 4rem;
  color: var(--accent-color);
  opacity: 0.8;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.05);
    opacity: 1;
  }
}

.chat-welcome h3 {
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.chat-welcome p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  line-height: 1.6;
}

.chat-welcome-btn {
  padding: 0.625rem 1.75rem;
  background: transparent;
  color: var(--accent-color);
  border: 1.5px solid var(--accent-color);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.chat-welcome-btn:hover {
  background: var(--accent-color);
  color: var(--bg-primary);
  box-shadow: 0 4px 16px rgba(255, 215, 0, 0.25);
}

.chat-welcome-btn i {
  font-size: 0.9rem;
}

/* Mobile Responsive */
/* ============================================
   MOBILE FLOATING ACTION BUTTON (FAB)
   ============================================ */

.chat-fab {
  position: fixed;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  width: 36px;
  height: 56px;
  background: rgba(14, 17, 24, 0.85);
  border: 1px solid rgba(255, 215, 0, 0.35);
  border-right: none;
  border-radius: 10px 0 0 10px;
  color: #ffd700;
  font-size: 16px;
  cursor: pointer;
  box-shadow: -2px 0 12px rgba(0, 0, 0, 0.4);
  z-index: 1001;
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
}

/* Hide button on left edge of chat sidebar - positioned OUTSIDE */
.chat-hide-edge-btn {
  position: absolute;
  left: -32px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 60px;
  background: rgba(14, 17, 24, 0.85);
  border: 1px solid rgba(255, 215, 0, 0.35);
  border-right: none;
  border-radius: 8px 0 0 8px;
  cursor: pointer;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.4);
  z-index: 1002;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffd700;
  transition: all 0.2s ease;
  font-size: 0.85rem;
  backdrop-filter: blur(8px);
}

.chat-hide-edge-btn i {
  animation: chevronPulse 2s ease-in-out infinite;
}

@keyframes chevronPulse {
  0%, 100% {
    transform: translateX(0);
    opacity: 1;
  }
  50% {
    transform: translateX(2px);
    opacity: 0.7;
  }
}

/* Desktop Chat Show Button (appears when chat is hidden) */
.chat-show-btn {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: #ffd700;
  border: 1px solid rgba(255, 215, 0, 0.35);
  border-right: none;
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
  padding: 1.25rem 0.625rem;
  cursor: pointer;
  box-shadow: -2px 0 12px rgba(0, 0, 0, 0.4);
  z-index: 999;
  display: none;
  backdrop-filter: blur(8px);
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: #1e1e2f;
  transition: all 0.3s ease;
}

.chat-show-btn:hover {
  padding-right: 1rem;
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.7);
  transform: translateY(-50%) translateX(-5px);
}

.chat-show-btn:active {
  transform: translateY(-50%) scale(0.98);
}

.chat-show-btn i {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.chat-show-btn span {
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.1em;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  text-transform: uppercase;
}

/* Hidden chat sidebar - completely hide from view */
.chat-sidebar.chat-hidden {
  display: none !important;
}

.chat-sidebar.chat-hidden .chat-hide-edge-btn {
  display: none;
}

.chat-fab i {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  animation: pulse 2s infinite;
  font-size: 15px;
}

.chat-fab:hover {
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.8);
}

.chat-fab:active {
  transform: translateY(-50%) scale(0.95);
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.7;
  }
}

/* Close button for mobile fullscreen */
.chat-close-mobile {
  display: none;
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 18px;
  cursor: pointer;
  z-index: 10;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.chat-close-mobile:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateX(-50%) rotate(90deg);
}

/* Mobile fullscreen chat */
.chat-sidebar.mobile-fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  /* Dynamic viewport height for mobile */
  z-index: 999999 !important;
  display: flex !important;
  border: none !important;
  animation: slideUp 0.3s ease;
  overflow: hidden !important;
}

/* Hide bottom menu when chat is fullscreen */
body:has(.chat-sidebar.mobile-fullscreen) .mobile-bottom-nav,
body.chat-fullscreen-active .mobile-bottom-nav {
  display: none !important;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

.chat-sidebar.mobile-fullscreen .chat-container {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.chat-sidebar.mobile-fullscreen .chat-close-mobile {
  display: flex;
}

@media (max-width: 1261px) {
  /* Hide desktop-only chat controls */
  .chat-show-btn,
  .chat-hide-edge-btn {
    display: none !important;
  }
}

@media (max-width: 1261px) {
  /* Show chat FAB on tablets and mobile (chat sidebar is hidden in this range) */
  .chat-fab {
    display: flex;
    top: auto;
    bottom: calc(var(--mobile-nav-height, 56px) + env(safe-area-inset-bottom) + 0.75rem);
    right: 0;
    transform: none;
    width: 40px;
    height: 40px;
    border-radius: 50% 0 0 50%;
    border-right: none;
  }

  body:has(.chat-sidebar.mobile-fullscreen) .chat-fab {
    display: none !important;
  }
}

@media (max-width: 968px) {
  .chat-messages {
    padding: 0.75rem;
  }

  .chat-input-container {
    padding: 0.75rem;
  }

  .chat-auth-modal-content {
    max-width: 95%;
  }

  .chat-form-group {
    margin-bottom: 0.75rem;
  }

  .chat-auth-modal-header {
    padding: 0.875rem;
  }

  /* When chat is fullscreen on mobile */
  .chat-sidebar.mobile-fullscreen .chat-messages {
    flex: 1;
    max-height: none;
    overflow-y: auto;
  }

  .chat-sidebar.mobile-fullscreen .chat-header {
    flex-shrink: 0;
  }

  .chat-sidebar.mobile-fullscreen .chat-input-container {
    flex-shrink: 0;
  }
}