/* =============================================
   MANNSCHAFTSTABELLE (Verbandsformat)
   ============================================= */

.player-form-inline {
    margin-bottom: 15px;
}

.table-responsive {
    overflow-x: auto;
    margin-top: 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.team-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    white-space: nowrap;
}

.team-table thead th {
    background: #f8fafc;
    border-bottom: 2px solid var(--border-color);
    padding: 8px 6px;
    text-align: left;
    font-weight: 700;
    color: #000000;
}

.team-table tbody td {
    border-bottom: 1px solid var(--border-color);
    padding: 6px;
    vertical-align: middle;
}

.team-table tbody tr:nth-child(even) {
    background: #f8fafc;
}

.team-table tbody tr:hover {
    background: #eff6ff;
}

.num-cell {
    text-align: center;
    font-weight: 700;
    color: var(--primary-color);
}

.actions-cell {
    text-align: center;
}

.btn-edit-player,
.btn-delete-player {
    padding: 4px 8px;
    font-size: 11px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    margin: 0 2px;
}

.btn-edit-player {
    background: #e2e8f0;
    color: #000000;
}

.btn-edit-player:hover {
    background: #cbd5e1;
}

.btn-delete-player {
    background: #fee2e2;
    color: #000000;
}

.btn-delete-player:hover {
    background: var(--danger-color);
    color: white;
}

.youth-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 10px;
    color: #000000;
}

.youth-category-display {
    font-size: 12px;
    color: var(--text-muted);
    margin: 6px 0 8px 0;
}

/* =============================================
   PROFIL-MODAL (Overlay-Design)
   ============================================= */

.profile-modal-overlay.hidden {
    display: none;
}

.profile-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.profile-modal {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.profile-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: #ffffff;
    z-index: 10;
}

.profile-modal-header h2 {
    margin: 0;
    font-size: 18px;
    color: #000000;
}

.btn-close-profile {
    background: #e2e8f0;
    border: none;
    border-radius: 4px;
    width: 32px;
    height: 32px;
    font-size: 16px;
    cursor: pointer;
    color: #000000;
    line-height: 1;
}

.btn-close-profile:hover {
    background: #cbd5e1;
}

.profile-modal-body {
    padding: 20px;
}

.profile-section {
    margin-bottom: 24px;
}

.profile-section:last-child {
    margin-bottom: 0;
}

.profile-section h3 {
    margin: 0 0 12px 0;
    font-size: 15px;
    color: #000000;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 6px;
}

.kader-muted {
    color: var(--text-muted);
    font-size: 13px;
    margin: 4px 0 0 0;
}

/* =============================================
   BEARBEITEN-TOGGLE (Button "Stammdaten bearbeiten")
   ============================================= */

