/**
 * Coach Players Page Styles
 * تصميم صفحة "لاعبي"
 */

/* ========================================
   Main Container
======================================== */
.apm-coach-players {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* ========================================
   Header Section
======================================== */
.apm-players-header {
    margin-bottom: 2rem;
}

.apm-players-header h2 {
    font-size: 2rem;
    color: #1a202c;
    margin-bottom: 1.5rem;
}

/* ========================================
   Stats Summary
======================================== */
.apm-stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-item {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    color: white;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    opacity: 0.9;
}

/* ========================================
   Filters Container
======================================== */
.apm-filters-container {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.apm-filters-container h3 {
    margin: 0 0 1.5rem 0;
    color: #1a202c;
    font-size: 1.3rem;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.filter-group label {
    display: block;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.filter-select,
.filter-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
    background: white;
}

.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.filter-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
}

.filter-btn.apply {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.filter-btn.apply:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.filter-btn.reset {
    background: #e2e8f0;
    color: #2d3748;
}

.filter-btn.reset:hover {
    background: #cbd5e0;
}

.results-count {
    margin-left: auto;
    padding: 0.75rem 1.25rem;
    background: #f0f6fc;
    border-radius: 8px;
    font-weight: 600;
    color: #2d3748;
}

.player-row-hidden {
    display: none !important;
}

/* ========================================
   Players Table
======================================== */
.apm-table-wrapper {
    overflow-x: auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.apm-players-table {
    width: 100%;
    border-collapse: collapse;
}

.apm-players-table th {
    background: #f7fafc;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #2d3748;
    border-bottom: 2px solid #e2e8f0;
}

.apm-players-table td {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.apm-players-table tr:hover {
    background: #f7fafc;
}

/* Table Columns */
.rank-col { width: 80px; text-align: center; }
.name-col { min-width: 200px; }
.team-col { width: 150px; }
.level-col { width: 120px; }
.points-col { width: 100px; text-align: center; }
.status-col { width: 120px; text-align: center; }
.actions-col { width: 200px; text-align: center; }

/* ========================================
   Rank Badges
======================================== */
.rank-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 1.1rem;
}

.rank-first { background: #ffd700; color: #000; }
.rank-second { background: #c0c0c0; color: #000; }
.rank-third { background: #cd7f32; color: #fff; }

/* ========================================
   Player Info
======================================== */
.player-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.player-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.player-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
}

.player-name {
    font-weight: 600;
    color: #2d3748;
}

/* ========================================
   Team Badge
======================================== */
.team-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    background: #e6f3ff;
    color: #0066cc;
}

/* ========================================
   Level & Status Badges
======================================== */
.level-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    background: #edf2f7;
    color: #2d3748;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-active { background: #c6f6d5; color: #22543d; }
.status-inactive { background: #fed7d7; color: #742a2a; }
.status-pending { background: #feebc8; color: #7c2d12; }

/* ========================================
   Points Display
======================================== */
.points-display {
    cursor: help;
    transition: transform 0.2s;
    position: relative;
}

.points-display:hover {
    transform: scale(1.05);
}

.total-points {
    font-weight: 700;
    font-size: 1.2rem;
    transition: color 0.3s;
}

.monthly-points {
    font-size: 0.75rem;
    color: #718096;
    margin-top: 2px;
}

/* Points Tooltip */
.points-display[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(26, 32, 44, 0.95);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    white-space: pre-line;
    font-size: 0.85rem;
    line-height: 1.5;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    margin-bottom: 8px;
    min-width: 200px;
    text-align: left;
}

.points-display[title]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(26, 32, 44, 0.95);
    margin-bottom: 2px;
}

/* ========================================
   Action Buttons
======================================== */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: #edf2f7;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 1rem;
}

.btn-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.btn-delete:hover {
    background: #fed7d7;
}

/* ========================================
   Empty State
======================================== */
.apm-no-players {
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: 12px;
}

.apm-btn-add {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: transform 0.2s;
}

.apm-btn-add:hover {
    transform: translateY(-2px);
}

/* ========================================
   Messages
======================================== */
.apm-success-message {
    background: #d4edda;
    color: #155724;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid #c3e6cb;
}

.apm-error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid #f5c6cb;
}

/* ========================================
   Responsive Design
======================================== */
@media (max-width: 1400px) {
    .filters-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .apm-stats-summary {
        grid-template-columns: 1fr;
    }
    
    .filters-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .results-count {
        margin-left: 0;
        text-align: center;
    }
    
    .apm-table-wrapper {
        overflow-x: scroll;
    }
}
