body {
  background-color: white !important;
  overflow-x: hidden;
}

html {
  background-color: white !important;
}

/* Fix for dialog modal styles */
dialog {
  max-width: 100vw;
  max-height: 100vh;
  width: 100%;
  height: auto;
  background-color: transparent;
  border: none;
  padding: 0;
  margin: 0;
  box-shadow: none;
}

dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.5);
}

.fixed {
  position: fixed;
}

.inset-0 {
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

.aspect-video {
  aspect-ratio: 16 / 9;
}

/* Force max height on preview content */
#document_preview_content {
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* Hide overflow at container level */
}

/* Modal content structure */
#document_preview_content>div {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 90vh;
}

/* Ensure scrollable content area */
#document_preview_content .modal-body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  /* Important for nested flex containers */
}

/* Fixed footer for buttons */
#document_preview_content .modal-footer {
  flex-shrink: 0;
  border-top: 1px solid #e5e7eb;
  margin-top: auto;
  background-color: white;
  position: sticky;
  bottom: 0;
  width: 100%;
}

/* Mobile optimizations for buttons */
@media (max-width: 640px) {
  #document_preview_content .modal-footer .btn {
    height: auto;
    min-height: 44px;
    padding: 8px 16px;
    justify-content: center;
    margin-bottom: 6px;
  }

  /* Last button shouldn't have margin */
  #document_preview_content .modal-footer .btn:last-child {
    margin-bottom: 0;
  }
}

.btn {
  background-color: #002C37 !important;
  border: none;
  text-transform: none;
  font-weight: bold;
  color: white !important;
}

.btn-clear {
  background-color: #F8FAFC !important;
  border: none !important;
  text-transform: none;
  font-weight: bold;
  color: #002C37 !important;
}

.btn:hover {
  filter: brightness(125%);
}

.brightness-change {
  filter: brightness(125%);
}

@media only screen AND (max-width: 819px) {
  .mobile-hidden {
    display: none !important;
  }
}

.danger {
  background-color: #F24725 !important;
  border: none;
  text-transform: none;
  font-weight: bold;
  color: white !important;
}

#modalPreviewContent .a4-page {
  transform-origin: top left;
  max-width: 100%;
  height: auto;
}

@media print {

  #viewPreviewButton,
  #previewModal {
    display: none !important;
  }
}

