/* ============================
   CLEAN PLAYERS PAGE CSS
   No conflicts, just what's needed
   ============================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700;800&display=swap');

/* Animated gradient keyframes */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {

        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Page Container - fixed background photo with dark overlay (same style as Opponents page) */
.players-page {
    min-height: 100vh;
    margin: 0;
    background-color: #00152b;
    background-image:
        linear-gradient(rgba(0, 10, 30, 0.72), rgba(0, 10, 30, 0.82)),
        url('../images/1939cup2.jpg');
    background-size: cover;
    background-position: center 30%;
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: #ffffff;
    font-family: 'Inter', sans-serif;
}




.page {
    max-width: 650px;
    margin: 20px auto;
    padding: 20px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    background: rgba(0, 21, 43, 0.35);
    backdrop-filter: blur(2px);
}


/* Header Section - text only, no background image, matches .page container width/border */
.players-header {
    text-align: center;
    padding: 40px 20px;
    max-width: 650px;
    margin: 20px auto 0;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    background: rgba(0, 21, 43, 0.35);
    backdrop-filter: blur(2px);
    box-sizing: border-box;
}



.players-header h1 {
    font-size: 28px;
    font-weight: 400;
    margin: 0 0 10px 0;
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.players-header .tagline {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    font-weight: 400;
}

/* Search Controls */
.search-controls {
    max-width: 600px;
    margin: 0 auto 30px;
    padding: 0 20px;
}

/* Back to Home Button */
.pr-nav-btn {
    background: #0057b8;
    color: #fff;
    padding: 8px 20px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s ease-in-out;
    display: inline-block;
}

.pr-nav-btn:hover {
    background: #003f8a;
    color: #ffffff;
    text-decoration: none;
}

.back-btn {
    background: #0057b8;
    border-radius: 20px;
}

.back-btn:hover {
    background: #003f8a;
}

.search-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

#playerSearch {
    width: 100%;
    max-width: 500px;
    padding: 14px 20px;
    font-size: 1rem;
    border: 2px solid #0057b8;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.95);
    color: #000;
}

#resultCount {
    font-size: 0.9rem;
    color: #b3d9ff;
    font-weight: 600;
    text-align: center;
}

/* Search Mode Toggle Switch */
.search-mode-switch {
    position: relative;
    display: flex;
    width: 280px;
    height: 44px;
    background: rgba(0, 21, 43, 0.6);
    border: 2px solid rgba(0, 87, 184, 0.5);
    border-radius: 22px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
}

.search-mode-switch:hover {
    border-color: rgba(0, 87, 184, 0.8);
    box-shadow: 0 0 15px rgba(0, 87, 184, 0.3);
}

.switch-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(179, 217, 255, 0.5);
}

