:root { --f1-red: #e10600; --f1-dark: #1f1f27; }
body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background: #111; color: white; padding: 20px; }

.header-container { position: relative; border-bottom: 2px solid var(--f1-red); margin-bottom: 10px; padding-bottom: 10px; }

.btn-add-main { 
    position: absolute; right: 0; top: 10px; 
    background: var(--f1-red); color: white; border: none; 
    padding: 10px 20px; font-weight: bold; border-radius: 4px; 
}

/* Search Bar Styling */
#search-container { margin-bottom: 20px; }
#event-search { 
    width: 100%; padding: 12px; background: #222; color: white; 
    border: 1px solid #444; border-radius: 4px; box-sizing: border-box;
    font-size: 1rem;
}

.event-row { display: flex; justify-content: space-between; align-items: center; padding: 12px; border-bottom: 1px solid #333; transition: background 0.2s; }
.event-row.hidden { display: none; }
.event-row:hover { background: #1a1a1a; }

#race-selector-container {
    margin-bottom: 16px;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
#race-selector-container label {
    font-weight: bold;
    color: #ddd;
}
#race-select {
    min-width: 320px;
    max-width: 100%;
    padding: 10px;
    background: #222;
    color: white;
    border: 1px solid #444;
    border-radius: 4px;
}
#end-race-btn {
    background: #d32f2f;
    color: #fff;
    margin-left: auto;
}
#end-race-btn:disabled {
    opacity: 0.7;
    cursor: wait;
}
#leaderboard-container {
    margin-top: 22px;
    border-top: 1px solid #333;
    padding-top: 16px;
}
#leaderboard-container h2 {
    margin: 0 0 8px 0;
    font-size: 1.15rem;
}
#leaderboard-status {
    color: #bbb;
    font-size: 0.9rem;
    margin-bottom: 10px;
}
#leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    background: #171717;
    border: 1px solid #333;
    display: none;
}
#leaderboard-table th, #leaderboard-table td {
    padding: 10px;
    border-bottom: 1px solid #2b2b2b;
    text-align: left;
}
#leaderboard-table th {
    color: #ddd;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: #1d1d1d;
}
#leaderboard-table td:last-child,
#leaderboard-table th:last-child {
    text-align: right;
}

button { padding: 8px 15px; cursor: pointer; border: none; border-radius: 4px; font-weight: bold; }
.btn-on { background: #ffc107; color: black; } 
.btn-mark { background: #444; color: white; }

.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); align-items: center; justify-content: center; }
.modal-content { background: var(--f1-dark); padding: 30px; border: 2px solid var(--f1-red); border-radius: 8px; width: 90%; max-width: 400px; }
.modal-content input { width: 100%; padding: 12px; margin: 15px 0; background: #111; color: white; border: 1px solid #444; box-sizing: border-box; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }
#top-nav {
    margin-bottom: 20px;
    display: flex;
    justify-content: flex-start;
}

#home-link {
    display: inline-flex;
    align-items: center;
    background-color: var(--f1-red);
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px; /* The rounded look */
    font-size: 0.85rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background-color 0.2s ease, transform 0.1s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#home-link:hover {
    background-color: #ff1e18; /* A slightly brighter red on hover */
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(225, 6, 0, 0.3);
}

#home-link:active {
    transform: translateY(0);
}

/* Optional: styling the arrow specifically */
#home-link span {
    margin-right: 8px;
    font-size: 1.1rem;
    line-height: 0;
}
/* New Action Buttons */
.event-actions { display: flex; gap: 8px; }
.btn-edit { background: #19629e; color: white; font-size: 0.8rem; }
.btn-delete { background: #d32f2f; color: white; font-size: 0.8rem; }
.btn-edit:hover { background: #1e73be; }
.btn-delete:hover { background: #f44336; }

/* Adjusting the event row for more buttons */
.event-row { gap: 10px; }