/* Players Page Styles - Modern Card Layout */

.players-section {
    padding: 0;
    min-height: calc(100vh - 200px);
    background: linear-gradient(180deg, #f0f4f8 0%, #ffffff 100%);
}

.players-section > .container {
    max-width: 900px;
    padding: 0 1rem;
}

/* Hero Header */
.players-hero {
    background: linear-gradient(135deg, #1a3a5c 0%, #2B5A9E 50%, #4A90E2 100%);
    padding: 3rem 1.5rem 2.5rem;
    text-align: center;
    margin-bottom: 0;
    position: relative;
    overflow: hidden;
}

.players-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 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='%23ffffff' fill-opacity='0.03'%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");
    opacity: 0.5;
}

.players-hero h1 {
    font-size: 2.5rem;
    color: white;
    margin: 0 0 0.5rem 0;
    font-weight: 700;
    position: relative;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-subtitle {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.1rem;
    margin: 0;
    position: relative;
}

/* Toolbar - Search and Sort */
.players-toolbar {
    background: white;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 0;
    z-index: 10;
}

.players-toolbar > * {
    flex-shrink: 0;
}

.search-wrapper {
    width: 300px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 1rem;
    color: #888;
    font-size: 1rem;
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 2.75rem;
    border: 2px solid #e8e8e8;
    border-radius: 25px;
    font-size: 0.95rem;
    transition: all 0.2s;
    background: #f8f9fa;
}

.search-input:focus {
    outline: none;
    border-color: #2B5A9E;
    background: white;
    box-shadow: 0 0 0 3px rgba(43, 90, 158, 0.1);
}

.search-input::placeholder {
    color: #aaa;
}

.clear-search-btn {
    position: absolute;
    right: 0.75rem;
    background: #ddd;
    border: none;
    color: #666;
    font-size: 0.75rem;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.clear-search-btn:hover {
    background: #ccc;
    color: #333;
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-label {
    color: #666;
    font-size: 0.85rem;
    font-weight: 500;
}

.sort-btn {
    padding: 0.5rem 0.85rem;
    border: 2px solid #e8e8e8;
    border-radius: 20px;
    background: white;
    color: #555;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.sort-btn:hover {
    border-color: #2B5A9E;
    color: #2B5A9E;
}

.sort-btn.active {
    background: linear-gradient(135deg, #2B5A9E 0%, #4A90E2 100%);
    color: white;
    border-color: transparent;
}

.sort-arrow {
    font-size: 0.7rem;
    opacity: 0.7;
}

.sort-btn.active .sort-arrow {
    opacity: 1;
}

/* Player Count */
.players-count {
    padding: 1rem 0.25rem 0.75rem;
    color: #666;
    font-size: 0.85rem;
}

#count-number {
    font-weight: 700;
    color: #2B5A9E;
}

/* Players List */
.players-grid {
    display: flex;
    flex-direction: column;
    margin-bottom: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

/* Player Row */
.player-card {
    background: white;
    padding: 0.875rem 1.25rem;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid #f0f0f0;
}

.player-card:last-child {
    border-bottom: none;
}

.player-card:hover {
    background: #f8fafc;
}

.player-card:active {
    background: #f0f4f8;
}

/* Rank Number */
.player-rank {
    min-width: 32px;
    color: #999;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    flex-shrink: 0;
}

.player-rank.top-3 {
    color: #2B5A9E;
    font-weight: 700;
}

/* Player Avatar */
.player-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2B5A9E 0%, #4A90E2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    flex-shrink: 0;
    text-transform: uppercase;
}

/* Player Info */
.player-info {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.player-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 120px;
}

.player-card:hover .player-name {
    color: #2B5A9E;
}

.player-ratings {
    display: flex;
    gap: 1.5rem;
    flex-shrink: 0;
}

.rating-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 80px;
}

.rating-label {
    font-size: 0.7rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: 600;
}

.rating-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: #333;
}

.rating-value.empty {
    color: #ccc;
}

/* View Profile Arrow */
.player-arrow {
    color: #ccc;
    font-size: 1.2rem;
    transition: all 0.2s;
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.player-card:hover .player-arrow {
    color: #2B5A9E;
    transform: translateX(3px);
}

/* No Results */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
}

.no-results-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.no-results-text {
    font-size: 1.5rem;
    color: #444;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.no-results-subtext {
    font-size: 1rem;
    color: #888;
}

/* Loading */
.loading-message {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e8e8e8;
    border-top-color: #2B5A9E;
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 0.8s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .players-hero {
        padding: 2rem 1rem 1.75rem;
    }

    .players-hero h1 {
        font-size: 1.8rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    .players-toolbar {
        padding: 1rem;
        gap: 1rem;
    }

    .search-wrapper {
        width: 100%;
        order: 1;
    }

    .sort-controls {
        order: 2;
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 0.25rem;
        -webkit-overflow-scrolling: touch;
    }

    .sort-label {
        display: none;
    }

    .players-count {
        padding: 1rem 1rem 0.75rem;
    }

    .player-card {
        padding: 0.875rem 1rem;
    }

    .player-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }

    .player-ratings {
        gap: 1rem;
    }

    .rating-item {
        min-width: auto;
    }

    .player-arrow {
        display: none;
    }
}

@media (max-width: 480px) {
    .players-hero h1 {
        font-size: 1.5rem;
    }

    .hero-subtitle {
        font-size: 0.85rem;
    }

    .sort-btn {
        padding: 0.45rem 0.7rem;
        font-size: 0.75rem;
    }

    .players-count {
        padding: 1rem 0.75rem 0.75rem;
    }

    .players-grid {
        border-radius: 10px;
    }

    .player-card {
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .player-rank {
        min-width: 26px;
        font-size: 0.8rem;
    }

    .player-avatar {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }

    .player-name {
        font-size: 0.9rem;
    }

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

    .rating-value {
        font-size: 0.85rem;
    }
}
