/* Tab Navigation Styles - Now at top of right pane */
.tab-nav {
    display: flex;
    background: var(--bg-secondary, #1e293b);
    border-bottom: 2px solid var(--border, #334155);
    padding: 0;
    gap: 4px;
    overflow-x: auto;
    flex-shrink: 0; /* Don't shrink the tab nav */
}

.tab-button {
    padding: 10px 20px;
    background: transparent;
    border: none;
    color: var(--text-secondary, #94a3b8);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
}

.tab-button:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary, #fff);
}

.tab-button.active {
    color: var(--accent, #3b82f6);
    border-bottom-color: var(--accent, #3b82f6);
    background: rgba(59, 130, 246, 0.1);
}

/* Tab Content Container */
.tab-content-container {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.tab-content {
    display: none;
    flex: 1;
    overflow: auto;
    flex-direction: column;
}

.tab-content.active {
    display: flex;
}

/* Ensure check-in tab's app-container fills the space */
#tab-checkin .app-container {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Ensure all tabs respect the right pane width */
.tab-content {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Make sure tab containers don't overflow */
.registration-tab,
.ranking-tab {
    max-width: 100%;
    overflow-x: hidden;
}

/* Registration Payment Tab Styles */
.registration-tab {
    padding: 20px;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    box-sizing: border-box;
}

.tournament-selector {
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-card, #1e293b);
    border-radius: 8px;
    border: 1px solid var(--border, #334155);
}

.tournament-selector label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary, #fff);
    font-weight: 500;
    font-size: 14px;
}

.tournament-selector select {
    width: 100%;
    max-width: 500px;
    padding: 10px;
    background: var(--bg-primary, #0f172a);
    border: 1px solid var(--border, #334155);
    border-radius: 6px;
    color: var(--text-primary, #fff);
    font-size: 14px;
}

/* Search Container */
.search-container {
    position: relative;
    margin-bottom: 16px;
}

.search-input {
    width: 100%;
    padding: 12px 40px 12px 16px;
    background: var(--bg-primary, #0f172a);
    border: 2px solid var(--border, #334155);
    border-radius: 8px;
    color: var(--text-primary, #fff);
    font-size: 15px;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent, #3b82f6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.search-input::placeholder {
    color: var(--text-muted, #64748b);
}

.clear-search-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-secondary, #1e293b);
    border: none;
    color: var(--text-secondary, #94a3b8);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    transition: all 0.2s;
}

.clear-search-btn:hover {
    background: var(--accent, #3b82f6);
    color: white;
}

/* Search results count */
.search-results-count {
    font-size: 12px;
    color: var(--text-muted, #64748b);
    margin-bottom: 8px;
    padding: 0 4px;
}

/* Filter row layout */
.filter-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.filter-row .search-container {
    flex: 1;
    min-width: 200px;
    margin-bottom: 0;
}

.discipline-filter {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary, #94a3b8);
    white-space: nowrap;
}

.filter-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--accent, #3b82f6);
}

#registration-discipline-select {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid var(--border, #334155);
    background: var(--bg-card, #1e293b);
    color: var(--text-primary, #fff);
    font-size: 13px;
    min-width: 150px;
}

.registration-list {
    background: var(--bg-card, #1e293b);
    border-radius: 8px;
    border: 1px solid var(--border, #334155);
    overflow: hidden;
    max-width: 100%;
}

.registration-header {
    display: grid;
    grid-template-columns: 1fr 90px 60px 60px 70px;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-secondary, #1e293b);
    border-bottom: 2px solid var(--border, #334155);
    font-weight: 600;
    color: var(--text-secondary, #94a3b8);
    font-size: 12px;
}

.registration-item {
    display: grid;
    grid-template-columns: 1fr 90px 60px 60px 70px;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border, #334155);
    align-items: center;
    transition: background 0.2s;
}

.registration-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.registration-item:last-child {
    border-bottom: none;
}

.player-name {
    font-weight: 500;
    color: var(--text-primary, #fff);
    cursor: pointer;
}

.player-name:hover {
    color: var(--accent, #3b82f6);
    text-decoration: underline;
}

.player-name .native-name {
    display: block;
    font-size: 12px;
    color: var(--text-muted, #64748b);
    font-weight: 400;
    margin-top: 2px;
}

.fee-amount {
    color: var(--text-secondary, #94a3b8);
    text-align: right;
}

.paid-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--success, #10b981);
}

.checkin-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--accent, #3b82f6);
}

.detail-btn {
    padding: 6px 12px;
    background: var(--accent, #3b82f6);
    border: none;
    border-radius: 4px;
    color: white;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.detail-btn:hover {
    background: var(--accent-hover, #2563eb);
}

/* Doubles Team Pair Styling */
.doubles-team-container {
    border: 2px solid var(--accent, #3b82f6);
    border-radius: 8px;
    margin: 4px 0;
    background: rgba(59, 130, 246, 0.05);
}

.doubles-team-container .registration-item {
    border-bottom: 1px dashed var(--accent, #3b82f6);
}

.doubles-team-container .registration-item:last-child {
    border-bottom: none;
}

.doubles-team-container .registration-item:first-child {
    border-radius: 6px 6px 0 0;
}

.doubles-team-container .registration-item:last-child {
    border-radius: 0 0 6px 6px;
}

.team-indicator {
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 80%;
    background: var(--accent, #3b82f6);
    border-radius: 2px;
}

/* Copy name button in registration list */
.copy-name-btn-small {
    padding: 4px 8px;
    background: var(--bg-secondary, #334155);
    border: 1px solid var(--border, #475569);
    border-radius: 4px;
    color: var(--text-secondary, #94a3b8);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.copy-name-btn-small:hover {
    background: var(--accent, #3b82f6);
    color: white;
    border-color: var(--accent, #3b82f6);
}

.copy-name-btn-small.copied {
    background: var(--success, #10b981);
    color: white;
    border-color: var(--success, #10b981);
}

/* Player Detail Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card, #1e293b);
    border-radius: 12px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid var(--border, #334155);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border, #334155);
}

.modal-header h3 {
    color: var(--text-primary, #fff);
    font-size: 18px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary, #94a3b8);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    line-height: 32px;
    text-align: center;
    border-radius: 4px;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary, #fff);
}

.modal-section {
    margin-bottom: 16px;
}

.modal-section h4 {
    color: var(--text-secondary, #94a3b8);
    font-size: 12px;
    text-transform: uppercase;
    margin-bottom: 8px;
    font-weight: 600;
}

.modal-section p {
    color: var(--text-primary, #fff);
    font-size: 14px;
    line-height: 1.5;
}

.event-list {
    list-style: none;
    padding: 0;
}

.event-item {
    padding: 8px 12px;
    background: var(--bg-primary, #0f172a);
    border-radius: 6px;
    margin-bottom: 8px;
    color: var(--text-primary, #fff);
    font-size: 14px;
}

.partner-info {
    color: var(--text-secondary, #94a3b8);
    font-size: 13px;
    margin-top: 4px;
}

.event-name {
    font-weight: 500;
    color: var(--text-primary, #fff);
}

.event-value {
    color: var(--text-secondary, #94a3b8);
    font-size: 13px;
    margin-top: 2px;
}

.payment-status {
    margin-top: 4px;
    font-size: 13px;
}

/* Ranking Tab Styles */
.ranking-tab {
    padding: 20px;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    box-sizing: border-box;
}

.ranking-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.ranking-controls button {
    padding: 10px 20px;
    background: var(--accent, #3b82f6);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.ranking-controls button:hover {
    background: var(--accent-hover, #2563eb);
}

.ranking-controls button:disabled {
    background: var(--bg-secondary, #1e293b);
    color: var(--text-muted, #64748b);
    cursor: not-allowed;
}

.ranking-controls select {
    padding: 10px;
    background: var(--bg-card, #1e293b);
    border: 1px solid var(--border, #334155);
    border-radius: 6px;
    color: var(--text-primary, #fff);
    font-size: 14px;
    min-width: 200px;
    max-width: 300px;
}

.ranking-list {
    background: var(--bg-card, #1e293b);
    border-radius: 8px;
    border: 1px solid var(--border, #334155);
    overflow: hidden;
    max-width: 100%;
}

.ranking-header {
    display: grid;
    grid-template-columns: 70px 1fr 80px 120px;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-secondary, #1e293b);
    border-bottom: 2px solid var(--border, #334155);
    font-weight: 600;
    color: var(--text-secondary, #94a3b8);
    font-size: 12px;
}

.ranking-item {
    display: grid;
    grid-template-columns: 70px 1fr 80px 120px;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border, #334155);
    align-items: center;
    transition: background 0.2s;
}

.ranking-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.ranking-item:last-child {
    border-bottom: none;
}

.rank-position {
    font-weight: 700;
    font-size: 16px;
    color: var(--text-primary, #fff);
}

.rank-position.gold {
    color: #ffd700;
}

.rank-position.silver {
    color: #c0c0c0;
}

.rank-position.bronze {
    color: #cd7f32;
}

.rank-stage {
    color: var(--text-muted, #64748b);
    font-size: 13px;
}

.rank-record {
    color: var(--text-secondary, #94a3b8);
    font-size: 13px;
}

.rank-status {
    font-size: 13px;
}

.status-active {
    color: var(--success, #10b981);
    font-weight: 500;
}

.status-eliminated {
    color: var(--text-muted, #64748b);
}

.ranking-item.eliminated-row {
    opacity: 0.7;
    background: rgba(0, 0, 0, 0.1);
}

.rank-position.eliminated {
    color: var(--text-muted, #64748b);
    font-weight: 500;
}

.copy-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.copy-name-btn {
    padding: 4px 10px;
    background: var(--bg-primary, #0f172a);
    border: 1px solid var(--border, #334155);
    border-radius: 4px;
    color: var(--text-secondary, #94a3b8);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.copy-name-btn:hover {
    background: var(--accent, #3b82f6);
    color: white;
    border-color: var(--accent, #3b82f6);
}

.copy-name-btn:active {
    transform: scale(0.95);
}

.copy-name-btn.copied {
    background: var(--success, #10b981);
    color: white;
    border-color: var(--success, #10b981);
}

.copy-name-btn.copied:hover {
    background: var(--success-hover, #059669);
    border-color: var(--success-hover, #059669);
}

/* File Upload Button */
.file-upload-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.upload-btn {
    padding: 10px 20px;
    background: var(--accent, #3b82f6);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.upload-btn:hover {
    background: var(--accent-hover, #2563eb);
}

.loaded-file-name {
    color: var(--success, #10b981);
    font-size: 13px;
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state .hint {
    font-size: 12px;
    color: var(--text-muted, #64748b);
    margin-top: 8px;
}

.loading-indicator {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary, #94a3b8);
}

.loading-indicator::after {
    content: '...';
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted, #64748b);
}

.empty-state h3 {
    color: var(--text-secondary, #94a3b8);
    margin-bottom: 8px;
}

/* Toast Notification Styles */
.registration-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.registration-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.registration-toast.success {
    background: var(--success, #10b981);
    color: white;
}

.registration-toast.error {
    background: var(--error, #ef4444);
    color: white;
}

.registration-toast.info {
    background: var(--accent, #3b82f6);
    color: white;
}

/* Checkbox loading state */
.paid-checkbox:disabled {
    opacity: 0.5;
    cursor: wait;
}

/* Registration Search Styles */
.registration-search {
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-card, #1e293b);
    border-radius: 8px;
    border: 1px solid var(--border, #334155);
}
.registration-search label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary, #fff);
    font-weight: 500;
    font-size: 14px;
}
.registration-search input {
    width: 100%;
    max-width: 500px;
    padding: 10px;
    background: var(--bg-primary, #0f172a);
    border: 1px solid var(--border, #334155);
    border-radius: 6px;
    color: var(--text-primary, #fff);
    font-size: 14px;
}
.registration-search input:focus {
    outline: none;
    border-color: var(--accent, #3b82f6);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}
