/* Race Planning Styles */

.race-planning-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.race-planning-section h3 {
    color: var(--primary-color);
    margin-bottom: 12px;
    font-size: 1.1em;
}

.race-planning-section button {
    margin-right: 8px;
    margin-bottom: 8px;
}

/* Race Plan Configuration Modal */
.race-plan-config {
    width: 600px;
    max-width: 90vw;
}

.lineup-selection-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.lineup-selection-section h3 {
    margin-bottom: 8px;
    color: var(--primary-color);
}

.section-description {
    margin-bottom: 12px;
    color: var(--secondary-color);
    font-size: 0.9em;
}

.fixed-lineups-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.count-display {
    font-size: 0.9em;
    color: var(--secondary-color);
    font-weight: 500;
}

.fixed-lineups-list {
    margin-top: 8px;
}

.fixed-lineups-preview {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fixed-lineup-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background-color: var(--light-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9em;
}

.lineup-name {
    font-weight: 600;
    color: var(--primary-color);
}

.lineup-score {
    color: var(--secondary-color);
}

.remove-fixed-lineup {
    background-color: var(--danger-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
}

.remove-fixed-lineup:hover {
    background-color: #c82333;
}

/* Lineup Selector Modal */
.lineup-selector {
    width: 700px;
    max-width: 95vw;
    max-height: 80vh;
    overflow-y: auto;
}

.lineup-selector-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 16px;
}

.lineup-selector-item {
    display: flex;
    align-items: flex-start;
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.lineup-selector-item:hover {
    background-color: var(--light-color);
}

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

.lineup-selector-item input[type="checkbox"] {
    margin-right: 12px;
    margin-top: 2px;
}

.lineup-label {
    flex: 1;
    cursor: pointer;
}

.lineup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.lineup-header strong {
    color: var(--primary-color);
}

.lineup-score {
    background-color: var(--primary-color);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.8em;
}

.lineup-stats {
    font-size: 0.85em;
    color: var(--secondary-color);
}

.config-section {
    margin-bottom: 20px;
}

.config-section .form-group {
    margin-bottom: 16px;
}

.config-section label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    color: var(--dark-color);
}

.config-section input {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
}

.config-section small {
    display: block;
    margin-top: 4px;
    color: var(--secondary-color);
    font-size: 0.85em;
}

/* Race Plan Results Modal */
.race-plan-results {
    width: 900px;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.results-info p {
    margin: 0;
    color: var(--dark-color);
}

.results-controls {
    display: flex;
    gap: 8px;
}

/* Race Plan Items */
.race-plan-list {
    max-height: 60vh;
    overflow-y: auto;
}

.race-plan-item {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 16px;
    background-color: white;
    transition: box-shadow 0.2s ease;
}

.race-plan-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.race-plan-header {
    background-color: var(--light-color);
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.race-plan-header h3 {
    margin: 0;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    gap: 12px;
}

.score-badge {
    background-color: var(--primary-color);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: normal;
}

.plan-stats {
    display: flex;
    gap: 16px;
    font-size: 0.9em;
}

.plan-stats .stat {
    color: var(--secondary-color);
}

.race-plan-details {
    padding: 16px;
}

.races-summary h4,
.sit-out-summary h4 {
    margin-bottom: 8px;
    font-size: 0.95em;
    color: var(--dark-color);
}

.race-chip {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    margin-right: 8px;
    margin-bottom: 4px;
}

.sit-out-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sit-out-paddler {
    background-color: var(--warning-color);
    color: var(--dark-color);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
}

.plan-actions {
    margin-top: 16px;
    display: flex;
    gap: 8px;
}

.btn-view-details,
.btn-apply-plan {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.2s ease;
}

.btn-view-details {
    background-color: var(--secondary-color);
    color: white;
}

.btn-view-details:hover {
    background-color: #545b62;
}

.btn-apply-plan {
    background-color: var(--success-color);
    color: white;
}

.btn-apply-plan:hover {
    background-color: #218838;
}

/* Race Plan Detail Modal */
.race-plan-detail {
    width: 1000px;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
}

.plan-overview {
    margin-bottom: 24px;
    padding: 16px;
    background-color: var(--light-color);
    border-radius: 6px;
}

.overview-stats {
    display: flex;
    justify-content: space-around;
    gap: 16px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.5em;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-label {
    display: block;
    font-size: 0.9em;
    color: var(--secondary-color);
    margin-top: 4px;
}

.races-detail {
    margin-bottom: 24px;
}

.race-detail-item {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 16px;
    overflow: hidden;
}

.race-detail-item h3 {
    background-color: var(--primary-color);
    color: white;
    padding: 8px 12px;
    margin: 0;
    font-size: 1em;
}

.race-lineup-compact {
    padding: 12px;
    background-color: #fafafa;
}

/* Race sit-out display */
.race-sitout-display {
    padding: 12px;
    background-color: #fafafa;
}

.race-sitout-display h4 {
    margin-bottom: 8px;
    font-size: 0.9em;
    color: var(--dark-color);
}

.sitout-paddlers {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sitout-paddler {
    background-color: var(--warning-color);
    color: var(--dark-color);
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.85em;
    border: 1px solid #e6c061;
}

.no-sitouts {
    color: var(--success-color);
    font-style: italic;
    padding: 6px 10px;
    background-color: #d4edda;
    border-radius: 4px;
    border: 1px solid #c3e6cb;
}

.boat-positions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
}

.position-paddler {
    font-size: 0.8em;
    padding: 4px 6px;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    color: var(--dark-color);
}

.race-stats {
    padding: 8px 12px;
    border-top: 1px solid var(--border-color);
    font-size: 0.85em;
    color: var(--secondary-color);
    display: flex;
    gap: 16px;
}

/* Participation Summary */
.participation-summary {
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

.participation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.participation-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: white;
}

.participation-item.insufficient {
    background-color: #fff3cd;
    border-color: var(--warning-color);
}

.paddler-name {
    font-weight: 600;
    flex: 1;
}

.race-count {
    font-weight: bold;
    color: var(--primary-color);
    margin-right: 8px;
}

.race-numbers {
    font-size: 0.8em;
    color: var(--secondary-color);
}

/* Progress Modal */
.progress-modal {
    width: 400px;
    max-width: 90vw;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background-color: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin: 16px 0;
}

.progress-fill {
    height: 100%;
    background-color: var(--primary-color);
    width: 0%;
    transition: width 0.3s ease;
}

#racePlanProgressText {
    margin: 16px 0 0 0;
    color: var(--secondary-color);
    font-size: 0.9em;
}

/* Empty message styling */
.race-plan-list .empty-message {
    text-align: center;
    padding: 40px;
    color: var(--secondary-color);
    font-style: italic;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .race-plan-results,
    .race-plan-detail {
        width: 95vw;
        margin: 20px auto;
    }
    
    .results-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .overview-stats {
        flex-direction: column;
        gap: 12px;
    }
    
    .boat-positions {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }
    
    .participation-grid {
        grid-template-columns: 1fr;
    }
}