/* Modern Player Card Design */

/* Reset accordion button styles for custom design */
.modern-player-card .accordion-button {
    background: none;
    border: none;
    padding: 0;
    width: 100%;
    text-align: left;
    color: inherit;
    box-shadow: none;
    display: block;
}

.modern-player-card .accordion-button.player-card-toggle {
    width: auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 0 0 auto;
    position: relative;
}

.modern-player-card .accordion-button:focus {
    box-shadow: none;
}

.modern-player-card .accordion-button::after {
    margin-left: 0;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

.modern-player-card .accordion-button.player-card-toggle::after {
    position: static;
    right: auto;
    top: auto;
    transform: none;
    margin-left: 0.75rem;
}

.modern-player-card .accordion-button.player-card-toggle .player-stats-modern {
    margin-right: 0;
}

/* Modern Card Container */
.modern-player-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.modern-player-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

.modern-player-card.top-performer {
    border: 2px solid #ffd700;
    background: linear-gradient(135deg, #fffdf7 0%, #ffffff 100%);
}

/* Card Content Layout */
.player-card-content {
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    justify-content: space-between;
}

/* Player Left Section Container */
.player-left-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1 1 auto;
    min-width: 0;
    position: relative;
}

/* Player Avatar Section */
.player-avatar-section {
    position: relative;
    flex-shrink: 0;
}

.player-avatar-modern {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    object-fit: cover;
    border: 3px solid #f0f0f0;
    background: #f8f9fa;
}

.top-performer .player-avatar-modern {
    border-color: #ffd700;
}

.medal-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ffd700;
    color: #000;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Player Info Section */
.player-info-modern {
    flex: 0 1 auto;
    min-width: 0;
}

.player-name-modern {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0;
}

.player-pdga-number {
    margin-top: 0.25rem;
    font-size: 0.875rem;
}

/* Force PDGA badge to new line within player-name-modern */
.player-name-modern .pdga-badge-modern {
    display: block;
    width: fit-content;
    margin-top: 0.25rem;
}

.pdga-badge-modern {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.5rem;
    background: #e3f2fd;
    border: 1px solid #2196f3;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #1976d2;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    z-index: 10;
}

.pdga-badge-modern:hover {
    background: #bbdefb;
    color: #1565c0;
    transform: translateY(-1px);
}

.pdga-badge-modern img {
    height: 14px;
    width: auto;
}

/* Stats Section */
.player-stats-modern {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex: 0 0 auto;
    margin-left: auto;
    margin-right: 2.5rem; /* Space for the chevron */
    justify-content: flex-end;
    min-width: 320px; /* Ensure consistent width for alignment */
}

/* Place Display */
.place-display {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    font-size: 1.125rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-left: auto;
    margin-right: 15px;
    flex-shrink: 0;
}

/* Special treatment for top 3 */
.place-display.place-1,
.place-display.place-2,
.place-display.place-3 {
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.place-display.place-1 {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #000;
}

.place-display.place-2 {
    background: linear-gradient(135deg, #c0c0c0, #e0e0e0);
    color: #000;
}

.place-display.place-3 {
    background: linear-gradient(135deg, #cd7f32, #da9c56);
    color: #fff;
}

/* Remove trophy emoji - the colored badges are enough */

/* Handle tied places */
.place-display.tied::after {
    content: "T";
    position: absolute;
    top: -4px;
    left: -4px;
    font-size: 0.625rem;
    font-weight: 700;
    background: #dc3545;
    color: white;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Ordinal suffix */
.place-ordinal {
    font-size: 0.5rem;
    vertical-align: super;
    margin-left: 1px;
    font-weight: 400;
    opacity: 0.8;
}

.stat-item-modern {
    text-align: center;
    flex: 0 0 auto;
}

/* Specific widths for each stat type */
.stat-item-modern:nth-child(1) { /* Rating */
    width: 110px;
}

.stat-item-modern:nth-child(2) { /* Score */
    width: 70px;
}

.stat-item-modern:nth-child(3) { /* Winnings */
    width: 90px;
}

.stat-label-modern {
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.stat-value-modern {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1a1a;
}

/* Rating Pill */
.rating-pill {
    display: inline-flex;
    align-items: baseline;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-weight: 600;
    background: #e8f5e9;
    color: #2e7d32;
    min-width: 85px;
    justify-content: center;
}

.rating-pill.rating-great {
    background: #e8f5e9;
    color: #2e7d32;
}

.rating-pill.rating-good {
    background: #e3f2fd;
    color: #1976d2;
}

.rating-pill.rating-neutral {
    background: #f5f5f5;
    color: #616161;
}

.rating-pill.rating-below {
    background: #fff3e0;
    color: #f57c00;
}

.rating-pill.rating-poor {
    background: #ffebee;
    color: #c62828;
}

.rating-diff {
    font-size: 0.875rem;
    font-weight: 500;
    opacity: 0.8;
}

/* Score Display */
.score-display-modern {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.125rem;
}

.score-display-modern.score-under {
    background: #e8f5e9;
    color: #2e7d32;
}

.score-display-modern.score-even {
    background: #f5f5f5;
    color: #616161;
}

.score-display-modern.score-over {
    background: #ffebee;
    color: #c62828;
}

/* Winnings Display */
.winnings-display {
    color: #2e7d32;
    font-weight: 700;
}

.winnings-display.no-winnings {
    color: #9e9e9e;
}

/* No Buy-in Pill */
.no-buyin-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    background: #f5f5f5;
    color: #757575;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    .player-card-content {
        padding: 1rem;
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .player-avatar-modern {
        width: 56px;
        height: 56px;
    }

    .player-left-section {
        flex: 1 1 100%;
        width: 100%;
    }

    .player-info-modern {
        flex: 1 1 auto;
    }

    .player-name-modern {
        font-size: 1rem;
    }

    .player-stats-modern {
        width: 100%;
        justify-content: space-between;
        gap: 1rem;
        margin-top: 0.75rem;
        margin-right: 0; /* Reset right margin on mobile */
        padding-top: 0.75rem;
        border-top: 1px solid #f0f0f0;
    }

    .stat-item-modern {
        flex: 1;
    }

    .stat-value-modern {
        font-size: 1.125rem;
    }

    .rating-pill {
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem;
    }

    .score-display-modern {
        height: 2rem;
        min-width: 2rem;
        font-size: 1rem;
    }

    .place-display {
        min-width: 40px;
        height: 40px;
        font-size: 1.125rem;
    }

}

@media (max-width: 480px) {
    .player-card-content {
        padding: 0.875rem;
    }

    .player-avatar-modern {
        width: 48px;
        height: 48px;
        border-radius: 12px;
    }

    .player-stats-modern {
        gap: 0.75rem;
    }

    .stat-label-modern {
        font-size: 0.5625rem;
    }

    .pdga-badge-modern {
        font-size: 0.6875rem;
        padding: 0.125rem 0.375rem;
        margin-top: 0.25rem;
    }

    .pdga-badge-modern img {
        height: 12px;
    }
}

/* Dark Mode Support */
[data-bs-theme="dark"] {
    .modern-player-card {
        background: #1e293b;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }

    .modern-player-card:hover {
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    }

    .modern-player-card.top-performer {
        background: linear-gradient(135deg, #2a2a2a 0%, #1e293b 100%);
    }

    .player-avatar-modern {
        border-color: #334155;
    }

    .player-name-modern {
        color: #e2e8f0;
    }

    .pdga-badge-modern {
        background: #1e3a5f;
        border-color: #2563eb;
        color: #60a5fa;
    }

    .pdga-badge-modern:hover {
        background: #1e4976;
        color: #93bbfc;
    }

    .stat-label-modern {
        color: #94a3b8;
    }

    .stat-value-modern {
        color: #e2e8f0;
    }

    .player-stats-modern {
        border-top-color: #334155;
    }

    .rating-pill {
        filter: brightness(0.8);
    }

    .score-display-modern {
        filter: brightness(0.8);
    }

    .no-buyin-pill {
        background: #334155;
        color: #94a3b8;
    }

    /* Place display dark mode */

    .place-display {
        color: #e2e8f0;
    }

    .place-display.place-1 {
        background: linear-gradient(135deg, #b8860b, #daa520);
        box-shadow: 0 3px 8px rgba(218, 165, 32, 0.3);
    }

    .place-display.place-2 {
        background: linear-gradient(135deg, #71797e, #a8a9ad);
    }

    .place-display.place-3 {
        background: linear-gradient(135deg, #804a00, #b87333);
    }

    .place-display.tied::after {
        background: #dc3545;
    }
}
