/* Styles pour la page des joueurs en ligne */

.online-players-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.online-players-container h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.8em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.player-count {
    font-size: 0.7em;
    color: #7f8c8d;
    font-weight: normal;
}

/* Icônes */
.icon-online::before { content: "🟢"; }
.icon-user::before { content: "👤"; }
.icon-class::before { content: "⚔️"; }
.icon-level::before { content: "📈"; }
.icon-job::before { content: "💼"; }
.icon-guild::before { content: "🏰"; }
.icon-map::before { content: "🗺️"; }
.icon-info::before { content: "ℹ️"; }
.icon-warning::before { content: "⚠️"; }

/* Filtres */
.online-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.search-input, .filter-select {
    padding: 8px 12px;
    border: 2px solid #bdc3c7;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.search-input {
    flex: 1;
    min-width: 200px;
}

.search-input:focus, .filter-select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

.filter-select {
    min-width: 150px;
}

/* Tableau responsive */
.table-responsive {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.online-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    margin-bottom: 0;
}

.online-table thead {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: #ffffff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

.online-table th {
    padding: 15px 10px;
    text-align: left;
    font-weight: 700;
    border-bottom: 3px solid #1a252f;
    position: relative;
    color: #ffffff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    font-size: 14px;
}

.online-table th.sortable {
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.online-table th.sortable:hover {
    background-color: rgba(255,255,255,0.15);
    box-shadow: inset 0 0 10px rgba(255,255,255,0.1);
}

.online-table th a,
.online-table th .sort-header {
    color: #ffffff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

.online-table th a:hover,
.online-table th .sort-header:hover {
    color: #f8f9fa;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.9);
}

.sort-header {
    cursor: pointer;
    width: 100%;
}

.sort-icon {
    font-size: 14px;
    opacity: 0.8;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    transition: opacity 0.3s ease;
}

.sort-icon.sort-asc::before { 
    content: "▲"; 
    color: #27ae60;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.9);
}

.sort-icon.sort-desc::before { 
    content: "▼"; 
    color: #e74c3c;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.9);
}

.sortable:hover .sort-icon {
    opacity: 1;
}

/* Corps du tableau */
.online-table tbody tr {
    transition: background-color 0.3s ease;
    border-bottom: 1px solid #ecf0f1;
}

.online-table tbody tr:hover {
    background-color: #f8f9fa;
}

.online-table tbody tr:nth-child(even) {
    background-color: #fafbfc;
}

.online-table tbody tr:nth-child(even):hover {
    background-color: #f1f3f4;
}

.online-table td {
    padding: 12px 10px;
    vertical-align: middle;
}

/* Colonnes spécifiques */
.player-name {
    font-weight: 600;
    color: #2c3e50;
}

.player-name a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s ease;
}

.player-name a:hover {
    color: #2980b9;
    text-decoration: underline;
}

.online-time {
    color: #27ae60;
    font-size: 11px;
    font-weight: normal;
}

.job-id {
    color: #95a5a6;
    font-size: 11px;
    font-weight: normal;
}

.level-number {
    font-size: 16px;
    font-weight: bold;
}

.exp-info {
    color: #7f8c8d;
    font-size: 10px;
    font-weight: normal;
}

.player-class {
    color: #8e44ad;
    font-weight: 500;
}

.player-level, .job-level {
    text-align: center;
    font-weight: 600;
    color: #27ae60;
}

.guild-emblem img {
    width: 20px;
    height: 20px;
    border-radius: 3px;
}

.guild-name a {
    color: #e67e22;
    text-decoration: none;
    transition: color 0.3s ease;
}

.guild-name a:hover {
    color: #d35400;
    text-decoration: underline;
}

.no-guild {
    color: #95a5a6;
    font-style: italic;
}

.player-map {
    color: #34495e;
    font-family: monospace;
}

.not-applicable {
    color: #95a5a6;
    font-style: italic;
}

/* Statistiques */
.online-stats {
    margin-top: 20px;
    padding: 15px;
    background: #ecf0f1;
    border-radius: 6px;
    border-left: 4px solid #3498db;
}

.stats-info {
    margin: 0;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* État vide */
.no-players {
    text-align: center;
    padding: 40px 20px;
    color: #7f8c8d;
}

.no-players p {
    margin: 10px 0;
}

.btn-back {
    display: inline-block;
    padding: 10px 20px;
    background: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    transition: background-color 0.3s ease;
}

.btn-back:hover {
    background: #2980b9;
    color: white;
    text-decoration: none;
}

/* Responsive */
@media (max-width: 768px) {
    .online-players-container {
        padding: 10px;
    }
    
    .online-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-input, .filter-select {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .online-table th, .online-table td {
        padding: 8px 6px;
        font-size: 13px;
    }
    
    .online-table th a {
        font-size: 12px;
    }
    
    .online-players-container h2 {
        font-size: 1.5em;
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .online-table {
        font-size: 12px;
    }
    
    .online-table th, .online-table td {
        padding: 6px 4px;
    }
    
    .guild-emblem img {
        width: 16px;
        height: 16px;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.player-row {
    animation: fadeIn 0.3s ease-out;
}

/* Amélioration de l'accessibilité */
.online-table th[role="columnheader"] {
    cursor: pointer;
}

.online-table th[role="columnheader"]:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* États de chargement */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