.post-body p {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.post-body a {
  color: #002C37;
  text-decoration: underline;
}

.post-body a:hover {
  color: #4a5568;
}

.post-body img {
  border-radius: 0.75rem;
  margin-top: 1.75rem;
  max-width: 100% !important;
}

.post-body iframe {
  padding-top: 0.75rem !important;
  padding-bottom: 0.75rem !important;
  max-width: 100% !important;
}

.post-body figcaption {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  color: #9e9e9e;
}

@media only screen AND (min-width: 820px) {
  .desktop-hidden {
    display: none !important;
  }
}

@media only screen AND (max-width: 819px) {
  .mobile-hidden {
    display: none !important;
  }

  .post-body img {
    margin-left: auto;
    margin-right: auto;
  }

  .post-body figcaption {
    text-align: center;
  }
}

.post-body pre {
  white-space: pre-wrap;
  white-space: -moz-pre-wrap;
  white-space: -pre-wrap;
  white-space: -o-pre-wrap;
  word-wrap: break-word;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.post-body h1 {
  font-size: 1.5rem;
  line-height: 1.975rem;
  color: #002C37;
  font-weight: 600;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.post-body h2 {
  font-size: 1.4rem;
  line-height: 1.875rem;
  color: #002C37;
  font-weight: 600;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.post-body h3 {
  font-size: 1.3rem;
  line-height: 1.775rem;
  color: #002C37;
  font-weight: 600;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.post-body h4 {
  font-size: 1.2rem;
  line-height: 1.675rem;
  color: #002C37;
  font-weight: 600;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.post-body h5 {
  font-size: 1.1rem;
  line-height: 1.575rem;
  color: #002C37;
  font-weight: 600;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.post-body h6 {
  font-size: 1rem;
  line-height: 1.475;
  color: #002C37;
  font-weight: 600;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.post-body ul {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  margin-left: 1rem;
  list-style-type: circle;
  list-style: outside;
}

.post-body ol {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  margin-left: 1rem;
  list-style-type: decimal;
}

.step-line {
  flex-shrink: 1;
  min-width: 20px;
}

/* Tabs styling */
.tabs-boxed {
  @apply flex rounded-lg p-1;
}

.tabs-boxed .tab {
  @apply rounded-md py-1 px-3 text-sm transition-colors;
  color: #4b5563 !important;
  /* gray-600 */
}

.tabs-boxed .tab:hover {
  color: #1f2937 !important;
  /* gray-800 */
}

/* Updated active tab style with slate-200 and gray-900 */
.tabs-boxed .tab-active {
  background-color: #e2e8f0 !important;
  /* slate-200 */
  color: #111827 !important;
  /* gray-900 */
  font-weight: 600 !important;
  /* font-semibold */
}

/* Mobile-specific tab styling for vertical centering */
.md:hidden .tabs-boxed .tab {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0.5rem 1rem !important;
  /* Consistent padding */
  height: 100% !important;
  /* Ensure full height for centering */
}

/* Rest of your existing styles */
.view-container,
.view-section {
  transition: opacity 0.2s ease-in-out;
}

#cards-view .division-match {
  transition: all 0.2s ease-in-out;
}

.round-section {
  transition: all 0.3s ease-in-out;
}

.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 768px) {
  .mobile-hidden {
    display: none;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.view-section:not(.hidden) {
  animation: fadeIn 0.3s ease-out;
}

.status-indicator {
  display: inline-block;
  height: 0.5rem;
  width: 0.5rem;
  border-radius: 9999px;
}

#round-select {
  min-width: 160px;
  padding-right: 2.5rem !important;
  /* Increase padding to make room for arrow */
}

/* Add custom dropdown arrow */
#round-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.75rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
}

/* Tournament bracket CSS */
.tournament-container {
  width: 100%;
  overflow-x: auto;
}

.tournament-headers {
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  border-bottom: 1px solid #ccc;
}

.tournament-headers h3 {
  width: 100%;
  text-align: center;
  font-weight: 500;
  border-right: 1px dashed #ccc;
  margin: 0;
  padding: 1rem;
  font-size: 1rem;
}

.tournament-headers h3:last-child {
  border-right: none;
}

.tournament-brackets {
  display: flex;
  flex-direction: row;
  list-style-type: none;
  background: #fdfdfd;
  margin-bottom: 50px;
}

.bracket {
  padding-left: 0;
  display: flex;
  margin: 0;
  padding: 30px 0;
  flex-grow: 1;
  flex-direction: column;
  justify-content: space-around;
  list-style-type: none;
  border-right: 1px dashed #ccc;
  flex: 1;
  min-width: 240px;
}

.bracket:last-child {
  border-right: none;
}

.team-item {
  background-color: #fff;
  border: 1px solid #e4e4e4;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  padding: 0.5rem 0.75rem;
  margin: 0.75rem auto;
  position: relative;
  vertical-align: middle;
  line-height: 1.2;
  width: 85%;
  max-width: 300px;
}

/* Tabs styling */
.tabs-boxed {
  @apply flex rounded-lg p-1;
}

.tabs-boxed .tab {
  @apply rounded-md py-1 px-3 text-sm transition-colors;
  color: #4b5563 !important;
  /* gray-600 */
}

.tabs-boxed .tab:hover {
  color: #1f2937 !important;
  /* gray-800 */
}

.tabs-boxed .tab-active {
  background-color: #e2e8f0 !important;
  /* slate-200 */
  color: #111827 !important;
  /* gray-900 */
  font-weight: 600 !important;
  /* font-semibold */
}

/* View container transitions */
.view-section {
  transition: opacity 0.2s ease-in-out;
}

.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.team-item:after {
  content: '';
  border-color: #a0a0a0;
  /* Gray connector lines */
  border-width: 0;
  /* Reset all borders */
  border-right: 2px solid #a0a0a0;
  /* Thicker right border */
  position: absolute;
  display: block;
  width: 15px;
  right: -15px;
}

.team-item:nth-of-type(odd):after {
  border-top: 2px solid #a0a0a0;
  /* Thicker top border */
  height: 100%;
  top: 50%;
}

.team-item:nth-of-type(even):after {
  border-bottom: 2px solid #a0a0a0;
  /* Thicker bottom border */
  height: 100%;
  top: -50%;
}

.team-item:before {
  content: '';
  border: 0;
  /* Reset all borders */
  border-top: 2px solid #a0a0a0;
  /* Thicker top border with gray color */
  position: absolute;
  height: 0;
  /* No height needed */
  width: 15px;
  left: -15px;
  top: 50%;
}

/* Bracket connector styling for different round depths */
.bracket-2 .team-item:nth-of-type(odd):after {
  height: 200%;
  top: 50%;
}

.bracket-2 .team-item:nth-of-type(even):after {
  height: 200%;
  top: -150%;
}

.bracket-3 .team-item:nth-of-type(odd):after {
  height: 350%;
  top: 50%;
}

.bracket-3 .team-item:nth-of-type(even):after {
  height: 350%;
  top: -300%;
}

.bracket-4 .team-item:nth-of-type(odd):after {
  height: 700%;
  top: 50%;
}

.bracket-4 .team-item:nth-of-type(even):after {
  height: 700%;
  top: -650%;
}

/* Fix for doubled lines */
.team-item:after,
.team-item:before {
  box-sizing: content-box;
}

.bracket:first-of-type .team-item:before {
  display: none;
}

.bracket:last-of-type .team-item:after {
  display: none;
}

@media (max-width: 768px) {
  .mobile-hidden {
    display: none;
  }

  .tournament-container {
    overflow-x: auto;
    padding-bottom: 20px;
  }

  /* Ensure consistent widths between headers and brackets */
  .tournament-headers h3 {
    width: 240px;
    min-width: 240px;
    flex: 0 0 240px;
    box-sizing: border-box;
    text-align: center;
    word-break: break-word;
    hyphens: auto;
  }

  .bracket {
    width: 240px;
    min-width: 240px;
    flex: 0 0 240px;
    align-items: center;
    background: #fdfdfd;
  }

  .team-item {
    width: 85%;
    margin: 0.75rem auto;
    box-sizing: border-box;
    max-width: 200px;
  }

  /* Ensure the container expands as needed */
  .tournament-headers,
  .tournament-brackets {
    width: max-content !important;
    min-width: auto !important;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.view-section:not(.hidden) {
  animation: fadeIn 0.3s ease-out;
}

/* Tabs styling */
.tabs-boxed {
  @apply flex rounded-lg p-1;
}

.tabs-boxed .tab {
  @apply rounded-md py-1 px-3 text-sm transition-colors;
  color: #4b5563 !important;
  /* gray-600 */
}

.tabs-boxed .tab:hover {
  color: #1f2937 !important;
  /* gray-800 */
}

.tabs-boxed .tab-active {
  background-color: #e2e8f0 !important;
  /* slate-200 */
  color: #111827 !important;
  /* gray-900 */
  font-weight: 600 !important;
  /* font-semibold */
}

.md:hidden .tabs-boxed .tab {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0.5rem 1rem !important;
  height: 100% !important;
}

/* View container styles with transition */
.view-section {
  transition: opacity 0.2s ease-in-out;
}

/* Card view specific transitions */
#cards-view .bg-slate-50 {
  transition: all 0.2s ease-in-out;
}

#cards-view .bg-slate-50:hover {
  background-color: #f1f5f9 !important;
  /* slate-100 */
}

/* Table view transitions */
#table-view .bg-white {
  transition: background-color 0.2s ease-in-out;
}

#table-view .bg-white:hover {
  background-color: #f9fafb !important;
  /* gray-50 */
}

/* List view transitions */
#list-view .text-sm {
  transition: all 0.2s ease-in-out;
}

#list-view .text-sm:hover {
  background-color: #f1f5f9 !important;
  /* slate-100 */
  padding-left: 0.5rem;
}

/* Truncate text with ellipsis */
.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 768px) {
  .mobile-hidden {
    display: none;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.view-section:not(.hidden) {
  animation: fadeIn 0.3s ease-out;
}

.psa-dot {
  width: 12px;
  /* Adjust as needed to match w-3 (Tailwind 0.75rem = 12px) */
  height: 12px;
  border-radius: 9999px;
  /* Fully rounded */
}

.psa-dot-current {
  background-color: #2563EB !important;
  /* Blue for current step */
}

.psa-dot-completed {
  background-color: #10B981 !important;
  /* Green for completed steps */
}

.psa-dot-future {
  background-color: #E5E7EB !important;
  /* Gray for future steps */
}

.psa-dot.transition-colors {
  transition: background-color 300ms ease;
  /* Smooth transition for color changes */
}

/* Dialog styles for document previews */
dialog {
  border: none;
  padding: 0;
  background: transparent;
  width: 100%;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
}

dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.5);
}

dialog[open] {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Modal background */
.modal {
  background-color: rgba(0, 0, 0, 0.5) !important;
}

/* Add specific styling for document preview dialog */
#preview_dialog {
  background-color: rgba(0, 0, 0, 0.5) !important;
  padding: 1rem;
}

#preview_dialog[open] {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 100% !important;
}

