/* Leaderboard CSS - Consolidated from all sources
   Includes all leaderbox, podium, loading, empty state, and responsive styles
   Migrated from clubhouse-styles.css, styles.css, and responsive.css
*/

/* Leaderboard container styling */
.leaderboard-container {
    position: relative;
    width: 100%;
    margin: 0 auto 50px auto;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-end;
    height: 450px;
    flex-wrap: wrap;
    gap: 35px;
    max-width: 1900px;
}

/* Base leaderbox styling */
.leaderbox {
    position: relative;
    width: 320px;
    min-height: 360px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    overflow: visible;
    transition: all 0.3s ease;
    margin: 0 15px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 20px 15px;
    box-sizing: border-box;
    text-align: center;
    background: rgba(0,0,0,0.4);
    border: 2px solid transparent;
}

/* Empty position styling for leaderboard */
.leaderbox.empty-position {
    opacity: 0.75;
    background-color: rgba(35, 35, 35, 0.8);
    border-style: solid;
    border-width: 3px;
}
.leaderbox.first-place.empty-position { border-color: #FFD700; }
.leaderbox.second-place.empty-position { border-color: #C0C0C0; }
.leaderbox.third-place.empty-position { border-color: #CD7F32; }

.empty-position-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.15);
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
}
.empty-position-icon i {
    font-size: 32px;
    color: #caee00;
    opacity: 0.7;
}
.angler-name.position-open {
    color: #caee00;
    opacity: 0.8;
    font-style: italic;
}
.encouragement-message {
    color: #fff;
    opacity: 0.8;
    font-style: italic;
    font-size: 14px;
    text-align: center;
    display: block;
    margin-top: 10px;
}

.leaderbox:hover .photo-cell-leaderboard {
    transform: scale(1.18) rotate(-7deg) translateZ(0); /* HW accel hint */
    box-shadow: 0 8px 20px rgba(0,0,0,0.35);
}

/* Photo cell styling */
.photo-cell-leaderboard {
    position: absolute;
    top: -50px; /* Position above the box */
    left: -25px; /* Position to hang off the left edge */
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    z-index: 10;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;    
    will-change: transform, box-shadow;
    transform: scale(1) rotate(0deg) translateZ(0); /* Explicit initial state + HW accel hint */
    transition: transform 0.4s ease, box-shadow 0.3s ease;
}

.angler-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.angler-initials {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 36px;
    font-weight: bold;
    color: #fff;
}

/* Place and name cell styling */
.place-name-cell {
    width: 100%;
    text-align: center;
    margin-top: 10px; /* Reduced space since photo is now in corner */
    padding-left: 0; /* Remove left padding to ensure perfect centering */
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Place rank styling */
.place-name-cell .rank {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 10px;
    text-transform: uppercase;
    color: #000;
}

/* Angler name styling */
.place-name-cell .angler-name {
    font-size: 32px;
    font-weight: bold;
    margin: 10px 0 20px 0;
    text-transform: uppercase;
    color: #000;
}

/* Points details styling */
.points-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    text-align: center;
    width: 100%;
    margin-top: 10px;
}

.points-details span {
    font-size: 16px;
    color: #000;
    font-weight: normal;
    text-align: center;
    font-family: Helvetica, Arial, sans-serif;
    margin: 5px 0;
}

.points-details span.cup-points {
    font-weight: bold;
    color: #000;
}

.points-separator {
    width: 80%;
    border-bottom: 2px dotted #000000;
    margin: 5px 0 10px 0;
}

.points-details span strong {
    font-size: 16px;
    font-weight: bold;
    color: #000;
    font-family: Helvetica, Arial, sans-serif;
}

/* First place styling */
.first-place {
    border: 3px solid #FFD700;
    width: 325px;
    height: 400px;
    order: 2;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.9), rgba(255, 176, 0, 0.3));
    z-index: 3;
    box-shadow: 1px 1px 0px rgba(0, 0, 0, 0.75);
}
.first-place::after {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: 
        linear-gradient(135deg, transparent 45%, rgba(255, 255, 255, 0.5) 50%, transparent 55%),
        linear-gradient(135deg, transparent 45%, rgba(255, 215, 0, 0.3) 50%, transparent 55%);
    background-size: 12px 12px;
    background-position: 0 0;
    z-index: -1;
    animation: scale-shimmer 0.5s infinite linear;
}
@keyframes scale-shimmer {
    0% { background-position: 0 0, 6px 6px; opacity: 0.3; }
    50% { opacity: 0.7; }
    100% { background-position: 12px 12px, 18px 18px; opacity: 0.3; }
}

.first-place .photo-cell-leaderboard {
    border: 1px solid gold;
    transition: border-width 0.2s ease;
}

.first-place .photo-cell-leaderboard:hover {
    border-width: 3px;
}

.first-place .sparkle {
    pointer-events: none;
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at 60% 30%, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0) 80%),
              radial-gradient(circle at 30% 70%, rgba(255,255,200,0.5) 0%, rgba(255,255,200,0) 70%);
    opacity: 0.7;
    animation: sparkleFade 2s infinite linear;
    z-index: 20;
    border-radius: 10px;
}

