/* Ostseecup Regatta System Styles */

.regatta-results, .regatta-standings {
    margin: 20px 0;
    font-family: Arial, Helvetica, sans-serif;
}

.regatta-results h3, .regatta-standings h3 {
    color: #003399;
    font-size: 18px;
    margin-bottom: 15px;
    background-color: #86B8EA;
    padding: 10px;
    color: white;
    border-radius: 5px;
}

.regatta-results-table, .regatta-standings-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    min-width: 800px; /* Ensure table is wide enough for race columns */
}

.regatta-standings-container {
    overflow-x: auto; /* Allow horizontal scrolling on small screens */
    margin: 20px 0;
}

.regatta-results-table th, .regatta-standings-table th {
    background-color: #86B8EA;
    color: white;
    padding: 12px 8px;
    text-align: left;
    font-weight: bold;
    font-size: 11px;
    border: 1px solid #99CCFF;
}

.regatta-results-table td, .regatta-standings-table td {
    padding: 8px;
    font-size: 10px;
    color: #003399;
    border: 1px solid #99CCFF;
    border-top: 1px solid #99CCFF;
    border-right: 1px solid #86B8EA;
    border-left: 1px solid #99CCFF;
}

.regatta-results-table tr:hover, .regatta-standings-table tr:hover {
    background-color: #99CCFF;
    cursor: pointer;
}

.regatta-results-table tr:nth-child(even), .regatta-standings-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.regatta-results-table tr:nth-child(even):hover, .regatta-standings-table tr:nth-child(even):hover {
    background-color: #99CCFF;
}

.regatta-results-table td:first-child, .regatta-standings-table td:first-child {
    font-weight: bold;
    text-align: center;
}

.regatta-results-table td:last-child, .regatta-standings-table td:last-child {
    font-weight: bold;
    text-align: center;
    color: black;
}

/* Individual race result columns */
.regatta-col {
    writing-mode: horizontal-tb;
    text-align: center !important;
    min-width: 60px;
    max-width: 80px;
    font-size: 10px !important;
    padding: 8px 4px !important;
}

/* Styling for races with and without results */
.regatta-col.has-results {
    background-color: #86B8EA;
    color: white;
}

.regatta-col.no-results {
    background-color: #e8f5e8;
    color: #2d5a2d;
    font-style: italic;
}

.regatta-col.past-no-results {
    background-color: #e0e0e0;
    color: #666;
    font-style: italic;
}

.result-col {
    text-align: center !important;
    font-size: 11px;
    min-width: 40px;
    padding: 6px 4px !important;
}

.result-col.counted {
    background-color: #fff;
    color: #000;
    font-weight: bold;
}

.result-col.not-counted {
    background-color: #f5f5f5;
    color: #666;
    font-style: italic;
}

.result-col.empty {
    background-color: #f9f9f9;
    color: #ccc;
}

.result-col.planned {
    background-color: #f0f0f0;
    color: #999;
    font-style: italic;
}

.result-col.cancelled {
    background-color: #ffe6cc;
    color: #cc6600;
    font-style: italic;
    font-weight: bold;
}