/* Fix for preview content */
#document_preview_content {
  border-radius: 0.5rem !important;
  max-width: 95% !important;
  width: auto !important;
  margin: 0 auto !important;
}

@media (min-width: 768px) {
  #document_preview_content {
    max-width: 800px !important;
    width: 90% !important;
  }
}

.rankings-container {
  position: relative;
  min-height: 4.5rem;
  /* Provides some minimum height to prevent layout shifts */
}

.rankings-display {
  position: relative;
}

.ranking-item {
  position: relative;
  margin-bottom: 0.25rem;
  /* Consistent spacing */
}

/* Enhanced tournament bracket styling for placeholder matches */
.team-item.placeholder {
  background-color: #f9fafb;
  border: 1px dashed #e4e4e4;
  opacity: 0.8;
}

.team-item.placeholder:hover {
  background-color: #f1f5f9;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

/* Connection lines for placeholder matches */
.team-item.placeholder:after {
  border-color: #d0d0d0;
  border-style: dashed;
  border-right-style: dashed;
}

.team-item.placeholder:nth-of-type(odd):after {
  border-top-style: dashed;
}

.team-item.placeholder:nth-of-type(even):after {
  border-bottom-style: dashed;
}

.team-item.placeholder:before {
  border-color: #d0d0d0;
  border-style: dashed;
}

/* Improve tournament layout */
.tournament-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow-x: auto;
  padding-bottom: 20px;
  -webkit-overflow-scrolling: touch;
  /* Smooth scrolling on iOS */
  scroll-behavior: smooth;
  /* Smooth scrolling for all browsers */
}

