@tailwind base;
@tailwind components;
@tailwind utilities;

/* Custom Scrollbar for Discord feel */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #2f3136;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb {
  background: #202225;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #18191c;
}

.popout-scroll::-webkit-scrollbar {
  width: 6px;
}
.popout-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.popout-scroll::-webkit-scrollbar-thumb {
  background: #202225;
}

body {
  font-family: 'gg sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* Mobile Drawer Styles */
@media (max-width: 767px) {
  body.mobile-menu-open #server-list {
    display: flex !important;
    position: absolute;
    top: 0; bottom: 0; left: 0;
    z-index: 50;
  }
  body.mobile-menu-open #channel-sidebar {
    display: flex !important;
    position: absolute;
    top: 0; bottom: 0; left: 72px;
    z-index: 50;
    box-shadow: 10px 0 15px -3px rgba(0,0,0,0.3);
  }
}
@media (max-width: 1023px) {
  body.mobile-members-open #members-sidebar {
    display: flex !important;
    position: absolute;
    top: 0; bottom: 0; right: 0;
    z-index: 50;
    box-shadow: -10px 0 15px -3px rgba(0,0,0,0.3);
  }
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
.animate-fade-in {
  animation: fadeIn 0.2s ease-out forwards;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 0.4; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

.typing-dot {
  width: 4px;
  height: 4px;
  background-color: currentColor;
  border-radius: 50%;
  margin: 0 1px;
  animation: pulse-dot 1.4s infinite ease-in-out both;
}
.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

/* Markdown Styles */
.prose p { margin-bottom: 0.5rem; }
.prose p:last-child { margin-bottom: 0; }
.prose a { color: #00aff4; text-decoration: none; }
.prose a:hover { text-decoration: underline; }
.prose strong { font-weight: 700; color: white; }
.prose em { font-style: italic; }
.prose pre { 
  background-color: #2b2d31; 
  padding: 0.5rem; 
  border-radius: 4px; 
  overflow-x: auto;
  border: 1px solid #1e1f22;
  margin-top: 0.25rem;
}
.prose code { 
  background-color: #2b2d31; 
  padding: 0.1rem 0.3rem; 
  border-radius: 3px; 
  font-family: monospace;
  font-size: 0.875em;
}

/* Mentions */
.mention-everyone {
  background-color: rgba(250, 204, 21, 0.1);
  border-left: 2px solid rgba(250, 204, 21, 1);
  padding-left: 14px; /* compensate for -mx-4 logic */
}

/* Scroll jump button */
.jump-to-bottom {
  position: absolute;
  bottom: 80px;
  right: 20px;
  background-color: #36393f;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 40;
  transition: opacity 0.2s, transform 0.2s;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
}
.jump-to-bottom.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.jump-to-bottom:hover {
  background-color: #4f545c;
}

/* Server Icon Hover Fix */
.server-icon-wrapper:hover .server-pill {
  height: 20px;
  border-radius: 8px;
}
.server-icon-wrapper.active .server-pill {
  height: 40px;
  border-radius: 8px;
}
.server-icon-wrapper.active .discord-server-icon {
  border-radius: 16px;
  background-color: #5865F2;
  color: white;
}

/* Formatting toolbar buttons */
.format-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  color: #b9bbbe;
  cursor: pointer;
  transition: background-color 0.1s, color 0.1s;
}
.format-btn:hover {
  background-color: #4f545c;
  color: white;
}

/* Audio Player styling */
audio {
  height: 36px;
  outline: none;
  border-radius: 4px;
  background-color: #2f3136;
}
video {
  border-radius: 8px;
  outline: none;
}