@keyframes sparkleFade {
    0%,100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* Second place styling */
.second-place {
    border: 3px solid #C0C0C0;
    width: 310px;
    height: 360px;
    order: 1;
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.9), rgba(169, 169, 169, 0.3));
    z-index: 2;
    box-shadow: 1px 1px 0px rgba(0, 0, 0, 0.75);
}

.second-place .photo-cell-leaderboard {
    border: 1px solid silver;
    transition: border-width 0.2s ease;
}

.second-place .photo-cell-leaderboard:hover {
    border-width: 3px;
}

/* Third place styling */
.third-place {
    border: 3px solid #CD7F32;
    width: 310px;
    height: 200;
    order: 3;
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.9), rgba(184, 115, 51, 0.1));
    z-index: 1;
    box-shadow: 1px 1px 0px rgba(0, 0, 0, 0.75);
}


.third-place .photo-cell-leaderboard {
    border: 1px solid #cd7f32;
    transition: border-width 0.2s ease;
}

.third-place .photo-cell-leaderboard:hover {
    border-width: 3px;
}

/* Remove trophy icon styling */
.trophy-icon {
    display: none;
}

/* Enhanced Hover & Animation for Leaderboard Boxes */
.leaderbox:hover {
    box-shadow: 0 0 40px 10px #caee00, 0 5px 15px rgba(0,0,0,0.3);
    transform: scale(1.06);
    z-index: 10;
}

.leaderbox:active {
    transform: scale(1.02);
}

/* Animated angler thumbnail border on hover */
.photo-cell-leaderboard:hover {
    animation: borderPulse 0.5s;
    box-shadow: 0 0 20px 8px #caee00;
}



/* --- Place-specific Glow for Leaderboard Boxes --- */
.leaderbox.first-place:hover {
  box-shadow: 0 0 40px 10px gold, 0 5px 15px rgba(0,0,0,0.3);
}
.leaderbox.second-place:hover {
  box-shadow: 0 0 40px 10px silver, 0 5px 15px rgba(0,0,0,0.3);
}
.leaderbox.third-place:hover {
  box-shadow: 0 0 40px 10px #cd7f32, 0 5px 15px rgba(0,0,0,0.3); /* bronze */
}

/* --- Place-specific Angler Photo Borders --- */
.first-place .photo-cell-leaderboard {
  border: 3px solid gold;
}
.second-place .photo-cell-leaderboard {
  border: 3px solid silver;
}
.third-place .photo-cell-leaderboard {
  border: 3px solid #cd7f32; /* bronze */
}

/* --- Angler Photo Twist Animation on Hover --- */
.photo-cell-leaderboard:hover .angler-photo {
  animation: twistPhoto 0.5s cubic-bezier(.36,1.56,.64,1) both;
}
@keyframes twistPhoto {
  0% { transform: rotateY(0deg) scale(1); }
  40% { transform: rotateY(20deg) scale(1.08); }
  60% { transform: rotateY(-20deg) scale(1.08); }
  80% { transform: rotateY(10deg) scale(1.03); }
  100% { transform: rotateY(0deg) scale(1); }
}

/* Media queries for responsive design */
@media screen and (max-width: 768px) {
    .leaderboard-container {
        flex-direction: column;
        align-items: center;
        height: auto;
        gap: 20px; /* Reduced space between stacked leaderboxes for mobile */
        padding-top: 30px; /* Add space at the top for the first photo */
    }
    
    .leaderbox {
        width: 90% !important; /* Make boxes wider on mobile */
        max-width: 320px;
        margin: 30px 0 !important; /* Adjust margins for stacked layout */
        height: auto !important; /* Let height be determined by content */
        min-height: 300px; /* Set minimum height */
        padding-bottom: 20px; /* Ensure enough padding at bottom */
    }
    
}

/* Leaderboard Medal Container - Always visible and positioned correctly */
.leaderboard-medal-container {
    position: absolute;
    top: 0;
    right: 0;
    width: 3.5rem;
    height: 3.5rem;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    pointer-events: none;
    z-index: 200;
}

.leaderboard-medal {
    font-size: 2rem;
    line-height: 1.5;
    margin: 0;
    padding: 0;
}

/* Ensure all leaderboxes are visible on mobile */
@media (max-width: 768px) {
    .first-place, .second-place, .third-place {
        display: flex !important;
    }
    .photo-cell-leaderboard {
        top: -40px;
        left: -10px;
        transform: none;
        width: 100px;
        height: 100px;
    }
    .rank {
        font-size: 24px !important;
    }
    .angler-name {
        font-size: 22px !important;
        margin: 5px 0 10px 0 !important;
    }
    .points-details span {
        font-size: 14px !important;
    }
    .leaderbox.second-place { order: 2; }
    .leaderbox.first-place { order: 1; }
    .leaderbox.third-place { order: 3; }
}
