/**
 * AFL Team Comparison Tool - Custom Styles
 * Enhanced styling beyond Tailwind CSS for team-specific branding and animations
 */

:root {
  /* AFL Team Colors - Primary */
  --adelaide-primary: #003366;
  --adelaide-secondary: #FFD200;
  --brisbane-primary: #A6192E;
  --brisbane-secondary: #FFC72C;
  --carlton-primary: #0E1E2E;
  --carlton-secondary: #FFFFFF;
  --collingwood-primary: #000000;
  --collingwood-secondary: #FFFFFF;
  --essendon-primary: #CC2E2A;
  --essendon-secondary: #000000;
  --fremantle-primary: #2E1065;
  --fremantle-secondary: #FFFFFF;
  --geelong-primary: #1E3A5F;
  --geelong-secondary: #FFFFFF;
  --goldcoast-primary: #FFD700;
  --goldcoast-secondary: #CC2E2A;
  --gws-primary: #FF6600;
  --gws-secondary: #1A1A1A;
  --hawthorn-primary: #4A2C17;
  --hawthorn-secondary: #FFD700;
  --melbourne-primary: #CC2E2A;
  --melbourne-secondary: #0E1E2E;
  --northmelbourne-primary: #1E3A5F;
  --northmelbourne-secondary: #FFFFFF;
  --portadelaide-primary: #00B2A0;
  --portadelaide-secondary: #000000;
  --richmond-primary: #FFD700;
  --richmond-secondary: #000000;
  --stkilda-primary: #CC2E2A;
  --stkilda-secondary: #000000;
  --sydney-primary: #CC2E2A;
  --sydney-secondary: #FFFFFF;
  --westcoast-primary: #FFD700;
  --westcoast-secondary: #1E3A5F;
  --westernbulldogs-primary: #CC2E2A;
  --westernbulldogs-secondary: #1E3A5F;
}

/* Custom Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
  }
  50% {
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.6);
  }
}

/* Team Card Enhanced Styling */
.team-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.team-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.team-card:hover::before {
  opacity: 1;
}

.team-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.team-card-selected {
  animation: pulse-glow 2s infinite;
  transform: translateY(-2px);
}

.team-card-selected::after {
  content: '✓';
  position: absolute;
  top: 8px;
  right: 8px;
  background: #059669;
  color: white;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
}

/* Team Logo Enhancements */
.team-logo {
  transition: all 0.3s ease;
  position: relative;
}

.team-logo:hover {
  transform: scale(1.1) rotate(5deg);
}

.team-logo::after {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(45deg, var(--team-primary, #3b82f6), var(--team-secondary, #1d4ed8));
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.team-card:hover .team-logo::after {
  opacity: 0.2;
}

/* Comparison Table Enhancements */
.comparison-table {
  animation: fadeInUp 0.6s ease-out;
}

.comparison-row:hover {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.05) 0%, rgba(59, 130, 246, 0.02) 100%);
  transform: scale(1.01);
  transition: all 0.2s ease;
}

.days-badge {
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.days-badge:hover {
  transform: scale(1.05);
}

.days-badge::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transition: left 0.6s ease;
}

.days-badge:hover::before {
  left: 100%;
}

/* Reference Link Styling */
.reference-link {
  position: relative;
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) no-repeat;
  background-size: 0% 1px;
  background-position: bottom left;
  transition: background-size 0.3s ease;
}

.reference-link:hover {
  background-size: 100% 1px;
}

/* Loading States */
.loading-shimmer {
  background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

.dark .loading-shimmer {
  background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
  background-size: 200% 100%;
}

/* Glass Effect Enhancements */
.glass-effect {
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.dark .glass-effect {
  background: rgba(17, 24, 39, 0.8);
  border: 1px solid rgba(75, 85, 99, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Mobile Optimizations */
@media (max-width: 640px) {
  .team-card {
    padding: 0.75rem;
  }
  
  .team-logo {
    width: 2.5rem;
    height: 2.5rem;
  }
  
  .comparison-table {
    font-size: 0.875rem;
  }
  
  .days-badge {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
  }
}

/* Dark Mode Specific Enhancements */
.dark .team-card:hover {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.dark .comparison-row:hover {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.1) 0%, rgba(99, 102, 241, 0.05) 100%);
}

/* Accessibility Enhancements */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus States */
.team-card:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.reference-link:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
  border-radius: 0.25rem;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .team-card {
    border-width: 2px;
  }
  
  .days-badge {
    border: 1px solid currentColor;
  }
  
  .glass-effect {
    background: rgba(255, 255, 255, 0.95);
  }
  
  .dark .glass-effect {
    background: rgba(17, 24, 39, 0.95);
  }
}

/* Print Styles */
@media print {
  .glass-effect {
    background: white;
    backdrop-filter: none;
    box-shadow: none;
  }
  
  .team-card {
    box-shadow: none;
    border: 1px solid #000;
  }
  
  .days-badge {
    background: transparent !important;
    color: #000 !important;
    border: 1px solid #000;
  }
}

/* Custom Scrollbar */
.comparison-section::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.comparison-section::-webkit-scrollbar-track {
  background: rgba(156, 163, 175, 0.1);
  border-radius: 4px;
}

.comparison-section::-webkit-scrollbar-thumb {
  background: rgba(156, 163, 175, 0.3);
  border-radius: 4px;
}

.comparison-section::-webkit-scrollbar-thumb:hover {
  background: rgba(156, 163, 175, 0.5);
}

.dark .comparison-section::-webkit-scrollbar-thumb {
  background: rgba(75, 85, 99, 0.5);
}

.dark .comparison-section::-webkit-scrollbar-thumb:hover {
  background: rgba(75, 85, 99, 0.7);
}

/* Never Achieved Events Styling */
.event-never {
  /* Enhanced visual treatment for events that never occurred */
  background: rgb(248, 250, 252);
  color: rgb(100, 116, 139);
  border: 1px dashed rgb(203, 213, 225);
  transition: all 0.2s ease-in-out;
}

.event-never:hover {
  background: rgb(241, 245, 249);
  border-color: rgb(148, 163, 184);
  transform: translateY(-1px);
}

.dark .event-never {
  background: rgba(30, 41, 59, 0.3);
  color: rgb(148, 163, 184);
  border-color: rgb(71, 85, 105);
}

.dark .event-never:hover {
  background: rgba(30, 41, 59, 0.5);
  border-color: rgb(100, 116, 139);
}

/* Responsive improvements for mobile */
@media (max-width: 640px) {
  .event-never {
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
  }
  
  .event-never span {
    margin-right: 0.125rem;
  }
}

/* Accessibility improvements */
.event-never:focus {
  outline: 2px solid rgb(59, 130, 246);
  outline-offset: 2px;
}

/* Print styles for never-achieved events */
@media print {
  .event-never {
    background: transparent !important;
    color: #666 !important;
    border: 1px dashed #999;
  }
}