.switch-option.active {
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.switch-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: calc(50% - 6px);
    height: calc(100% - 6px);
    background: linear-gradient(135deg, #0057b8, #003d8a);
    border-radius: 18px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.search-mode-switch.fullname-mode .switch-slider {
    left: calc(50% + 3px);
    background: linear-gradient(135deg, #ffc107, #ff9800);
}

.search-mode-switch.fullname-mode .switch-option[data-mode="fullname"] {
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.search-mode-switch.fullname-mode .switch-option[data-mode="surname"] {
    color: rgba(179, 217, 255, 0.5);
}

.search-mode-switch:not(.fullname-mode) .switch-option[data-mode="surname"] {
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.filter-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-row select {
    padding: 10px 14px;
    font-size: 0.95rem;
    border: 2px solid #0057b8;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.95);
    color: #000;
    cursor: pointer;
}

/* Featured Legends */
.featured-legends {
    max-width: 500px;
    margin: 0 auto 40px;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.legend-card {
    background: linear-gradient(135deg, rgba(0, 87, 184, 0.3), rgba(0, 61, 138, 0.3));
    border: 2px solid rgba(255, 217, 102, 0.3);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

/* Faded/watermark background photo for legend tiles that have a player image */
.legend-card.has-bg-photo {
    background-color: rgba(0, 61, 138, 0.4);
    background-size: cover;
    background-position: center 15%;
    background-repeat: no-repeat;
}

.legend-card.has-bg-photo::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 21, 43, 0.55) 0%, rgba(0, 21, 43, 0.8) 55%, rgba(0, 21, 43, 0.92) 100%);
    z-index: 0;
}

.legend-card-inner {
    position: relative;
    z-index: 1;
}

.legend-card:hover {
    transform: translateY(-4px);
    border-color: #ffd966;
    box-shadow: 0 8px 20px rgba(255, 217, 102, 0.2);
}

.legend-card h3 {
    font-size: 0.9rem;
    color: #b3d9ff;
    margin: 0 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.legend-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 8px 0;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

.legend-stat {
    font-size: 1.5rem;
    font-weight: 800;
    color: #ffd966;
    margin: 0;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

/* Player Grid */
.player-card-view {
    max-width: 500px;
    margin: 0 auto;
    padding: 0 20px 40px;
}

.player-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.player-card {
    background: linear-gradient(135deg, rgba(0, 87, 184, 0.2), rgba(0, 61, 138, 0.2));
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.player-card:hover {
    transform: translateY(-6px);
    border-color: #ffd966;
    box-shadow: 0 8px 24px rgba(255, 217, 102, 0.3);
}

.player-photo-card {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin: 0 auto 15px;
    border: 3px solid #0057b8;
    overflow: hidden;
}

.player-photo-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.player-initials-card {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0057b8, #003d8a);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 2rem;
    margin: 0 auto 15px;
    border: 3px solid #ffd966;
}

.card-player-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 10px 0;
}

.card-stats {
    display: flex;
    justify-content: space-around;
    margin: 15px 0;
    padding: 15px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.card-stat-value {
    font-size: 1.3rem;
    font-weight: 800;
    color: #ffd966;
}

.card-stat-label {
    font-size: 0.75rem;
    color: #b3d9ff;
    text-transform: uppercase;
}

.card-career {
    font-size: 0.9rem;
    color: #b3d9ff;
}

.pos-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.pos-badge.pos-gk {
    background: #4caf50;
    color: #ffffff;
    border: 1px solid #4caf50;
}

.pos-badge.pos-df {
    background: #f44336;
    color: #ffffff;
    border: 1px solid #f44336;
}

.pos-badge.pos-mf {
    background: #2196f3;
    color: #000000;
    border: 1px solid #2196f3;
}

.pos-badge.pos-fw {
    background: #ff9800;
    color: #000000;
    border: 1px solid #ff9800;
}

/* Loading */
.loading-spinner {
    text-align: center;
    padding: 60px 20px;
    color: #b3d9ff;
    font-size: 1.1rem;
}

/* Footer */
.footer-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    text-align: center;
    background: rgba(0, 0, 40, 0.55);
    color: #ffffff;
    padding: 16px 0;
    font-size: 15px;
    font-weight: 700;
    border-top: 1px solid rgba(255,255,255,0.25);
    z-index: 999;
}

/* Player Panel Photo Disk (larger than player cards) */
.player-photo-disc {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid rgba(255,255,255,0.3);
    flex-shrink: 0;
    margin: 0 auto 15px auto;
}

.player-photo-disc img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.player-photo-disc.initials {
    background: linear-gradient(135deg, #0057b8, #003d8a);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 2.5rem;
}

/* Career Highlights Cards */
.highlights-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.highlight-item {
    background: linear-gradient(135deg, rgba(255, 217, 102, 0.15) 0%, rgba(255, 217, 102, 0.05) 100%);
    border: 1px solid rgba(255, 217, 102, 0.3);
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    transition: all 0.2s ease;
}

.highlight-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 217, 102, 0.2);
    border-color: rgba(255, 217, 102, 0.5);
}

.highlight-label {
    font-size: 0.7rem;
    color: #ffd966;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    font-weight: 600;
}

.highlight-value {
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 4px;
    line-height: 1.2;
}

.highlight-detail {
    font-size: 0.75rem;
    color: #a8b8d8;
    font-weight: 500;
}

/* Mobile */
@media (max-width: 768px) {
    .featured-legends {
        grid-template-columns: 1fr;
    }
    
    .player-grid {
        grid-template-columns: 1fr;
    }
    
    .highlights-grid {
        grid-template-columns: 1fr;
    }
}

/* Career Statistics Section - Add margin below heading and padding at bottom */
.stat-card h3 {
    margin-bottom: 15px;
}

.stat-card {
    margin-bottom: 20px;
    padding-bottom: 15px;
}
