@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&display=swap');

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Space Mono', monospace;
    background-color: #FFC800;
    color: #000;
    line-height: 1.6;
}

/* Header Image */
.header-image {
    width: 100%;
    padding-top: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.header-image img {
    width: 100%;
    height: auto;
    display: block;
    max-width: 100%;
}

/* Results Container */
.results-container {
    margin: 20px;
    padding: 20px;
}

.stage-grid {
    max-width: 100%;
    margin: 0 auto;
}

/* Stage Row */
.stage-row {
    margin-bottom: 7px;
    background-color: #FFFFFF;
    border: 3px solid #000;
    border-radius: 10px;
    overflow: hidden;
}

/* Stage Info */
.stage-info {
    display: grid;
    grid-template-columns: 100px 100px 100px 1fr;
    gap: 20px;
    padding: 15px;
    align-items: center;
}

.stage-number {
    font-weight: bold;
}

.stage-date {
    font-size: 0.9em;
}

.stage-type {
    font-style: italic;
}

.stage-route {
    text-align: right;
}

/* Results Button */
.results-button {
    width: 100%;
    padding: 10px;
    background-color: #000;
    color: #FFC800;
    border: none;
    border-top: 3px solid #000;
    cursor: pointer;
    font-family: 'Space Mono', monospace;
    font-size: 16px;
    transition: background-color 0.3s;
}

.results-button:hover {
    background-color: #333;
}

.results-button.active {
    background-color: #333;
}

/* Results Content */
.results-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background-color: #f8f8f8;
    padding: 0 15px;
}

.results-content.active {
    padding: 15px;
    border-top: 3px solid #000;
}

.results-text p {
    margin-bottom: 1em;
}

.results-text p:last-child {
    margin-bottom: 0;
}

.centered-image {
    display: block;
    margin: 20px auto;
    max-width: 100%;
    height: auto;
}

.image-container {
    width: 100%;
    text-align: center;
    margin: 20px 0;
}

/* Team Table Styles */
.team-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Space Mono', monospace;
    margin: 20px 0;
    background-color: #FFFFFF;
    border: 3px solid #000;
    border-radius: 10px;
    overflow: hidden;
}

.team-table th {
    background-color: #000;
    color: #FFC800;
    padding: 12px;
    text-align: left;
    font-weight: bold;
}

.team-table td {
    padding: 12px;
    border-bottom: 1px solid #ddd;
}

.team-table tr:last-child td {
    border-bottom: none;
}

.team-table tr:hover {
    background-color: #f8f8f8;
}

.team-name {
    font-weight: bold;
}

.team-points {
    color: #666;
    font-size: 0.9em;
}

.rider-list {
    list-style: none;
    padding: 0;
    margin: 5px 0;
}

.rider-list li {
    display: inline-block;
    margin-right: 20px;
    margin-bottom: 5px;
}

.rider-points {
    color: #666;
    font-size: 0.9em;
}

/* Points Table Styles */
.points-table {
    width: 100%;
    max-width: 800px;
    margin: 20px auto;
    border-collapse: collapse;
    font-family: 'Space Mono', monospace;
    background-color: #FFFFFF;
    border: 3px solid #000;
    border-radius: 10px;
    overflow: hidden;
}

.points-table th,
.points-table td {
    padding: 8px 16px;
    border-bottom: 1px solid #ddd;
}

.points-table th {
    background-color: #000;
    color: #FFC800;
    text-align: left;
    font-weight: bold;
}

.points-table tr:last-child td {
    border-bottom: none;
}

.points-table td:nth-child(1) {  /* Name column */
    width: 15%;
}

.points-table td:nth-child(2) {  /* Team column */
    width: 55%;
}

.points-table td:nth-child(3),   /* Day points column */
.points-table td:nth-child(4) {  /* Total points column */
    width: 15%;
}

.points-table .points {
    text-align: right;
    font-weight: bold;
}

/* Comments Section */
.comments-section {
    margin-top: 15px;
    border-top: 1px solid #ddd;
    padding-top: 15px;
}

.comments-container {
    margin-bottom: 15px;
}

.comment {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 10px;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.9em;
}

.comment-username {
    font-weight: bold;
    color: #333;
}

.comment-timestamp {
    color: #666;
}

.comment-text {
    color: #333;
    line-height: 1.4;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 10px;
}

.comment-input {
    width: 100%;
    padding: 8px;
    border: 2px solid #000;
    border-radius: 4px;
    font-family: 'Space Mono', monospace;
}

textarea.comment-input {
    min-height: 80px;
    resize: vertical;
}

.comment-submit {
    background-color: #000;
    color: #FFC800;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    cursor: pointer;
    font-family: 'Space Mono', monospace;
    transition: background-color 0.3s;
}

.comment-submit:hover {
    background-color: #333;
}

/* Admin Panel */
footer {
    padding: 20px;
    margin-top: 40px;
}

.admin-panel {
    display: flex;
    justify-content: flex-end;
    opacity: 0.5;
    transition: opacity 0.3s;
}

.admin-panel:hover {
    opacity: 1;
}

.admin-login, .admin-logout {
    display: flex;
    gap: 5px;
    justify-content: flex-end;
    align-items: center;
}

.admin-input {
    width: 100px;
    padding: 4px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: 'Space Mono', monospace;
    font-size: 12px;
}

.admin-button {
    background-color: #ccc;
    color: #333;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    transition: background-color 0.3s;
}

.admin-button:hover {
    background-color: #999;
}

.admin-status {
    color: #666;
    font-size: 12px;
}

.delete-comment {
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.8em;
    cursor: pointer;
    margin-left: 10px;
    font-family: 'Space Mono', monospace;
    transition: background-color 0.3s;
}

.delete-comment:hover {
    background-color: #c82333;
}

/* Responsive Design */
@media (max-width: 768px) {
    .stage-info {
        grid-template-columns: 1fr;
        gap: 5px;
    }
    
    .stage-route {
        text-align: left;
    }
    
    .results-container {
        margin: 10px;
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .stage-info {
        font-size: 14px;
    }
    
    .results-button {
        font-size: 14px;
    }
}
