/* Path: /src/styles/leaderboard.css */
/* Enhanced styles for Masters Golf Sweepstakes */

/* Master Tournament Colors */
:root {
  --masters-green: #006747;
  --masters-dark-green: #003829;
  --masters-gold: #FBDB65;
  --light-green: #d1fae5;
  --light-gray: #f9fafb;
  --medium-gray: #6b7280;
  --dark-gray: #4b5563;
  --error-red: #ef4444;
  --amber: #fbbf24;
  --light-blue: #dbeafe;
  --border-radius: 0.5rem;
  --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --hover-shadow: 0 15px 20px -5px rgba(0, 0, 0, 0.15);
  --transition: all 0.3s ease;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.animate-fadeIn {
  animation: fadeIn 0.3s ease-in-out;
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* Custom Styles */
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--masters-green);
  color: #333;
  line-height: 1.6;
}

/* Status colors */
.completed, .text-completed {
  color: var(--masters-green);
}

.inprogress, .text-inprogress {
  color: var(--amber);
}

.waiting, .text-waiting {
  color: var(--medium-gray);
}

.cut, .text-cut {
  color: var(--error-red);
}

.ongreen, .text-ongreen {
  color: var(--masters-green);
}

.withdrawn, .text-withdrawn {
  color: var(--error-red);
}

/* Improved Score Circle */
.score-circle {
  position: relative;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 24px;
  height: 24px;
}

.score-circle.under-par::before {
  content: "";
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--masters-green);
}

.score-value {
  position: relative;
  z-index: 1;
  font-weight: 600;
}

/* Points badges */
.points-badge {
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.75rem;
  transition: var(--transition);
}

.points-exceptional {
  background-color: var(--masters-gold);
  color: var(--masters-dark-green);
  box-shadow: 0 0 10px rgba(251, 219, 101, 0.3);
}

.points-strong {
  background-color: var(--light-green);
  color: var(--masters-green);
}

.points-earned {
  background-color: var(--light-blue);
  color: #1e40af;
}

.points-none {
  background-color: var(--light-gray);
  color: var(--medium-gray);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .md\:flex-row {
    flex-direction: row;
  }
  
  .md\:grid-cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .sm\:grid-cols-2 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
  
  .px-4 {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}
@media (max-width: 640px) {
  .leaderboard-table th:first-child,
  .leaderboard-table td:first-child {
    width: 40px;
    padding-left: 8px;
    padding-right: 8px;
  }
  
  .leaderboard-table th,
  .leaderboard-table td {
    padding: 8px 4px;
  }
  
  .leaderboard-table button {
    padding: 4px 8px;
    font-size: 14px;
  }
}
/* Add these styles to your CSS file for better mobile optimization with more readable fonts */

/* Mobile optimizations */
@media (max-width: 640px) {
  /* Make table more compact on mobile but keep font readable */
  .leaderboard-table th,
  .leaderboard-table td {
    padding: 0.5rem 0.25rem;
    font-size: 0.925rem; /* Increased from 0.875rem */
  }
  
  /* Make rank column narrower */
  .leaderboard-table th:first-child,
  .leaderboard-table td:first-child {
    width: 2.25rem; /* Slightly wider */
    padding-left: 0.375rem; /* Slightly more padding */
    padding-right: 0.25rem;
  }
  
  /* Make button slightly larger */
  .leaderboard-table button {
    padding: 0.375rem 0.625rem; /* Increased padding */
    font-size: 0.825rem; /* Increased from 0.75rem */
  }
  
  /* Adjust fonts to be more readable */
  .text-xl {
    font-size: 1.15rem;
  }
  
  .text-lg {
    font-size: 1.05rem;
  }
  
  .text-sm {
    font-size: 0.925rem; /* Increased from default */
  }
  
  .text-xs {
    font-size: 0.8rem; /* Increased from default */
  }
  
  /* Make golfer cards more compact but keep text readable */
  .golfer-card .p-3 {
    padding: 0.625rem;
  }
  
  /* Adjust round cards */
  .round {
    padding: 0.625rem 0.375rem;
  }
  
  /* Adjust spacing in expanded details */
  .space-y-4 {
    margin-top: 0.625rem;
  }
  
  .space-y-4 > * + * {
    margin-top: 0.625rem;
  }
  
  /* Make headers slightly larger */
  h1 {
    font-size: 1.625rem;
  }
  
  h2 {
    font-size: 1.375rem;
  }
}

/* Smaller screens but not tiny */
@media (max-width: 480px) {
  .leaderboard-table th,
  .leaderboard-table td {
    padding: 0.5rem 0.25rem;
    font-size: 0.875rem; /* Slightly smaller than the 640px breakpoint */
  }
  
  .truncate {
    max-width: 140px;
  }
}

/* Extremely small screens */
@media (max-width: 360px) {
  .leaderboard-table th,
  .leaderboard-table td {
    padding: 0.375rem 0.25rem;
    font-size: 0.825rem; /* Increased from 0.75rem */
  }
  
  .truncate {
    max-width: 120px;
  }
}

/* Add this class to entrant names for better truncation */
.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


@keyframes goldShine {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.gold-shine {
  background: linear-gradient(
    120deg, 
    #ffd700 0%, 
    #f8e187 25%, 
    #ffd700 50%, 
    #f8e187 75%, 
    #ffd700 100%
  );
  background-size: 200% 100%;
  animation: goldShine 2s ease-in-out infinite;
  border-color: #b8860b;
  color: #7d5a00;
  text-shadow: 0 0 2px rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 6px rgba(218, 165, 32, 0.6);
}
@keyframes legendaryGlow {
  0% {
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.8), 0 0 10px rgba(255, 215, 0, 0.5);
    border-color: rgba(255, 215, 0, 0.8);
  }
  50% {
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.9), 0 0 20px rgba(255, 215, 0, 0.7);
    border-color: rgba(255, 185, 0, 0.9);
  }
  100% {
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.8), 0 0 10px rgba(255, 215, 0, 0.5);
    border-color: rgba(255, 215, 0, 0.8);
  }
}

