/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

.chat-message a {
  color: #66bbee;
  text-decoration: underline;
}

.mention {
  display: inline-block;
  padding: 0 0.25rem;
  border-radius: 4px;
  background-color: #1b2040;
  color: #ff9900;
  font-weight: 600;
}

.hidden {
  display: none !important;
}

.tweet-embed,
.youtube-embed,
.vimeo-embed,
.rumble-embed,
.odysee-embed {
  display: block;
  width: 100%;
  max-width: 800px;
  margin: 0;
  overflow: hidden;
  box-sizing: border-box;
}

.tweet-embed blockquote,
.tweet-embed iframe,
.vimeo-embed iframe {
  max-width: 100% !important;
  width: 100% !important;
}

.tweet-embed.fx-tweet-embed {
  background-color: #0f1220;
  border: 1px solid #2a2f4a;
  border-radius: 12px;
  padding: 0.75rem;
  margin-top: 0.75rem;
  width: 100%;
  max-width: 800px;
  margin-right: auto;
}

.fx-tweet-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  box-sizing: border-box;
}

.fx-tweet-card--quoted {
  border-radius: 10px;
  border: 1px solid #2a2f4a;
  padding: 0.75rem;
  background-color: #0b0d1b;
}

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

.fx-tweet-avatar {
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  object-fit: cover;
  flex-shrink: 0;
}

.fx-tweet-card--quoted .fx-tweet-avatar {
  width: 32px;
  height: 32px;
}

.fx-tweet-author {
  flex: 1 1 auto;
  min-width: 0;
}

.fx-tweet-author-name {
  color: #e6e8f0;
  font-weight: 600;
  line-height: 1.2;
}

.fx-tweet-author-handle {
  color: #9397b3;
  font-size: 0.85rem;
}

.fx-tweet-timestamp {
  color: #9397b3;
  font-size: 0.85rem;
  text-decoration: none;
}

.fx-tweet-timestamp:hover {
  color: #e6e8f0;
}

.fx-tweet-body {
  color: #e6e8f0;
  font-size: 0.95rem;
  line-height: 1.5;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.fx-tweet-body a {
  color: #66bbee;
  text-decoration: underline;
}

.fx-tweet-media {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.fx-tweet-photos {
  display: grid;
  gap: 0.5rem;
}

.fx-tweet-photos.photos-1 {
  grid-template-columns: 1fr;
}

.fx-tweet-photos.photos-2,
.fx-tweet-photos.photos-4 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.fx-tweet-photos.photos-3 {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.fx-tweet-photo {
  width: 100%;
  display: block;
  border-radius: 12px;
  object-fit: cover;
}

.fx-tweet-video {
  position: relative;
}

.fx-tweet-video-player {
  width: 100%;
  border-radius: 12px;
  display: block;
  background-color: #000;
}

.fx-tweet-counts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  color: #9397b3;
  font-size: 0.85rem;
}

.fx-tweet-count strong {
  color: #e6e8f0;
  font-weight: 600;
  margin-right: 0.25rem;
}

.fx-tweet-count-separator {
  color: #2a2f4a;
}

.fx-tweet-quote {
  margin-top: 0.5rem;
}

@media (max-width: 600px) {
  .tweet-embed.fx-tweet-embed {
    max-width: calc(100vw - 2rem);
  }
}

.youtube-embed {
  position: relative;
  width: 100%;
  max-width: 800px;
  display: block;
  box-sizing: border-box;
}

.youtube-embed .youtube-embed-inner {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
}

.youtube-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  max-width: 100%;
}

.rumble-embed {
  position: relative;
  width: 100%;
  max-width: 800px;
  display: block;
  box-sizing: border-box;
}

.rumble-embed .rumble-embed-inner {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
}

.rumble-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  max-width: 100%;
}

.odysee-embed {
  position: relative;
  width: 100%;
  max-width: 800px;
  display: block;
  box-sizing: border-box;
}

.odysee-embed .odysee-embed-inner {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
}

.odysee-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  max-width: 100%;
}

.message-bubble {
  position: relative;
  padding: 0 0.5rem;
  border-radius: 0.5rem;
  transition: background-color 0.15s ease;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  overflow: visible;
}

.message-bubble:hover {
  background-color: rgba(255, 255, 255, 0.04);
}

.chat-message {
  flex: 1 1 auto;
  min-width: 0;
  word-break: break-word;
  padding-top: 0.5rem;
}

.chat-message h1,
.chat-message h2,
.chat-message h3,
.chat-message h4,
.chat-message h5,
.chat-message h6 {
  color: #e6e8f0;
  margin-top: 0.75rem;
  margin-bottom: 0.25rem;
  line-height: 1.2;
}