/* Fix for tournament header alignment */
.tournament-headers {
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  /* Change from space-around to flex-start */
  border-bottom: 1px solid #ccc;
  width: max-content;
  /* Ensure it expands as needed */
}

.tournament-headers h3 {
  width: 240px;
  /* Match the exact width of bracket columns */
  min-width: 240px;
  flex: 0 0 240px;
  /* Fixed width, don't grow or shrink */
  text-align: center;
  font-weight: 500;
  border-right: 1px dashed #ccc;
  margin: 0;
  padding: 1rem;
  font-size: 1rem;
  box-sizing: border-box;
}

.tournament-brackets {
  display: flex;
  flex-direction: row;
  list-style-type: none;
  background: #fdfdfd;
  margin-bottom: 50px;
  width: max-content;
  /* Ensure it expands as needed */
}

.bracket {
  padding-left: 0;
  display: flex;
  margin: 0;
  padding: 30px 0;
  flex-direction: column;
  justify-content: space-around;
  list-style-type: none;
  border-right: 1px dashed #ccc;
  width: 240px;
  /* Increased width for follow-on matches */
  min-width: 240px;
  flex: 0 0 240px;
  /* Fixed width, don't grow or shrink */
}

/* Ensure the container expands as needed */
.tournament-container {
  width: 100%;
  overflow-x: auto;
  padding-bottom: 20px;
}

