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

.fade-out {
  animation: fadeOut 7s forwards;
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0.4;
    display: none;
  }
}

/* Leaderboard */
.card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.table-zebra tr:nth-child(even) {
  background-color: #f9fafb;
}

.btn-primary {
  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
  transition: transform 0.3s ease;
}

.btn-primary:hover {
  transform: scale(1.1);
}

.scale-105 {
  transform: scale(1.05);
}

/* Search */
#suggestions {
  @apply border rounded shadow-lg overflow-y-auto;
  min-width: var(--input-width, 100%);
  max-height: calc(100vh - 100px);
  max-width: calc(100vw - 20px);
  right: 0;
  top: 100%;
  z-index: 1001;
}

.input {
  padding-left: 2.5rem;
  padding-right: 2.5rem;
}

/* Left Menu */
.menu-overlay.active { display: block; }
.menu-panel.translate-x-0 { transform: translateX(0); }
@media (prefers-color-scheme: dark) {
  .menu-panel { background-color: #1f2937; }
  .text-base-content { color: #d1d5db; }
  .hover:bg-base-200 { background-color: #374151; }
}

/* Chat */
.full-screen {
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

.avatar-wrapper {
  min-width: 2.5rem !important; /* 40px */
  max-width: 2.5rem !important;
}

/* Lexxy */
lexxy-toolbar {
  position: sticky;
  top: 0px;
  z-index: 1000;
  padding: 0px;
}
.lexxy-content ul {
  list-style-type: disc;
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}
.lexxy-content ol {
  list-style-type: decimal;
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}
.lexxy-content li {
  margin-bottom: 0.5rem;
}
.lexxy-content h1 {
  font-size: 1rem;
  font-weight: normal;
}

/* Lexxy toolbar */
lexxy-editor .lexxy-editor__toolbar {
  display: flex !important;
  flex-direction: row !important;
  justify-content: flex-start !important;
  align-items: center !important;
  padding: 4px 8px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  flex-wrap: nowrap !important;
  -webkit-overflow-scrolling: touch !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

lexxy-editor .lexxy-editor__button-row {
  display: flex !important;
  flex-wrap: nowrap !important;
  justify-content: flex-start !important;
  align-items: center !important;
  gap: 6px !important;
  min-width: max-content !important;
  width: auto !important;
}

lexxy-editor .lexxy-editor__button-group {
  display: flex !important;
  flex-shrink: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  gap: 4px !important;
}

@media (max-width: 768px) {
  lexxy-editor .lexxy-editor__toolbar {
    padding: 4px 6px !important;
    justify-content: flex-start !important;
    overflow: hidden !important;
  }

  lexxy-editor .lexxy-editor__button-row {
    gap: 7px !important;
    max-width: none !important;
    width: 100% !important;
    min-width: unset !important;
    justify-content: space-between !important;
  }

  lexxy-editor .lexxy-editor__toolbar-button {
    padding: 7px 9px !important;
    flex: 1 !important;
    max-width: unset !important;
    min-width: unset !important;
    justify-content: center !important;
  }

  lexxy-editor .lexxy-editor__toolbar-button svg {
    width: 19px !important;
    height: 19px !important;
  }

  lexxy-editor .lexxy-editor__button-group {
    gap: 8px !important;
    flex: 1 !important;
    justify-content: center !important;
  }
}

lexxy-editor .lexxy-editor__toolbar-button {
  padding: 6px 8px !important;
  margin: 0 !important;
  flex-shrink: 0 !important;
  min-width: unset !important;
  border-radius: 6px !important;
  font-size: 14px !important;
}

lexxy-editor .lexxy-editor__toolbar-button svg {
  width: 18px !important;
  height: 18px !important;
}

lexxy-editor .lexxy-editor__toolbar,
lexxy-editor .lexxy-editor {
  margin-right: 0 !important;
  padding-right: 0 !important;
}

lexxy-editor summary.lexxy-editor__toolbar-button[aria-label="Show more toolbar buttons"] {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin-left: auto !important;
  margin-right: 4px !important;
  flex-shrink: 0 !important;
  padding: 6px 10px !important;
  height: auto !important;
  line-height: 1 !important;
}

lexxy-editor summary.lexxy-editor__toolbar-button[aria-label="Show more toolbar buttons"]::before {
  line-height: 1 !important;
}