/**
 * /assets/css/gm-players.css
 *
 * Purpose:  GM Spielerverwaltung Styles
 *           User-Cards, Charakter-Badges, Zuweisungs-Grid, Such-Modal
 * Deps:     app.css (variables: --accent, --danger, --gold, --exp)
 * Load:     index.php
 * Version:  1.0.0
 */

/* ============================================================================
 * Section Headers
 * ============================================================================ */

.gmp-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .95rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.9);
}

/* ============================================================================
 * User List
 * ============================================================================ */

.gmp-user-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gmp-user-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.gmp-user-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.gmp-user-card--gm {
    border-left: 3px solid rgba(255, 211, 107, 0.4);
}

.gmp-user-card--inactive {
    opacity: 0.5;
}

.gmp-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.gmp-user-details {
    min-width: 0;
    flex: 1;
}

.gmp-user-name {
    font-weight: 600;
    font-size: .9rem;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.gmp-user-meta {
    font-size: .75rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gmp-user-actions {
    flex-shrink: 0;
}

/* ============================================================================
 * Avatar
 * ============================================================================ */

.gmp-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.gmp-avatar--initials {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(93, 214, 201, 0.15);
    color: var(--accent, #5dd6c9);
    font-weight: 700;
    font-size: .8rem;
}

/* ============================================================================
 * Character Badges (in User Cards)
 * ============================================================================ */

.gmp-char-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: .75rem;
    transition: border-color 0.15s, background 0.15s;
    margin-top: 4px;
}

.gmp-char-badge:hover {
    border-color: rgba(93, 214, 201, 0.4);
    background: rgba(93, 214, 201, 0.08);
    color: var(--accent, #5dd6c9);
    text-decoration: none;
}

.gmp-char-img {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    object-fit: cover;
}

.gmp-char-icon {
    font-size: .7rem;
    color: rgba(255, 255, 255, 0.4);
}

.gmp-char-name {
    font-weight: 600;
}

.gmp-char-level {
    color: var(--gold, #ffd36b);
    font-size: .65rem;
    font-weight: 600;
}

/* ============================================================================
 * Assignment Grid
 * ============================================================================ */

.gmp-assign-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gmp-assign-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    transition: border-color 0.2s;
}

.gmp-assign-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

.gmp-assign-char {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.gmp-assign-img {
    width: 36px;
    height: 48px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.gmp-assign-img--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.3);
    font-size: .9rem;
}

.gmp-assign-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.gmp-assign-current {
    font-size: .8rem;
    color: var(--accent, #5dd6c9);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(93, 214, 201, 0.1);
}

/* ============================================================================
 * Add Player Modal
 * ============================================================================ */

.gmp-search-input {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: #fff;
    padding: 8px 12px;
    font-size: .9rem;
    width: 100%;
}

.gmp-search-input:focus {
    outline: none;
    border-color: var(--accent, #5dd6c9);
    box-shadow: 0 0 0 2px rgba(93, 214, 201, 0.2);
}

.gmp-search-input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.gmp-search-results {
    max-height: 300px;
    overflow-y: auto;
    margin-top: 8px;
}

.gmp-search-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    transition: background 0.15s;
    cursor: default;
}

.gmp-search-result:hover {
    background: rgba(255, 255, 255, 0.06);
}

.gmp-search-result-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.gmp-search-result-name {
    font-weight: 600;
    font-size: .85rem;
}

.gmp-search-result-email {
    font-size: .75rem;
    color: rgba(255, 255, 255, 0.45);
}

.gmp-search-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.gmp-search-avatar--initials {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(93, 214, 201, 0.15);
    color: var(--accent, #5dd6c9);
    font-weight: 700;
    font-size: .7rem;
}

/* ============================================================================
 * Responsive
 * ============================================================================ */

@media (max-width: 576px) {
    .gmp-user-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .gmp-user-actions {
        align-self: flex-end;
    }

    .gmp-assign-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .gmp-assign-controls {
        align-self: flex-end;
    }
}

/* ============================================================================
 * Reduced Motion
 * ============================================================================ */

@media (prefers-reduced-motion: reduce) {
    .gmp-user-card,
    .gmp-assign-card,
    .gmp-char-badge,
    .gmp-search-result {
        transition: none;
    }
}