/* Match item styling from your code sample */
.team-item {
  border: 1px solid #e4e4e4;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  margin: 1rem auto;
  width: 85%;
  max-width: 200px;
  /* Increased for follow-on match info */
  background-color: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* Score display styling */
.score-display {
  display: inline-block;
  font-weight: 600;
  min-width: 20px;
  text-align: center;
}

/* Match status badge styling for brackets */
.team-item .flex.justify-between.text-sm {
  margin-bottom: 0.5rem;
}

.team-item .px-2.py-0\.5 {
  font-size: 0.7rem;
  padding: 0.125rem 0.375rem;
}

/* Player name with winner highlight */
.player-name {
  display: inline-block;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.875rem;
  /* Slightly smaller text for better fit */
}

.player-name.winner {
  font-weight: 600;
}

.player-name.loser {
  opacity: 0.6;
}

@media (max-width: 768px) {
  .player-name {
    max-width: 120px;
    /* Smaller max-width on mobile */
    font-size: 0.8125rem;
    /* Even smaller font on mobile */
  }
}

/* Game scores styling */
.game-scores {
  font-family: monospace;
  font-size: 0.75rem;
  color: #666;
  text-align: center;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid #eee;
  line-height: 1.2;
  display: none;
  /* Hidden by default */
}

/* Make only completed matches clickable */
.team-item.completed {
  cursor: pointer;
  transition: all 0.2s ease;
}

.team-item.completed:hover {
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

/* Expanded state styling */
.team-item.expanded {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

/* Visual indicator that the match card is clickable */
.team-item:after {
  content: '';
  /* existing styles */
}

/* Clickable indicator for completed matches */
.team-item.completed::before {
  content: '';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 6px;
  height: 6px;
  background-color: #3498db;
  border-radius: 50%;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.team-item.completed:hover::before {
  opacity: 1;
}

/* app/assets/stylesheets/section_resize.css */

/* Basic section styles */
.section-item {
  transition: transform 0.15s ease, opacity 0.15s ease;
}

/* Styles for sections being dragged */
.section-item.dragging {
  z-index: 50;
}

/* Visual feedback during drag */
.sections-container.drag-active {
  background-color: rgba(59, 130, 246, 0.05);
  border-radius: 0.5rem;
  padding-bottom: 1rem;
}

/* Drag handle styling */
.drag-handle {
  cursor: move;
  cursor: grab;
}

.drag-handle:active {
  cursor: grabbing;
}

/* Resize controls */
.resize-btn {
  font-size: 0.75rem;
  font-weight: 600;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* Style for notifications */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

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

@keyframes fadeOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

.fixed.bottom-4.right-4 {
  animation: fadeInUp 0.3s ease-out forwards;
}

.fixed.bottom-4.right-4.opacity-0 {
  animation: fadeOut 0.5s ease-out forwards;
}

/* Styles for document drag and drop */

/* Draggable documents */
.document-draggable {
  cursor: grab;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  /* Ensure position is set for the pseudo-element */
}

.document-draggable:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

/* Visual indicator that an item is draggable */
.document-draggable::before {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background-color: rgba(59, 130, 246, 0.4);
  border-radius: 50%;
  z-index: 1;
  transition: all 0.2s ease;
}

.document-draggable:hover::before {
  background-color: rgba(59, 130, 246, 0.8);
  transform: scale(1.3);
}

/* Active dragging state */
.document-dragging {
  opacity: 0.7;
  transform: scale(0.96);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
  z-index: 10;
  cursor: grabbing;
  outline: 2px dashed #3b82f6;
}

.document-dragging::before {
  background-color: #3b82f6;
  transform: scale(1.5);
}

/* Folder hover state when dragging over */
.folder-dragover {
  background-color: rgba(59, 130, 246, 0.15);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5);
  transform: scale(1.03);
  transition: all 0.2s ease;
  position: relative;
  z-index: 5;
}

/* Add an animation to make the folder pulse when dragging over */
@keyframes pulse-border {
  0% {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5);
  }

  50% {
    box-shadow: 0 0 0 5px rgba(59, 130, 246, 0.3);
  }

  100% {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5);
  }
}

.folder-dragover {
  animation: pulse-border 1.5s infinite;
}

/* Processing state when moving documents */
.document-processing,
.folder-processing {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}

.document-processing::after,
.folder-processing::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  border: 3px solid rgba(59, 130, 246, 0.2);
  border-radius: 50%;
  border-top: 3px solid rgba(59, 130, 246, 1);
  animation: spin 1s linear infinite;
  z-index: 20;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Calendar highlight pulse animation for focused events */
@keyframes highlight-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
  }
}

.highlight-pulse {
  animation: highlight-pulse 1.5s cubic-bezier(0.455, 0.03, 0.515, 0.955) 2;
  z-index: 10 !important;
  position: relative !important;
}

/* Add an overlay to make it clear the item is being processed */
.document-processing::before,
.folder-processing::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.7);
  z-index: 10;
  border-radius: inherit;
}

/* Drag ghost image styles */
.drag-ghost {
  position: absolute;
  top: -1000px;
  /* Initially hidden */
  left: -1000px;
  width: 100px;
  height: 100px;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25);
  opacity: 0.9;
  transform: rotate(5deg);
  z-index: 9999;
  pointer-events: none;
  border: 2px solid #3b82f6;
}

/* Hide DaisyUI divider in dropdown menus */
.dropdown-content li.divider {
  display: none !important;
}