.chat-message h1 {
  font-size: 1.5rem;
}

.chat-message h2 {
  font-size: 1.35rem;
}

.chat-message h3 {
  font-size: 1.2rem;
}

.chat-message img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin-top: 0.5rem;
}

.chat-message pre {
  background-color: #1b2040;
  border: 1px solid #2a2f4a;
  border-radius: 6px;
  padding: 0.75rem;
  margin-top: 0.5rem;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.875rem;
  line-height: 1.5;
}

.message-actions {
  padding: 0rem 0.25rem;
  border: 1px solid #2a2f4a;
  border-radius: 9999px;
  background-color: rgba(17, 20, 45, 0.95);
  backdrop-filter: blur(4px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 1000;
}

.message-actions .reaction-trigger,
.message-actions .message-owner-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chat-message code {
  background-color: rgba(17, 20, 45, 0.8);
  border-radius: 4px;
  padding: 0.1rem 0.3rem;
  font-family: ui-monospace, SFMono-Regular, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.875rem;
}

.chat-message pre code {
  background-color: transparent;
  border-radius: 0;
  padding: 0;
}

.chat-composer {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  width: 100%;
}

.chat-composer textarea {
  flex: 1 1 auto;
  min-width: 0;
  max-height: 12rem;
}

#messages {
  width: 100%;
  overflow-x: hidden;
}

.chat-panel {
  width: 100%;
  overflow-x: hidden;
}

.chat-panel iframe,
.chat-panel img,
.chat-panel video {
  max-width: 100%;
}

.reaction-trigger {
  position: relative;
  opacity: 0;
  transition: opacity 0.2s ease;
  color: #9397b3;
  flex: 0 0 auto;
}

.message-actions,
.message-delete-trigger {
  opacity: 0;
  transition: opacity 0.2s ease;
  flex: 0 0 auto;
}

.message-edit-trigger {
  opacity: 0;
  transition: opacity 0.2s ease;
  flex: 0 0 auto;
}

.message-bubble--selected {
  outline: 1px solid rgba(255, 153, 0, 0.6);
  border-radius: 8px;
  background-color: rgba(255, 153, 0, 0.08);
}

.message-actions:hover,
.message-actions:focus-within,
.message-bubble:hover .message-actions,
.message-bubble:hover .reaction-trigger,
.reaction-trigger:focus-within,
.reaction-trigger:hover {
  opacity: 1;
  pointer-events: auto;
  color: #ffffff;
}

.message-bubble:hover .message-delete-trigger,
.message-delete-trigger:focus-within,
.message-delete-trigger:hover {
  opacity: 1;
}

.message-bubble:hover .message-edit-trigger,
.message-edit-trigger:focus-within,
.message-edit-trigger:hover {
  opacity: 1;
}

.message-bubble--selected .message-actions,
.message-bubble--selected .reaction-trigger,
.message-bubble--selected .message-delete-trigger,
.message-bubble--selected .message-edit-trigger {
  opacity: 1;
  pointer-events: auto;
}

.reaction-picker-menu {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 4px;
  display: flex;
  gap: 4px;
  background: #11142d;
  border: 1px solid #2a2f4a;
  padding: 4px;
  border-radius: 6px;
  z-index: 1000;
}

.reaction-picker-menu form {
  display: inline-block;
}

.reaction-detail {
  position: relative;
}

.reaction-detail > summary::marker {
  content: '';
}

.reaction-detail[open] .reaction-popover {
  display: block;
}

.reaction-popover {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  background: #11142d;
  border: 1px solid #2a2f4a;
  border-radius: 6px;
  padding: 6px;
  z-index: 40;
  min-width: 140px;
}

/* Message height limiting - EDIT THIS CONSTANT to change max height */
:root {
  --message-max-height: 300px;
}

.message-content-wrapper {
  position: relative;
}

.message-content-wrapper.shortened {
  max-height: var(--message-max-height);
  overflow: hidden;
  position: relative;
}

.message-content-wrapper.shortened::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(to bottom, transparent, rgba(15, 18, 32, 0.95));
  pointer-events: none;
}

.message-content-wrapper.expanded {
  max-height: none;
  overflow: visible;
}

.message-expand-button {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.5rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  color: #66bbee;
  background-color: transparent;
  border: 1px solid #2a2f4a;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.message-expand-button:hover {
  background-color: rgba(102, 187, 238, 0.1);
  border-color: #66bbee;
}

.message-expand-button i {
  font-size: 0.75rem;
}