/* Main column widths */
.position-col { width: 50px; text-align: center; }
.boat-col { min-width: 150px; }
.owner-col { min-width: 100px; }
.ys-col { width: 60px; text-align: center; }
.races-col { width: 60px; text-align: center; }
.points-col { width: 80px; text-align: center; font-weight: bold; }
.group-col { width: 80px; text-align: center; font-weight: bold; color: #003399; }

/* Boat details styling */
.boat-details {
    color: #666;
    font-weight: normal;
    font-size: 10px;
    line-height: 1.2;
    display: block;
    margin-top: 2px;
}

/* Club details styling */
.club-details {
    color: #666;
    font-weight: normal;
    font-size: 10px;
    line-height: 1.2;
    display: block;
    margin-top: 2px;
    font-style: italic;
}

/* Alternating row colors */
.standings-row:nth-child(even) {
    background-color: #f9f9f9;
}

.standings-row:hover {
    background-color: #99CCFF;
}

/* Responsive design */
@media (max-width: 1200px) {
    .regatta-standings-table {
        font-size: 11px;
    }
    
    .regatta-col {
        font-size: 9px !important;
        min-width: 50px;
        max-width: 60px;
    }
    
    .result-col {
        font-size: 10px;
        min-width: 35px;
    }
}

@media (max-width: 768px) {
    .regatta-results-table, .regatta-standings-table {
        font-size: 10px;
    }
    
    .regatta-results-table td, .regatta-standings-table td {
        padding: 4px 2px;
    }
    
    .regatta-results-table th, .regatta-standings-table th {
        padding: 6px 2px;
    }
    
    .regatta-col {
        font-size: 8px !important;
        min-width: 40px;
        max-width: 50px;
        padding: 4px 2px !important;
    }
    
    .result-col {
        font-size: 9px;
        min-width: 30px;
        padding: 4px 2px !important;
    }
    
    .boat-col { min-width: 80px; }
    .owner-col { min-width: 70px; }
}

/* Admin styles */
.wrap .regatta-admin-section {
    background: white;
    padding: 20px;
    margin: 20px 0;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.regatta-admin-section h2 {
    margin-top: 0;
    color: #003399;
}

.regatta-import-form {
    margin-top: 20px;
}

.regatta-import-form .button-primary {
    background-color: #86B8EA;
    border-color: #86B8EA;
    color: white;
}

.regatta-import-form .button-primary:hover {
    background-color: #003399;
    border-color: #003399;
}

/* Warning messages */
.regatta-admin-section p strong {
    color: #d63638;
}

.regatta-admin-section .button-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}

.regatta-admin-section .button-secondary:hover {
    background-color: #5a6268;
    border-color: #545b62;
}

/* Clear data warning styling */
.regatta-admin-section:has(input[name="clear_all_data"]) {
    border-left-color: #d63638;
}

.regatta-admin-section:has(input[name="reimport_data"]) {
    border-left-color: #d63638;
}

/* Compact form styling with perfect alignment */
.regatta-form-header {
    display: flex;
    gap: 15px;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 12px;
    color: #666;
    padding-bottom: 5px;
}

.regatta-form-header span:nth-child(1) { flex: 1; min-width: 120px; } /* Boat Name */
.regatta-form-header span:nth-child(2) { flex: 1; min-width: 120px; } /* Owner */
.regatta-form-header span:nth-child(3) { flex: 0 0 120px; } /* Club */
.regatta-form-header span:nth-child(4) { flex: 1; min-width: 120px; } /* Boat Type */
.regatta-form-header span:nth-child(5) { flex: 0 0 120px; } /* Sail Number */
.regatta-form-header span:nth-child(6) { flex: 0 0 120px; } /* Group */
.regatta-form-header span:nth-child(7) { flex: 0 0 80px; } /* YS Rating */

.regatta-form-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: nowrap;
}

.regatta-form-row label {
    font-weight: 600;
    color: #23282d;
    white-space: nowrap;
    min-width: 80px;
}

.regatta-form-row input[type="text"],
.regatta-form-row input[type="date"],
.regatta-form-row input[type="number"],
.regatta-form-row input[type="email"],
.regatta-form-row input[type="url"],
.regatta-form-row select {
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

/* Boat form input field alignment - must match headers exactly */
.regatta-form-row > input:nth-child(1) { flex: 1; min-width: 120px; } /* Boat Name */
.regatta-form-row > input:nth-child(2) { flex: 1; min-width: 120px; } /* Owner */
.regatta-form-row > input:nth-child(3) { flex: 0 0 120px; } /* Club */
.regatta-form-row > input:nth-child(4) { flex: 1; min-width: 120px; } /* Boat Type */
.regatta-form-row > input:nth-child(5) { flex: 0 0 120px; } /* Sail Number */
.regatta-form-row > select:nth-child(6) { flex: 0 0 120px; } /* Group */
.regatta-form-row > input:nth-child(7) { flex: 0 0 80px; } /* YS Rating */

/* Override any conflicting styles */
.regatta-form-row input[type="text"],
.regatta-form-row input[type="number"],
.regatta-form-row select {
    width: auto !important;
}

.regatta-form-row input[type="date"] {
    width: 150px;
}

.regatta-form-row select {
    min-width: 120px;
}

/* Responsive adjustments for forms */
@media (max-width: 768px) {
    .regatta-form-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .regatta-form-row label {
        min-width: auto;
    }
    
    .regatta-form-row input,
    .regatta-form-row select {
        width: 100% !important;
    }
}

/* Legacy color scheme compatibility */
body.regatta-legacy {
    background-color: #86B8EA;
    color: #003399;
}

.regatta-legacy a:link {
    color: #0000FF;
    text-decoration: none;
    border-bottom: 1px dotted #FFCC00;
}

.regatta-legacy a:visited {
    color: #000066;
    text-decoration: none;
    border-bottom: 1px dotted #FFCC00;
}

.regatta-legacy a:hover {
    color: #FFFFFF;
    text-decoration: none;
}

.regatta-legacy a:active {
    color: #FFCC00;
    text-decoration: none;
}