/* General Layout */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Column alignment classes */
.align-center {
    text-align: center;
}

.align-left {
    text-align: left;
}

/* Column specific styles */
.pos-column, .bib-column, .heat-column {
    text-align: center;
    width: 60px;
    font-weight: 600;
}

.athlete-column, .club-column, .category-column, .result-column {
    text-align: left;
}

.mark-column {
    text-align: left;
    font-family: 'Roboto Mono', monospace;
}

.info-column {
    text-align: center;
    width: 80px;
}

.pb-column {
    text-align: center;
    color: #FF0000;
    font-family: 'Roboto Mono', monospace;
}

/* Qualification mark styles */
.qualification-Q {
    font-weight: bold;
    color: #008000; /* Green color for direct qualification */
}

.qualification-q {
    font-weight: normal;
    color: #0000FF; /* Blue color for time qualification */
}

/* Field event result and attempt columns - fixed width for consistency */
.attempt-cell, .result-cell {
    text-align: center;
    min-width: 80px;
    width: 80px;
}

.result-cell {
    background-color: #f3f4f6;
    font-weight: bold;
}

.height-cell {
    text-align: center;
    background-color: #f3f4f6;
    font-weight: bold;
    min-width: 80px;
    width: 80px;
}

/* Relay specific styling */
.relay-team-row td {
    border-bottom: none !important;
    padding-bottom: 0 !important;
}

.relay-athletes-row td {
    border-top: none !important;
    padding-top: 0 !important;
    color: #666;
    font-size: 0.9em;
    font-style: italic;
}

/* Relay specific styling */
.relay-team-name {
    font-size: 1rem;
    font-weight: 500;
    padding: 8px 1px;
    border-top: 1px solid #eee;
}

.relay-runner {
    padding-left: 200px;
    color: #2196F3;
    font-size: 12px;
    padding: 2px 2px 2px 240px;
}

.event-record-info {
    font-size: 0.9rem;
    color: #FF7F50;
    margin-top: 1rem;
    font-style: italic;
    text-align: right;
    padding-right: 0.5rem;
}

/* Adjust spacing between the two info sections */
.round-info {
    margin-top: 0.5rem;
}

/* Status-based row colors */
.completed-event {
    color: #4CAF50;
}

.started-event {
    color: #FFA500;
}

.results-event {
    color: #2196F3;
}

.corrected-event {
    color: #9C27B0;
}

.site-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    background-color: white;
    width: 100%;
}

.logo-container {
    display: flex;
    justify-content: center;
    width: 100%;
    max-width: 1200px;
}

.logo-image {
    max-height: 80px;
    width: auto;
    object-fit: contain;
}

/* Session Styles */
.session-header {
    border-bottom: 2px solid #2B2B2B;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.session-info {
    font-size: 0.9rem;
    color: #666;
}

/* Additional Column Styles */
.time-column {
    width: 80px;
    text-align: center;
}

.participants-column {
    width: 80px;
    text-align: center;
}

.status-column {
    width: 130px;
    text-align: center;
}

body {
    background-color: rgb(249 250 251);
    padding: 1rem;
    font-family: Arial, sans-serif;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 1rem;
    width: 100%;
    box-sizing: border-box;
}