/* Add some responsive adjustments for smaller screens */
@media (max-width: 640px) {
  .document-draggable:hover {
    transform: none;
    /* Disable hover effects on mobile */
    box-shadow: none;
  }

  .document-dragging {
    opacity: 0.8;
    /* More visible on mobile */
  }

  .folder-dragover {
    transform: scale(1.01);
    /* Smaller scale change on mobile */
  }
}

/* Column drag and drop styles */
.column-handle {
  cursor: grab;
}

.column-handle:active {
  cursor: grabbing;
}

.column-dragging {
  opacity: 0.6;
  box-shadow: 0 0 10px rgba(0, 44, 55, 0.3);
}

.column-drop-left {
  border-left: 3px solid #002C37;
  box-shadow: -4px 0 6px -2px rgba(0, 44, 55, 0.3);
  position: relative;
}

.column-drop-left::before {
  content: '';
  position: absolute;
  top: 0;
  left: -5px;
  width: 10px;
  height: 100%;
  background-color: rgba(0, 44, 55, 0.1);
  z-index: 1;
}

.column-drop-right {
  border-right: 3px solid #002C37;
  box-shadow: 4px 0 6px -2px rgba(0, 44, 55, 0.3);
  position: relative;
}

.column-drop-right::before {
  content: '';
  position: absolute;
  top: 0;
  right: -5px;
  width: 10px;
  height: 100%;
  background-color: rgba(0, 44, 55, 0.1);
  z-index: 1;
}

.column-dragging-active [data-column-id] {
  transition: all 0.2s ease;
}

/* Task drag and drop styles - consolidated and simplified */
.task-card {
  position: relative;
  transition: transform 0.2s ease;
}

.task-card.task-dragging {
  opacity: 0.5;
  transform: scale(0.95);
  cursor: grabbing;
  z-index: 1000;
}

/* Drop indicators with high z-index and clear visibility */
.task-drop-indicator-before::before,
.task-drop-indicator-after::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 4px;
  background-color: #3b82f6;
  border-radius: 2px;
  z-index: 1500 !important;
  /* Even higher z-index */
  pointer-events: none;
}

.task-drop-indicator-before::before {
  top: -2px;
}

.task-drop-indicator-after::after {
  bottom: -2px;
}

/* Column drop target styles */
.column-drop-target {
  background-color: rgba(59, 130, 246, 0.1);
  z-index: 900;
}

.tasks-container-drop-target {
  background-color: rgba(59, 130, 246, 0.05);
  z-index: 900;
}

/* Pulse animation for drop indicators */
@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

/* Hide scrollbar but maintain scroll functionality */
.scrollbar-hide {
  -ms-overflow-style: none;
  /* IE and Edge */
  scrollbar-width: none;
  /* Firefox */
}

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

/* Double Elimination bracket specific styles */
.double-elimination-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Group Stage and Pool Play specific styles */
.group-stage-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Group standings table */
.group-stage-container table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

.group-stage-container th {
  background-color: #f1f5f9;
  font-weight: 600;
  padding: 0.75rem;
  text-align: left;
  color: #1f2937;
  border: 1px solid #e5e7eb;
}

.group-stage-container td {
  padding: 0.75rem;
  border: 1px solid #e5e7eb;
}

.group-stage-container tr:nth-child(1),
.group-stage-container tr:nth-child(2) {
  background-color: #f0fdf4;
  /* Light green for qualified positions */
}

/* Group match cards */
.group-stage-container .grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.group-stage-container .grid>div {
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s, box-shadow 0.2s;
}

.group-stage-container .grid>div:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Make player names stand out in completed matches */
.group-stage-container .font-medium.text-green-700 {
  font-weight: 600;
}

/* Tour Finals specific layout */
.tour-finals-container .group-matches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

/* Round robin match grid */
.round-robin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* Common bracket improvements */
.tournament-container {
  margin-bottom: 3rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  -webkit-overflow-scrolling: touch;
}

/* Consistent bracket column width */
.tournament-headers h3,
.bracket {
  min-width: 240px;
  width: 240px;
  flex: 0 0 240px;
}

/* Better mobile scrolling experience for tournament brackets */
@media (max-width: 768px) {
  .group-stage-container table {
    font-size: 0.75rem;
  }

  .group-stage-container th,
  .group-stage-container td {
    padding: 0.5rem;
  }

  .group-stage-container .grid {
    grid-template-columns: 1fr;
  }

  .tournament-container {
    padding-bottom: 0.5rem;
  }

  .double-elimination-container>div {
    margin-bottom: 2rem;
  }
}

