/* ========================================
   PLAYERS PAGE - LBL Fantasy
   ======================================== */

/* Hero Section */
.players-hero {
    padding: 160px 0 60px;
    background: linear-gradient(180deg, #121212 0%, #1a1a1a 100%);
    position: relative;
    overflow: hidden;
    border-bottom: 3px solid var(--basket-orange);
}

.players-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23F37021' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.players-hero-content {
    text-align: center;
    position: relative;
    z-index: 1;
}

.players-hero-title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 700;
    color: var(--text-primary);
    margin: 1rem 0;
    line-height: 0.9;
    text-transform: uppercase;
    font-style: italic;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.players-hero-title .highlight {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    padding-right: 0.1em;
}

.players-hero-subtitle {
    font-family: 'Oswald', sans-serif;
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 300;
}

/* Filters Section */
.filters-section {
    background: var(--bg-secondary);
    padding: 2rem 0;
    border-bottom: 1px solid var(--border-color);
}

.filters-bar {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.filter-select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: var(--font-body);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239ca3af' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    min-width: 160px;
    transition: all 0.2s ease;
}

.filter-select:hover,
.filter-select:focus {
    border-color: var(--accent-primary);
    outline: none;
}

.position-buttons {
    display: flex;
    gap: 0.5rem;
}

.pos-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.65rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 50px;
}

.pos-btn:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.pos-btn.active {
    background: var(--gradient-primary);
    border-color: transparent;
    color: white;
}

.filter-search {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: var(--font-body);
    min-width: 240px;
    transition: all 0.2s ease;
}

.filter-search::placeholder {
    color: var(--text-muted);
}

.filter-search:hover,
.filter-search:focus {
    border-color: var(--accent-primary);
    outline: none;
}

.results-info {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Players Main Grid */
.players-main {
    padding: 3rem 0 5rem;
    background: var(--bg-primary);
    min-height: 60vh;
}

.players-grid-5 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
}

/* Player Card Styling */
.player-card-v2 {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.player-card-v2:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 20px 40px -15px rgba(255, 107, 53, 0.2);
}