/* Card Styles */
.card {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

/* Event Header Styles */
.event-header {
    background-color: #2B2B2B;
    color: #FF7F50;
    padding: 1rem;
    margin: 1rem -1.5rem 1rem -1.5rem;
    font-family: Arial, sans-serif;
}

.event-header h1 {
    font-size: 1.2rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
    color: #FF7F50;
}

.event-info {
    font-size: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.event-column {
    text-align: left;
}

/* Table Styles */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -1rem;
    padding: 0 1rem;
    width: calc(100% + 2rem);
}

.schedule-table {
    width: 100%;
    border-collapse: collapse;
    font-family: Arial, sans-serif;
    font-size: 11pt;
    background-color: white;
}

.schedule-table th {
    background-color: #2B2B2B;
    color: white;
    font-weight: 500;
    padding: 0.2rem;
    border: none;
}

.schedule-table td {
    padding: 4px;
    vertical-align: middle;
    border: none;
    border-bottom: 1px solid #eee;
}

.schedule-table tr:nth-child(even) {
    background-color: #f8f8f8;
}

/* Best attempt highlighting for horizontal jumps */
.best-attempt {
    background-color: #ADD8E6;
}

/* Tab Navigation */
.tabs-nav {
    display: flex;
    gap: 0.25rem;
    border-bottom: 2px solid #2B2B2B;
    margin-bottom: 1.25rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    padding-bottom: 1px;
}

.tab-button {
    padding: 0.625rem 1.25rem;
    background-color: #f3f4f6;
    border: none;
    cursor: pointer;
    font-weight: 500;
    border-radius: 4px 4px 0 0;
    white-space: nowrap;
}

.tab-button:hover {
    background-color: #e5e7eb;
}

.tab-button.active {
    background-color: #2B2B2B;
    color: white;
}

/* Links */
.back-link {
    color: #FF7F50;
    text-decoration: none;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.back-link:hover {
    color: #FF6B3D;
}

/* Spacing */
.mb-8 { margin-bottom: 2rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mt-8 { margin-top: 2rem; }
.mt-2 { margin-top: 0.5rem; }

/* Text Colors */
.text-gray-600 {
    color: rgb(75 85 99);
}

/* Media Queries */
@media screen and (max-width: 768px) {
    .site-header {
        padding: 0.5rem;
    }
    
    .logo-image {
        max-height: 60px;
    }

    body {
        padding: 0.5rem;
    }

    .container {
        padding: 0 0.5rem;
    }

    .card {
        padding: 1rem;
        margin: 0;
        border-radius: 0;
    }

    .event-header {
        margin: -1rem -0.5rem 1rem -0.5rem;
    }

    .table-container {
        margin: 0 -0.5rem;
        padding: 0 0.5rem;
        width: calc(100% + 1rem);
    }

    .schedule-table {
        font-size: 0.875rem;
    }

    .schedule-table th,
    .schedule-table td {
        padding: 0.5rem;
    }

    .tabs-nav {
        margin: 0 -0.5rem 1rem -0.5rem;
        padding: 0 0.5rem 1px 0.5rem;
    }

    .tab-button {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }

    .pb-column {
        font-size: 0.875rem;
    }
}

/* Export buttons container */
.export-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    justify-content: flex-end;
}

/* Individual export button styling */
.export-button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.print-button {
    background-color: #f0f0f0;
    color: #333;
}

.excel-button {
    background-color: #1D6F42; /* Excel green */
    color: white;
}

.print-button:hover {
    background-color: #e0e0e0;
}

.excel-button:hover {
    background-color: #165c35;
}

/* Wind information styling - Base styles */
.wind-info {
    margin-top: 5px;
    margin-bottom: 10px;
    padding: 8px 12px;
    font-size: 0.9rem;
    font-weight: bold;
}

.wind-info p {
    margin: 0;
    font-weight: 600;
}

/* Legal wind styling (2.0 m/s or less) */
.wind-info.legal {
    background-color: #e8f5e8; /* Light green background */
    border-left: 4px solid #4caf50; /* Green border */
    color: #2e7d32; /* Green text */
}

/* Illegal wind styling (greater than 2.0 m/s) */
.wind-info.illegal {
    background-color: #ffebee; /* Light red background */
    border-left: 4px solid #f44336; /* Red border */
    color: #d32f2f; /* Red text */
}

/* No wind info or neutral styling */
.wind-info.neutral {
    background-color: #f5f5f5; /* Light gray background */
    border-left: 4px solid #757575; /* Gray border */
    color: #424242; /* Gray text */
}

/* Update the print media query in your CSS */

@media print {
    /* Hide elements not needed for printing */
    .export-buttons, .back-link-container, .tabs-nav {
        display: none;
    }
    
    /* Basic page setup */
    body {
        padding: 0;
        font-family: Arial, sans-serif;
        font-size: 11pt;
    }
    
    .container {
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 0;
    }
    
    .card {
        box-shadow: none;
        padding: 10px;
        margin: 0;
        border-radius: 0;
    }
    
    /* Keep the event header styling similar but printer-friendly */
    .event-header {
        background-color: #f0f0f0; /* Light gray instead of dark background */
        color: #333; /* Dark text instead of orange */
        padding: 10px;
        margin: 0 0 10px 0;
        border-bottom: 2px solid #2B2B2B;
    }
    
    .event-header h1 {
        color: #333;
        font-size: 16pt;
        margin-bottom: 5px;
    }
    
    /* Table styles that match web view but are print-friendly */
    .table-container {
        overflow: visible;
        width: 100%;
        margin: 0;
        padding: 0;
    }
    
    .schedule-table {
        width: 100%;
        border-collapse: collapse;
        margin-bottom: 20px;
    }
    
    .schedule-table th {
        background-color: #2B2B2B; /* Keep original dark header */
        color: white;
        font-weight: 500;
        padding: 4px;
        border: 1px solid #999;
    }
    
    .schedule-table td {
        padding: 4px;
        border: 1px solid #ddd;
    }
    
    .schedule-table tr:nth-child(even) {
        background-color: #f8f8f8;
    }
    
    /* Keep special styling */
    .best-attempt {
        background-color: #e0e0e0; /* Lighter blue for better printing */
    }
    
    .result-cell {
        background-color: #f3f4f6;
        font-weight: bold;
    }
    
    .height-cell {
        background-color: #f3f4f6;
        font-weight: bold;
    }
    
    /* Add page breaks intelligently */
    .heat-display {
        page-break-inside: avoid; /* Try to keep heats together */
    }
    
    /* Avoid page breaks inside rows */
    tr {
        page-break-inside: avoid;
    }
    
    /* Add page break between rounds */
    .session-block {
        page-break-after: always;
    }
    
    /* Keep column widths consistent */
    .attempt-cell, .result-cell, .height-cell {
        min-width: 80px;
        width: 80px;
    }
    
    /* Ensure text alignment matches web view */
    .align-center {
        text-align: center;
    }
    
    .align-left {
        text-align: left;
    }
    
    /* Relay specific styling for print */
    .relay-team-row td {
        border-bottom: none;
    }
    
    .relay-athletes-row td {
        border-top: none;
        color: #666;
        font-size: 0.9em;
        font-style: italic;
    }

    /* Hide main tabs in print */
    .main-tabs-nav {
        display: none;
    }
    
    .round-type-container {
        display: block !important;
        page-break-after: always;
    }
    
    /* Wind info styling for print */
    .wind-info.legal {
        background-color: transparent !important;
        border-left: 2px solid #333;
        padding-left: 10px;
        color: #333 !important;
    }
    
    .wind-info.illegal {
        background-color: transparent !important;
        border-left: 2px solid #333;
        padding-left: 10px;
        color: #333 !important;
    }
    
    .wind-info.neutral {
        background-color: transparent !important;
        border-left: 2px solid #333;
        padding-left: 10px;
        color: #333 !important;
    }
}

@media screen and (max-width: 480px) {
    .logo-image {
        max-height: 50px;
    }
}

/* Ensure text wrapping on very small screens */
@media screen and (max-width: 360px) {
    .schedule-table td {
        word-break: break-word;
    }
}

/* Main tabs for round types */
.main-tabs-nav {
    display: flex;
    gap: 0.25rem;
    border-bottom: 3px solid #2B2B2B;
    margin-top: 1rem;
    margin-bottom: 1.25rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    padding-bottom: 1px;
}

.main-tab-button {
    padding: 0.625rem 1.25rem;
    background-color: #f3f4f6;
    border: none;
    cursor: pointer;
    font-weight: 500;
    border-radius: 4px 4px 0 0;
    white-space: nowrap;
}

.main-tab-button:hover {
    background-color: #e5e7eb;
}

.main-tab-button.active {
    background-color: #2B2B2B;
    color: white;
}
/* Add these styles to your styles.css file */


/* Points column styling */
.points-column {
    text-align: center;
    color: #2196F3;
    font-weight: bold;
    width: 80px;
}


/* PDF button container */
.pdf-container {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
    margin-bottom: 20px;
}

/* PDF button styling - matches the system's existing button style */
.pdf-button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 15px;
    background-color: #2B2B2B;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.pdf-button:hover {
    background-color: #444;
}

.pdf-button svg {
    margin-right: 4px;
}

/* Make sure the button stays visible in all contexts */
@media screen and (max-width: 768px) {
    .pdf-container {
        justify-content: center;
    }
}

/* Don't show the button when printing */
@media print {
    .pdf-container {
        display: none;
    }
}

/* Make the standard heat tabs visually distinct from main tabs */
.tabs-nav {
    border-bottom: 2px solid #999;
    margin-left: 1rem;
    margin-right: 1rem;
}

.site-footer {
    background-color: #f8f9fa;
    padding: 15px 0;
    margin-top: 30px;
    border-top: 1px solid #eee;
}

.footer-logo-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.footer-text {
    color: #666;
    font-size: 0.9rem;
    text-align: center;
}
/* Configuration button styling */
.config-btn { 
    background-color: #FF7F50; 
}

.config-btn:hover { 
    background-color: #FF6347; 
}

/* Toggle switch improvements */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    margin-right: 15px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #FF7F50;
}

input:focus + .slider {
    box-shadow: 0 0 1px #FF7F50;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Adjust for print mode */
@media print {
    .site-footer {
        display: none;
    }
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
    .main-tab-button {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .tabs-nav {
        margin-left: 0.5rem;
        margin-right: 0.5rem;
    }
}