/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *
 *= require_tree .
 *= require_self
 */

.athlete-link .athlete-hovercard {
  display: none;
}

.athlete-link:hover .athlete-hovercard {
  position: absolute;
  display: inline-block;
}

a.athlete-link {
  color: rgb(34 197 94);
  text-decoration-line: underline;
}

a.club-link {
  color: rgb(70, 70, 70);
  text-decoration-line: underline;
}

/* Hotwire Combobox Customization */
.hw-combobox {
  width: 100%;
  position: relative;
}

/* Allow combobox listbox to overflow modal containers */
.hw-combobox__main__wrapper {
  position: relative;
}

/* Override modal body overflow when it contains a combobox to allow dropdown to show */
.overflow-y-auto:has(.hw-combobox) {
  overflow: visible !important;
}

.hw-combobox__main-wrapper {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  background-color: white;
}

.hw-combobox__input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  border: none;
  outline: none;
  background: transparent;
}

.hw-combobox__input:focus {
  outline: none;
  box-shadow: none;
}

.hw-combobox__main-wrapper:focus-within {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.hw-combobox__listbox {
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  background-color: white;
  max-height: 200px;
  overflow-y: auto;
  z-index: 9999 !important; /* High z-index to appear above modals */
}

.hw-combobox__option {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  cursor: pointer;
}

.hw-combobox__option:hover,
.hw-combobox__option--selected {
  background-color: #eff6ff;
}

.hw-combobox__option[aria-selected="true"] {
  background-color: #3b82f6;
  color: white;
}

/* Fix hover state on selected items - prevent white text on light background */
.hw-combobox__option[aria-selected="true"]:hover {
  background-color: #2563eb; /* blue-600 - slightly darker on hover */
  color: white;
}

/* Multiselect chips */
.hw-combobox__chip {
  background-color: #eff6ff;
  color: #1e40af;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  margin-right: 0.25rem;
}

/* Normalize multiselect height to match single select */
.hw-combobox--multiple .hw-combobox__input {
  line-height: 1.5rem !important;
}

/* Also fix the wrapper class name (gem uses double underscore) */
.hw-combobox__main__wrapper {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  background-color: white;
}

.hw-combobox__main__wrapper:focus-within {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

/* Dark theme combobox styles - using data-theme="dark" attribute */
.hw-combobox[data-theme="dark"] {
  display: block;
  width: 100%;
}

.hw-combobox[data-theme="dark"] .hw-combobox__main__wrapper {
  display: flex;
  align-items: center;
  width: 100%;
  border: 1px solid #475569 !important; /* slate-600 */
  border-radius: 0.5rem !important; /* rounded-lg */
  background-color: #334155 !important; /* slate-700 */
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* Input element inside dark theme combobox - target by parent structure since input may not have hw-combobox__input class */
.hw-combobox[data-theme="dark"] .hw-combobox__main__wrapper input,
.hw-combobox__main__wrapper input[data-theme="dark"] {
  color: white !important;
  background-color: transparent !important;
  background: transparent !important;
  font-size: 0.875rem; /* sm:text-sm */
  padding: 0.5rem 0.75rem;
  flex: 1;
  min-width: 0;
  border: none !important;
  border-width: 0 !important;
  --tw-ring-shadow: none !important;
}

.hw-combobox[data-theme="dark"] .hw-combobox__main__wrapper input::placeholder,
.hw-combobox__main__wrapper input[data-theme="dark"]::placeholder {
  color: #64748b !important; /* slate-500 */
  opacity: 1;
}

.hw-combobox[data-theme="dark"] .hw-combobox__main__wrapper input:focus,
.hw-combobox__main__wrapper input[data-theme="dark"]:focus {
  outline: none !important;
  box-shadow: none !important;
  --tw-ring-shadow: none !important;
  border-color: transparent !important;
}

.hw-combobox[data-theme="dark"] .hw-combobox__main__wrapper:focus-within {
  border-color: #f59e0b !important; /* amber-500 */
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.3) !important;
}

/* Listbox element inside dark theme combobox */
.hw-combobox[data-theme="dark"] .hw-combobox__listbox {
  border: 1px solid #475569 !important; /* slate-600 */
  border-radius: 0.5rem !important; /* rounded-lg */
  background-color: #334155 !important; /* slate-700 */
  background: #334155 !important;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
  z-index: 200;
  margin-top: 0.25rem;
}

.hw-combobox[data-theme="dark"] .hw-combobox__listbox .hw-combobox__option,
.hw-combobox[data-theme="dark"] .hw-combobox__listbox li {
  color: #e2e8f0 !important; /* slate-200 */
  background-color: transparent;
}

.hw-combobox[data-theme="dark"] .hw-combobox__listbox .hw-combobox__option:hover,
.hw-combobox[data-theme="dark"] .hw-combobox__listbox .hw-combobox__option--selected,
.hw-combobox[data-theme="dark"] .hw-combobox__listbox li:hover {
  background-color: #475569 !important; /* slate-600 */
}

.hw-combobox[data-theme="dark"] .hw-combobox__listbox .hw-combobox__option[aria-selected="true"],
.hw-combobox[data-theme="dark"] .hw-combobox__listbox li[aria-selected="true"] {
  background-color: #f59e0b !important; /* amber-500 */
  color: #0f172a !important; /* slate-900 */
}

.hw-combobox[data-theme="dark"] .hw-combobox__chip {
  background-color: #f59e0b !important; /* amber-500 */
  color: #0f172a !important; /* slate-900 */
}

.hw-combobox[data-theme="dark"] .hw-combobox__handle {
  color: #94a3b8; /* slate-400 */
}

/* Ensure listbox z-index is above modal */
.hw-combobox__listbox {
  z-index: 200 !important;
}

/* Utility to hide scrollbar while allowing scroll */
.scrollbar-hide {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}

.scrollbar-hide::-webkit-scrollbar {
  display: none;  /* Chrome, Safari and Opera */
}

/* Tailwind Override */
.trix-editor {
  width: 100%;
}

.trix-editor h1 {
  font-size: 1.25rem !important;
  line-height: 1.25rem !important;
  margin-bottom: 1rem;
  font-weight: 600;
}

.trix-editor a:not(.no-underline) {
  text-decoration: underline;
}

.trix-editor a:visited {
  color: green;
}

.trix-editor ul {
  list-style-type: disc;
  padding-left: 1rem;
}

.trix-editor ol {
  list-style-type: decimal;
  padding-left: 1rem;
}

.trix-editor pre {
  display: inline-block;
  width: 100%;
  vertical-align: top;
  font-family: monospace;
  font-size: 1.5em;
  padding: 0.5em;
  white-space: pre;
  background-color: #eee;
  overflow-x: auto;
}

.trix-editor blockquote {
  border: 0 solid #ccc;
  border-left-width: 0px;
  border-left-width: 0.3em;
  margin-left: 0.3em;
  padding-left: 0.6em;
}

/* Flash notification animations */
@keyframes slide-in-right {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slide-out-right {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

.animate-slide-in-right {
  animation: slide-in-right 0.3s ease-out forwards;
}

.animate-slide-out-right {
  animation: slide-out-right 0.3s ease-out forwards;
}

/* Print styles */
@media print {
  /* Hide navigation and UI chrome */
  nav,
  footer,
  #flash_messages,
  .mobile-navigation,
  .desktop-navigation,
  [data-controller="mobile-menu"],
  [data-controller="dropdown"] {
    display: none !important;
  }

  /* Remove all padding and margins */
  main {
    padding: 0 !important;
    margin: 0 !important;
    background: white !important;
  }

  .p-4,
  .p-6,
  .lg\:p-6 {
    padding: 0.5rem !important;
  }

  footer {
    display: none !important;
  }

  /* Hide grouped view sidebar */
  .print\:hidden {
    display: none !important;
  }

  /* Full width for print content */
  .print\:w-full {
    width: 100% !important;
  }

  /* Show columns hidden on smaller screens */
  .print\:table-cell {
    display: table-cell !important;
  }

  /* Remove decorative styling */
  .rounded-xl,
  .rounded-lg {
    border-radius: 0 !important;
  }

  .shadow-sm,
  .shadow {
    box-shadow: none !important;
  }

  .ring-1 {
    box-shadow: none !important;
  }

  /* Remove borders */
  .border,
  .border-slate-200 {
    border: none !important;
  }

  /* Ensure tables print well */
  table {
    width: 100% !important;
    font-size: 10pt !important;
  }

  th, td {
    padding: 2px 4px !important;
  }

  /* Page break handling */
  tr {
    page-break-inside: avoid;
  }

  thead {
    display: table-header-group;
  }

  /* Set white background */
  body,
  .bg-gray-100,
  .bg-slate-50,
  .bg-white {
    background: white !important;
  }

  /* Compact header section */
  .mb-4 {
    margin-bottom: 0.5rem !important;
  }

  /* Remove gap spacing */
  .gap-2,
  .gap-3 {
    gap: 0.25rem !important;
  }
}
