/**
 * Logo formatting utilities
 * Ensures logos are properly centered and formatted without empty space
 */

.team-logo {
  object-fit: contain;
  object-position: center;
  width: 100%;
  height: 100%;
}

.team-logo-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Match row logo styles */
.match-logo-small {
  width: 24px;
  height: 24px;
  object-fit: contain;
  object-position: center;
}

.match-logo-medium {
  width: 32px;
  height: 32px;
  object-fit: contain;
  object-position: center;
}

.match-logo-large {
  width: 48px;
  height: 48px;
  object-fit: contain;
  object-position: center;
}

/* Ensure SVGs don't have extra padding and fit properly in circular containers */
.team-logo svg,
.match-logo-small svg,
.match-logo-medium svg,
.match-logo-large svg {
  width: 100%;
  height: 100%;
  display: block;
  max-width: 100%;
  max-height: 100%;
}

/* SVG logos - proper object-fit to handle optimized viewBox */
.logo svg,
[class*="match-logo"] svg {
  object-fit: contain;
  object-position: center;
}

/* Specific styles for circular logo containers */
img[style*="border-radius: 50%"],
img[style*="borderRadius: full"],
.borderRadius-full img {
  object-fit: contain !important;
}

/* Circular containers - optimized viewBox means minimal padding */
.circular-logo-container img {
  padding: 3px;
  box-sizing: border-box;
}

/* Match widget specific styles */
.match-widget-logo {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.match-widget-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Upcoming matches hero styles */
.next-match-logo {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 8px;
}

.next-match-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* Table logo styles */
.table-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  object-position: center;
}

/* Ensure proper centering in flex containers */
.logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0; /* Allow flex shrinking */
}

/* Loading placeholder */
.logo-loading {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s ease-in-out infinite;
  border-radius: 4px;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Fix for SVG logos being cut off in circular containers */
.circular-logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.circular-logo-container img {
  object-fit: contain !important;
  max-width: 80% !important;
  max-height: 80% !important;
  width: auto !important;
  height: auto !important;
}


/* Chakra UI Image component with borderRadius="full" */
.chakra-image[data-border-radius="full"] {
  object-fit: contain !important;
  padding: 4px !important;
}

/* Override for specific logo sizes in circular containers */
.match-logo-small[style*="border-radius"],
.match-logo-medium[style*="border-radius"],
.match-logo-large[style*="border-radius"] {
  object-fit: contain !important;
  padding: 2px !important;
  box-sizing: border-box !important;
}