.btn-toggle-edit {
    display: block;
    width: 100%;
    background: #eef2ff;
    color: var(--primary-color, #1e3a8a);
    border: 1px solid var(--primary-color, #1e3a8a);
    border-radius: 6px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 20px;
    font-family: inherit;
}

.btn-toggle-edit:hover {
    background: #dbeafe;
}

.edit-sections.hidden {
    display: none;
}

.edit-sections {
    margin-bottom: 24px;
    padding: 14px;
    background: #f8fafc;
    border: 1px dashed var(--border-color, #cbd5e1);
    border-radius: 8px;
}

/* =============================================
   GEMEINSAMES BEARBEITUNGSFORMULAR (ein Speichern-Button)
   ============================================= */

.profile-edit-form {
    display: flex;
    flex-direction: column;
}

.profile-fields {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    align-items: start;
}

.profile-save-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
}

.btn-profile-save-all {
    background: var(--primary-color, #1e3a8a);
    color: #ffffff;
    border: none;
    border-radius: 5px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.btn-profile-save-all:hover {
    filter: brightness(1.1);
}

.save-feedback {
    margin-top: 10px;
    padding: 10px 14px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
}

.save-feedback.hidden {
    display: none;
}

.save-success {
    background: #dcfce7;
    border: 1px solid #86efac;
    color: #15803d;
}

.save-error {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #b91c1c;
}

/* =============================================
   POSITION-CHECKBOXEN
   ============================================= */

.profile-position-group {
    background: #ffffff;
    border: 1px solid var(--border-color, #cbd5e1);
    border-radius: 5px;
    padding: 10px 12px;
    margin-top: 0;
    grid-column: 1 / -1;
}

.profile-field-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #000000;
    margin-bottom: 8px;
}

.profile-checkbox-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
    padding: 4px 12px 4px 0;
    margin-right: 8px;
}

.profile-checkbox-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color, #1e3a8a);
    cursor: pointer;
    flex-shrink: 0;
}

/* =============================================
   FORMULAR-ELEMENTE
   ============================================= */

.profile-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
}

.profile-field span {
    font-weight: 600;
    color: #000000;
}

.profile-field input,
.profile-field select,
.profile-field textarea {
    padding: 8px 10px;
    border: 1px solid var(--border-color, #cbd5e1);
    border-radius: 5px;
    font-size: 14px;
    font-family: inherit;
    background: #ffffff;
    color: #000000;
}

.profile-field input:focus,
.profile-field select:focus,
.profile-field textarea:focus {
    outline: 2px solid var(--primary-color, #1e3a8a);
    border-color: var(--primary-color, #1e3a8a);
}

.profile-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
}

.profile-toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    cursor: pointer;
    padding: 6px 0;
}

.profile-toggle-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color, #1e3a8a);
    cursor: pointer;
    flex-shrink: 0;
}

.profile-reason {
    display: none;
}

.profile-reason.visible {
    display: flex;
}

.profile-admin-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

/* =============================================
   ANWESENHEITSSTATISTIK
   ============================================= */

.profile-stats {
    margin-bottom: 10px;
}

.profile-stat-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.profile-stat-chip {
    background: #f8fafc;
    border: 1px solid var(--border-color, #cbd5e1);
    border-radius: 8px;
    padding: 10px 16px;
    text-align: center;
    min-width: 90px;
}

.profile-stat-value {
    display: block;
    font-size: 20px;
    font-weight: 800;
    color: #000000;
}

.profile-stat-label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.stat-zu {
    background: #dcfce7;
    border-color: #86efac;
}

.stat-zu .profile-stat-value {
    color: #15803d;
}

.stat-ab {
    background: #fee2e2;
    border-color: #fca5a5;
}

.stat-ab .profile-stat-value {
    color: #b91c1c;
}

.stat-quote {
    background: #dbeafe;
    border-color: #93c5fd;
}

.stat-quote .profile-stat-value {
    color: #1d4ed8;
}

.profile-inactive-hint {
    font-size: 13px;
    color: #92400e;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 5px;
    padding: 8px 12px;
    margin: 10px 0 0 0;
}

.profile-recent-title {
    font-size: 12px;
    font-weight: 700;
    color: #000000;
    margin-bottom: 6px;
}

.profile-recent-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.profile-recent-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    background: #f8fafc;
    border: 1px solid var(--border-color, #cbd5e1);
    border-radius: 12px;
    padding: 3px 10px;
    color: #000000;
}

.profile-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.dot-zu {
    background: #22c55e;
}

.dot-ab {
    background: #ef4444;
}

.dot-offen {
    background: #94a3b8;
}

/* =============================================
   TRAINER-NOTIZEN
   ============================================= */

.profile-note-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.note-category-select {
    padding: 8px 10px;
    border: 1px solid var(--border-color, #cbd5e1);
    border-radius: 5px;
    font-size: 13px;
    font-family: inherit;
    background: #ffffff;
    color: #000000;
    max-width: 220px;
}

.note-text-input {
    padding: 8px 10px;
    border: 1px solid var(--border-color, #cbd5e1);
    border-radius: 5px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    background: #ffffff;
    color: #000000;
}

.note-text-input:focus {
    outline: 2px solid var(--primary-color, #1e3a8a);
    border-color: var(--primary-color, #1e3a8a);
}

.btn-note-add {
    background: var(--primary-color, #1e3a8a);
    color: #ffffff;
    border: none;
    border-radius: 5px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    align-self: flex-start;
}

.btn-note-add:hover {
    filter: brightness(1.1);
}

.note-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.note-item {
    border: 1px solid var(--border-color, #cbd5e1);
    border-left: 4px solid #94a3b8;
    border-radius: 5px;
    padding: 8px 12px;
    background: #ffffff;
}

.note-cat-ziel {
    border-left-color: #3b82f6;
}

.note-cat-problem {
    border-left-color: #ef4444;
}

.note-cat-positiv {
    border-left-color: #22c55e;
}

.note-cat-rueckkehr {
    border-left-color: #a855f7;
}

.note-item-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.note-category {
    font-size: 11px;
    font-weight: 700;
    color: #000000;
}

.note-date {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: auto;
}

.btn-note-delete {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 0 2px;
}

.btn-note-delete:hover {
    transform: scale(1.15);
}

.note-text {
    font-size: 13px;
    color: #000000;
    white-space: pre-wrap;
}

/* =============================================
   LADE-/FEHLERZUSTÄNDE
   ============================================= */

.loading-state {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    padding: 20px 10px;
}

.state-error {
    color: #b91c1c;
}

/* =============================================
   RESPONSIVE
   ============================================= */

@media screen and (max-width: 768px) {
    .team-table {
        font-size: 12px;
    }

    .team-table thead th,
    .team-table tbody td {
        padding: 4px 3px;
    }

    .profile-modal-overlay {
        padding: 10px;
        align-items: flex-start;
        overflow-y: auto;
    }

    .profile-modal {
        max-height: none;
    }

    .profile-fields {
        grid-template-columns: 1fr 1fr;
    }

    .profile-admin-row {
        grid-template-columns: 1fr;
    }

    .profile-save-row {
        justify-content: stretch;
    }

    .btn-profile-save-all {
        width: 100%;
    }

    .profile-stat-chips {
        gap: 6px;
    }

    .profile-stat-chip {
        min-width: 70px;
        padding: 8px 10px;
    }
}

@media screen and (max-width: 480px) {
    .profile-fields {
        grid-template-columns: 1fr;
    }
}