.player-card-header {
    position: relative;
    height: 140px;
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.player-card-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

.player-card-v2:hover .player-card-header::before {
    opacity: 0.5;
}

.player-avatar-lg {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 1;
    background: var(--bg-tertiary);
}

.player-avatar-lg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.player-position-badge {
    /* Removed absolute positioning */
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.player-price-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    /* Tighter placement */
    font-family: var(--font-display);
    font-size: 1.2rem;
    /* Smaller to avoid overlap */
    font-weight: 800;
    color: #F37021;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
    z-index: 5;
}

.player-card-body {
    padding: 0.75rem;
    /* Reduced padding to maximize content width */
}

.player-name-lg {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-team-name {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.team-logo-sm {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    object-fit: contain;
}

.player-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    width: 100%;
    padding-top: 0.5rem;
    border-top: 2px solid rgba(255, 255, 255, 0.1);
}

.stat-item {
    text-align: center;
    width: 100%;
    min-width: 0;
}


.stat-value {
    font-family: var(--font-display);
    font-size: 0.8rem !important;
    /* Even smaller as requested */
    font-weight: 700;
    line-height: 1.1;
    color: #ffffff !important;
    /* Force visible white */
    display: block;
    margin-bottom: 2px;
}

.stat-label {
    font-size: 0.5rem;
    /* Micro label */
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

/* Secondary stats row */
.player-stats-row.secondary {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

.player-stats-row.secondary .stat-value {
    font-size: 0.75rem !important;
    color: var(--text-secondary);
}

/* Highlight for Fantasy Points */
.stat-item.highlight .stat-value {
    font-size: 0.8rem !important;
    color: #F37021 !important;
    /* LBL Orange instead of gradient */
    background: none !important;
    -webkit-text-fill-color: #F37021 !important;
}

.stat-item.highlight .stat-label {
    color: var(--accent-primary);
}

/* Loading State */
.loading-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 5rem 2rem;
}

.loading-spinner {
    font-size: 4rem;
    animation: bounce 1s ease-in-out infinite;
    margin-bottom: 1rem;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

.loading-state p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 5rem 2rem;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-muted);
}

/* Responsive */
/* Responsive - Force 5 columns until mobile */
@media (max-width: 1024px) {
    /* Keep 5 columns even on smaller desktops/tablets as requested by user ("no more no less") */
    /* Only go to 2 columns on strictly mobile screens */
}

@media (max-width: 768px) {
    .filters-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 1.5rem;
    }

    .filter-select,
    .filter-search {
        width: 100%;
    }

    /* On actual mobile phones, 5 columns is unusable, so we must break it down, 
       but for iPad/Laptop we keep 5 */
    .players-grid-5 {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .player-card-header {
        height: 120px;
    }

    .player-avatar-lg {
        width: 80px;
        height: 80px;
    }
}

@media (max-width: 480px) {
    .players-grid-5 {
        grid-template-columns: 1fr;
    }
}

/* Enhanced Borders */
.filters-section {
    background: var(--bg-secondary);
    padding: 2rem 0;
    border-bottom: 2px solid var(--basket-orange);
    /* Stronger border */
    box-shadow: 0 4px 20px rgba(243, 112, 33, 0.1);
    /* Subtle glow */
    position: relative;
    z-index: 10;
}

.player-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    /* Clearer separator */
}

/* ========================================
   PLAYER COMPARISON FEATURE
   ======================================== */

/* Compare Bar */
.compare-bar {
    background: linear-gradient(180deg, #1a1a1a 0%, #252525 100%);
    border-bottom: 2px solid var(--basket-orange);
    padding: 1rem 0;
    position: sticky;
    top: 70px;
    z-index: 100;
}

.compare-bar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.compare-slots {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.compare-slot {
    background: rgba(255, 255, 255, 0.05);
    border: 2px dashed rgba(243, 112, 33, 0.3);
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    min-width: 180px;
    text-align: center;
    transition: all 0.3s ease;
}

.compare-slot.filled {
    border-style: solid;
    border-color: var(--basket-orange);
    background: rgba(243, 112, 33, 0.1);
}

.compare-slot .slot-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.compare-slot .slot-name {
    display: block;
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 600;
}

.vs-badge {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--basket-orange);
    text-shadow: 0 0 10px rgba(243, 112, 33, 0.5);
}

.compare-actions {
    display: flex;
    gap: 0.75rem;
}

.compare-btn {
    background: var(--gradient-ember);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.compare-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.compare-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(243, 112, 33, 0.4);
}

.clear-btn {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-family: var(--font-display);
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Player Card Compare Button */
.player-card.compare-selected {
    border: 2px solid var(--basket-orange);
    box-shadow: 0 0 20px rgba(243, 112, 33, 0.3);
}

.compare-checkbox {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.compare-checkbox:hover {
    border-color: var(--basket-orange);
}

.compare-checkbox.checked {
    background: var(--basket-orange);
    border-color: var(--basket-orange);
}

.compare-checkbox.checked::after {
    content: '✓';
    color: white;
    font-size: 14px;
    font-weight: bold;
}

/* Comparison Modal */
.comparison-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.comparison-modal.active {
    display: flex;
}

.comparison-modal-content {
    background: linear-gradient(180deg, #1a1a1a 0%, #252525 100%);
    border: 1px solid rgba(243, 112, 33, 0.3);
    border-radius: 16px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 2rem;
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: var(--basket-orange);
}

.comparison-title {
    font-family: var(--font-display);
    font-size: 2rem;
    text-align: center;
    color: var(--text-primary);
    margin-bottom: 2rem;
    text-transform: uppercase;
}

/* Comparison Players Header - Enhanced */
.comparison-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
    align-items: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(243, 112, 33, 0.1) 0%, transparent 50%, rgba(243, 112, 33, 0.1) 100%);
    border-radius: 16px;
    border: 1px solid rgba(243, 112, 33, 0.2);
}

.comparison-player {
    text-align: center;
    padding: 1rem;
}

.comparison-player-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    border: 4px solid var(--basket-orange);
    box-shadow: 0 0 30px rgba(243, 112, 33, 0.3);
    transition: all 0.3s ease;
}

.comparison-player:hover .comparison-player-photo {
    transform: scale(1.05);
    box-shadow: 0 0 40px rgba(243, 112, 33, 0.5);
}

.comparison-player-name {
    font-family: var(--font-display);
    font-size: 1.6rem;
    color: var(--text-primary);
    font-weight: 700;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
}

.comparison-player-meta {
    color: var(--text-muted);
    font-size: 0.9rem;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    align-items: center;
}

.comparison-vs {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--basket-orange);
    text-shadow: 0 0 20px rgba(243, 112, 33, 0.5);
    animation: vs-pulse 2s ease-in-out infinite;
}

@keyframes vs-pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* Stats Comparison Table */
/* Comparison Stats Table - Enhanced */
.comparison-stats {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-row {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 1rem;
    align-items: center;
    padding: 1rem 1.25rem;
    background: linear-gradient(90deg, rgba(243, 112, 33, 0.05) 0%, transparent 50%, rgba(243, 112, 33, 0.05) 100%);
    border-radius: 10px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.stat-row:hover {
    background: linear-gradient(90deg, rgba(243, 112, 33, 0.1) 0%, rgba(255, 255, 255, 0.03) 50%, rgba(243, 112, 33, 0.1) 100%);
    border-color: rgba(243, 112, 33, 0.2);
    transform: scale(1.01);
}

.stat-row:nth-child(even) {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0%, transparent 50%, rgba(255, 255, 255, 0.03) 100%);
}

.stat-value {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    text-align: center;
    transition: all 0.3s ease;
    min-width: 80px;
    color: #ffffff;
}

.stat-value.winner {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.4) 0%, rgba(76, 175, 80, 0.25) 100%);
    color: #ffffff;
    border: 2px solid rgba(76, 175, 80, 0.6);
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.3);
}