@keyframes legendaryBackground {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.legendary-score {
  background: linear-gradient(
    to right, 
    #ffe259, 
    #ffa751, 
    #ff8c66, 
    #ff6b6b, 
    #cc6bff, 
    #8c9eff, 
    #64b5f6, 
    #4fc3f7, 
    #4dd0e1, 
    #4db6ac, 
    #81c784, 
    #aed581
  );
  background-size: 400% 100%;
  animation: 
    legendaryBackground 4s ease infinite,
    legendaryGlow 2s ease-in-out infinite;
  
  color: white;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.7);
  font-weight: bold;
  border: 2px solid gold;
  position: relative;
  z-index: 1;
}

@keyframes twinkle {
  0%, 100% { opacity: 0; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* Legendary gold card styling for 300+ points */
.legendary-gold-card {
  background: linear-gradient(to bottom right, #d4af37, #f5e7c1, #d4af37);
  border: 1px solid #d4af37;
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
  position: relative;
  overflow: hidden;
}

/* Subtle gloss animation that passes over every 3 seconds */
.legendary-gold-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -150%;
  width: 80%;
  height: 100%;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.1) 40%,
    rgba(255, 255, 255, 0.2) 50%,
    rgba(255, 255, 255, 0.1) 60%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: skewX(-20deg);
  animation: shine 3s infinite;
  z-index: 1;
  pointer-events: none;
}

@keyframes shine {
  0% {
    left: -150%;
  }
  100% {
    left: 150%;
  }
}

/* Style the header on gold card */
.legendary-gold-card .golfer-header {
  background-color: rgba(255, 255, 255, 0.2);
  border-bottom: 1px solid rgba(212, 175, 55, 0.3);
  position: relative;
  z-index: 2;
}

/* Text colors for gold card */
.legendary-gold-card .golfer-name,
.legendary-gold-card .round-header,
.legendary-gold-card .round-body,
.legendary-gold-card .font-medium,
.legendary-gold-card .font-semibold {
  color: #5e4813;
}

.legendary-gold-card .text-gray-500,
.legendary-gold-card .text-sm {
  color: #5e4813;
}

/* Round cards inside gold card */
.legendary-gold-card .round-card,
.legendary-gold-card .flex-1 > div,
.legendary-gold-card .grid-cols-2 > div {
  background-color: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(212, 175, 55, 0.3);
  position: relative;
  z-index: 2;
}

/* The rainbow score effect - with fixes for appearing in the gold card */
.legendary-score {
  background: linear-gradient(
    to right, 
    #ffe259, 
    #ffa751, 
    #ff8c66, 
    #ff6b6b, 
    #cc6bff, 
    #8c9eff, 
    #64b5f6, 
    #4fc3f7, 
    #4dd0e1, 
    #4db6ac, 
    #81c784, 
    #aed581
  );
  background-size: 400% 100%;
  animation: legendaryBackground 4s ease infinite;
  
  color: white !important;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.7) !important;
  font-weight: bold !important;
  border: 2px solid gold;
  position: relative;
  z-index: 3;
  isolation: isolate;
  mix-blend-mode: normal;
}

/* Add specific styles for the rainbow badge when inside gold card */
.legendary-gold-card .legendary-score {
  position: relative;
  z-index: 5; /* Ensure it's above everything */
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.3); /* Add shadow to separate from gold background */
}

/* Make sure badges inside round cards display correctly */
.round-card .legendary-score,
.flex-1 > div .legendary-score,
.grid-cols-2 > div .legendary-score {
  color: white !important; /* Force white text */
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.7) !important; /* Add text shadow for better visibility */
  position: relative;
  z-index: 5;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.3); /* Add shadow to separate from background */
  display: inline-block; /* Ensure it maintains its shape */
}

/* Fix nested rainbow badges in gold cards */
.legendary-gold-card .round-card .legendary-score {
  position: relative;
  z-index: 6; /* Even higher z-index to ensure it's on top */
  border: 1px solid white; /* Add a white border for contrast */
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.4); /* Stronger shadow */
}

@keyframes legendaryBackground {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