/* Tour Finals specific styling */
.knockout-stage .tournament-container {
  margin-top: 1rem;
  margin-bottom: 2rem;
}

.knockout-stage .tournament-headers h3 {
  font-weight: 600;
  color: #002C37;
}

/* Ensure knockout stage uses the elimination bracket styling */
.knockout-stage .bracket .team-item:after {
  content: '';
  border-color: #a0a0a0;
  border-width: 0;
  border-right: 2px solid #a0a0a0;
  position: absolute;
  display: block;
  width: 15px;
  right: -15px;
}

.knockout-stage .bracket .team-item:nth-of-type(odd):after {
  border-top: 2px solid #a0a0a0;
  height: 100%;
  top: 50%;
}

.knockout-stage .bracket .team-item:nth-of-type(even):after {
  border-bottom: 2px solid #a0a0a0;
  height: 100%;
  top: -50%;
}

.knockout-stage .bracket .team-item:before {
  content: '';
  border: 0;
  border-top: 2px solid #a0a0a0;
  position: absolute;
  height: 0;
  width: 15px;
  left: -15px;
  top: 50%;
}

/* Hide lines on first and last brackets appropriately */
.knockout-stage .bracket:first-of-type .team-item:before {
  display: none;
}

.knockout-stage .bracket:last-of-type .team-item:after {
  display: none;
}

/* Specifically style the Tour Finals knockout bracket for 2-match semi-finals and 1 final */
.group-stage-container .knockout-stage {
  margin-top: 2rem;
  border-top: 1px solid #e5e7eb;
  padding-top: 1rem;
}

/* Fixed table styling for standings across all views */
.tournament-standings-table {
  width: 100% !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  margin-bottom: 1rem !important;
  font-size: 0.875rem !important;
  border: 1px solid #e9ecef !important;
  /* Lighter border color */
  border-radius: 0.5rem !important;
  overflow: hidden !important;
}

/* Ensure all views have the same border styles */
#list-view .tournament-standings-table,
#table-view .tournament-standings-table,
#bracket-view .tournament-standings-table,
.group-stage-container .tournament-standings-table,
.bracket-view .tournament-standings-table,
#cards-view .tournament-standings-table {
  border: 1px solid #e9ecef !important;
  /* Lighter border color */
  border-radius: 0.5rem !important;
}

.tournament-standings-table th {
  background-color: #f8f9fa !important;
  font-weight: 600 !important;
  padding: 0.5rem 0.75rem !important;
  text-align: center !important;
  color: #1f2937 !important;
  border: 1px solid #e9ecef !important;
  /* Lighter border color */
}

.tournament-standings-table td {
  padding: 0.5rem 0.75rem !important;
  text-align: center !important;
  border: 1px solid #e9ecef !important;
  /* Lighter border color */
  transition: all 0.2s ease-in-out !important;
}

.tournament-standings-table tr:hover td {
  background-color: #f1f5f9 !important;
}

/* Override any view-specific borders */
#list-view .tournament-standings-table th,
#table-view .tournament-standings-table th,
#bracket-view .tournament-standings-table th,
.group-stage-container .tournament-standings-table th,
.bracket-view .tournament-standings-table th,
#cards-view .tournament-standings-table th {
  border: 1px solid #e9ecef !important;
  /* Lighter border color */
}

#list-view .tournament-standings-table td,
#table-view .tournament-standings-table td,
#bracket-view .tournament-standings-table td,
.group-stage-container .tournament-standings-table td,
.bracket-view .tournament-standings-table td,
#cards-view .tournament-standings-table td {
  border: 1px solid #e9ecef !important;
  /* Lighter border color */
}

/* Reset any border-0 classes that might be overriding borders */
.tournament-standings-table th.border-0,
.tournament-standings-table td.border-0 {
  border: 1px solid #e9ecef !important;
  /* Lighter border color */
}

/* Add styling for qualified positions that works across all views */
tr.qualified-position td {
  background-color: #f0fdf4 !important;
}

tr.qualified-position:hover td {
  background-color: #dcfce7 !important;
}

@media (max-width: 768px) {
  .tournament-standings-table {
    font-size: 0.75rem;
  }

  .tournament-standings-table th,
  .tournament-standings-table td {
    padding: 0.4rem 0.5rem;
  }
}