.stat-value.loser {
    background: rgba(244, 67, 54, 0.25);
    color: #ffffff;
    border: 1px solid rgba(244, 67, 54, 0.4);
}

.stat-value.tie {
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

.comparison-modal .stat-label {
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--basket-orange);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 0.5rem;
    background: rgba(243, 112, 33, 0.1);
    border-radius: 6px;
}

/* Verdict Section - Enhanced */
.comparison-verdict {
    margin-top: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(243, 112, 33, 0.15) 0%, rgba(243, 112, 33, 0.05) 100%);
    border: 2px solid rgba(243, 112, 33, 0.4);
    border-radius: 16px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.comparison-verdict::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(243, 112, 33, 0.1) 0%, transparent 60%);
    animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {

    0%,
    100% {
        opacity: 0.5;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

.verdict-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--basket-orange);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    position: relative;
}

.verdict-text {
    color: var(--text-primary);
    font-size: 1.2rem;
    position: relative;
}

.verdict-winner {
    font-weight: 700;
    font-size: 1.4rem;
    color: #66bb6a;
    text-shadow: 0 0 20px rgba(76, 175, 80, 0.5);
}

/* Score Counter */
.score-counter {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.score-item {
    text-align: center;
}

.score-name {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.score-value {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
}

.score-value.leading {
    color: #66bb6a;
    text-shadow: 0 0 20px rgba(76, 175, 80, 0.5);
}

.score-value.trailing {
    color: #ef5350;
}

/* Stat Categories Divider */
.stat-category {
    font-family: var(--font-display);
    font-size: 0.75rem;
    color: var(--basket-orange);
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: center;
    padding: 0.5rem 1rem;
    margin: 1rem 0 0.5rem;
    border-bottom: 1px solid rgba(243, 112, 33, 0.3);
}

@media (max-width: 768px) {
    .compare-bar-content {
        flex-direction: column;
        gap: 1rem;
    }

    .compare-slots {
        flex-wrap: wrap;
        justify-content: center;
    }

    .comparison-header {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .comparison-vs {
        order: -1;
    }

    .stat-row {
        grid-template-columns: 1fr 1.5fr 1fr;
        padding: 0.75rem;
    }

    .stat-value {
        font-size: 1.1rem;
        padding: 0.4rem 0.6rem;
        min-width: 60px;
    }

    .stat-label {
        font-size: 0.65rem;
    }
}

/* Ensure all stats are visible */
.player-card-body {
    overflow: visible !important;
    height: auto !important;
    min-height: 220px;
    /* Ensure space for stats */
}

/* Results Info & Toggle */
.results-info {
    display: flex;
    justify-content: space-between;
    /* Push toggle to right */
    align-items: center;
    padding: 0.5rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    /* Separator */
    margin-top: 1rem;
}

.grid-toggle-btn {
    background: none;
    border: none;
    color: var(--basket-orange);
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.3s ease;
    padding: 0.5rem;
    line-height: 1;
}

.grid-toggle-btn:hover {
    color: #fff;
    transform: scale(1.1);
}

.grid-toggle-btn.rotated {
    transform: rotate(180deg);
}

/* Minimized State */
.players-main.minimized {
    display: none;
}