/* ==========================================================================
   Team Sheet Editor
   ========================================================================== */

.team-sheet-container {
    background-color: white;
    border-radius: 10px;
    box-shadow: var(--box-shadow);
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.match-context {
    text-align: center;
    margin-bottom: 20px;
}

.match-context .competition-name {
    color: #666;
    margin-bottom: 10px;
}

.match-context h2 {
    font-size: 1.5em;
    margin-bottom: 10px;
}

.match-context p {
    color: #666;
    margin-bottom: 20px;
}

.team-sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.team-sheet-title {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    margin: 0;
}

.team-sheet-actions {
    display: flex;
    gap: 10px;
}

.color-picker-group {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background-color: #fff3cd;
    border: 2px solid var(--warning-color);
    border-radius: 6px;
}

.edit-mode .color-picker-group {
    display: flex;
}

.color-picker-label {
    font-size: 14px;
    color: #856404;
    font-weight: 600;
    white-space: nowrap;
}

.team-color-picker {
    width: 44px;
    height: 44px;
    border: 3px solid #856404;
    border-radius: 6px;
    cursor: pointer;
}

.view-mode-buttons,
.edit-mode-buttons {
    display: flex;
    gap: 10px;
}

.edit-mode-buttons {
    display: none;
}

.edit-mode .view-mode-buttons {
    display: none;
}

.edit-mode .edit-mode-buttons {
    display: flex;
}

.team-sheet-view {
    display: block;
}

.team-sheet-edit {
    display: none;
}

.edit-mode .team-sheet-view {
    display: none;
}

.edit-mode .team-sheet-edit {
    display: block;
}

.player-list {
    list-style-type: none;
    padding: 0;
}

.player-list li {
    background-color: #f9f9f9;
    margin: 5px 0;
    padding: 10px;
    border-radius: 5px;
    border-left: 3px solid var(--team-color, var(--primary-color));
    display: flex;
    align-items: center;
    transition: var(--transition);
}

.player-list li:hover {
    background-color: #e9f5ff;
}

.player-number {
    font-weight: bold;
    color: var(--team-color, var(--primary-color));
    margin-right: 15px;
    min-width: 30px;
    text-align: right;
    padding-right: 10px;
}

.player-name {
    flex-grow: 1;
}

/* Copy from dropdown */
.copy-from-container {
    margin-bottom: 15px;
}

.copy-from-select {
    padding: 6px 10px;
    border-radius: 4px;
    border: 1px solid #ddd;
    font-size: 14px;
    min-width: 200px;
}

/* Diff preview */
.diff-preview {
    margin: 15px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    display: none;
}

.edit-mode .diff-preview.has-changes {
    display: block;
}

.diff-header {
    background-color: #f8f9fa;
    padding: 10px;
    border-bottom: 1px solid #ddd;
    font-weight: bold;
    color: #495057;
}

.diff-content {
    padding: 10px;
    max-height: 300px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 13px;
}

.diff-line {
    padding: 2px 5px;
    margin: 1px 0;
    border-radius: 2px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.diff-line-content {
    flex: 1;
    min-width: 0;
}

.diff-line-unchanged {
    color: #666;
}

.diff-line-modified {
    background-color: #fff3cd;
    border-left: 3px solid var(--warning-color);
    padding-left: 3px;
}

.diff-line-deleted {
    background-color: #f8d7da;
    border-left: 3px solid var(--danger-color);
    padding-left: 3px;
    color: #721c24;
}

.diff-line-deleted .diff-line-content {
    text-decoration: line-through;
}

.diff-line-added {
    background-color: #d4edda;
    border-left: 3px solid var(--success-color);
    padding-left: 3px;
    color: #155724;
}

.diff-char-removed {
    background-color: #ffc0c0;
    text-decoration: line-through;
}

.diff-char-added {
    background-color: #c0ffc0;
}

.diff-color-change {
    padding: 10px;
    background-color: #e9f5ff;
    border-left: 3px solid var(--primary-color);
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.diff-color-change .diff-line-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-sample {
    width: 30px;
    height: 30px;
    border: 2px solid #333;
    border-radius: 4px;
    display: inline-block;
}

.diff-line-label {
    color: #999;
    font-size: 11px;
    margin-right: 5px;
}

.diff-undo-btn {
    background: none;
    border: 1px solid #999;
    border-radius: 3px;
    color: #666;
    cursor: pointer;
    font-size: 12px;
    padding: 1px 5px;
    margin-right: 5px;
    vertical-align: middle;
}

.diff-undo-btn:hover {
    background-color: #e9e9e9;
    border-color: #666;
    color: #333;
}

.diff-line-deleted .diff-undo-btn {
    border-color: var(--danger-color);
    color: var(--danger-color);
}

.diff-line-deleted .diff-undo-btn:hover {
    background-color: #f8d7da;
}

.diff-line-added .diff-undo-btn {
    border-color: var(--success-color);
    color: var(--success-color);
}

.diff-line-added .diff-undo-btn:hover {
    background-color: #d4edda;
}

.diff-line-modified .diff-undo-btn {
    border-color: var(--warning-color);
    color: #856404;
}

.diff-line-modified .diff-undo-btn:hover {
    background-color: #fff3cd;
}

.diff-color-change .diff-undo-btn {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.diff-color-change .diff-undo-btn:hover {
    background-color: #cce5ff;
}

/* Editor container */
.editor-container {
    display: flex;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    background-color: #f8f8f8;
}

.line-numbers {
    background-color: #f0f0f0;
    color: #666;
    padding: 10px 8px;
    font-family: monospace;
    font-size: 14px;
    line-height: 1.5;
    text-align: right;
    user-select: none;
    border-right: 1px solid #ddd;
    min-width: 40px;
}

.line-numbers .line-number {
    display: block;
    white-space: pre;
}

.line-numbers .line-number.error-line {
    background-color: #f8d7da;
    color: #721c24;
    font-weight: bold;
}

.team-sheet-textarea {
    flex: 1;
    min-height: 200px;
    font-family: monospace;
    font-size: 14px;
    line-height: 1.5;
    border: none;
    padding: 10px;
    resize: vertical;
    overflow-y: hidden;
    overflow-x: auto;
    white-space: pre;
}

.team-sheet-textarea:focus {
    outline: none;
}

.team-sheet-edit .status-message {
    display: block;
}
