:root {
    --color-bg: #fdfdfb;
    --color-surface: #ffffff;
    --color-border: #e0e0e0;
    --color-text: #151f24;
    --color-muted: #4a4a4a;
    --color-accent: #153243;
    --color-accent-light: #5a7282;
    --color-danger: #ca2f1f;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
    font-family: "Montserrat", "Segoe UI", sans-serif;
}

a {
    color: var(--color-accent);
}

header.site-header,
footer.site-footer {
    min-height: calc(1.25rem * 1.5 + 2rem);
}

header.site-header {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--color-accent-light);
    border-bottom: 1px solid var(--color-border);
    color: #fff;
    position: relative;
}

header.site-header h1 {
    margin: 0;
    font-size: 1.25rem;
    position: relative;
    z-index: 1;
}

header.site-header nav {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0 1rem;
}

header.site-header nav a {
    text-decoration: none;
    color: #fff;
    white-space: nowrap;
}

.header-logout {
    margin-left: auto;
    text-decoration: none;
    color: #fff;
    white-space: nowrap;
    position: relative;
    z-index: 1;
}

main {
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 1.5rem;
    flex: 1;
}

footer.site-footer {
    background: var(--color-accent-light);
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--color-border);
}

.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.match-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.match-list a.match-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.match-list a.match-link:hover .card {
    border-color: var(--color-accent);
}

.match-meta {
    color: var(--color-muted);
    font-size: 0.9rem;
}

.news-author {
    margin: 0.5rem 0 0;
    font-size: 0.85rem;
    color: var(--color-muted);
    text-align: right;
}

.match-team {
    margin: 0 0 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-accent-light);
}

form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 480px;
}

label {
    font-weight: 600;
    font-size: 0.9rem;
}

input, textarea {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    color: var(--color-text);
    padding: 0.5rem;
    font-size: 1rem;
    font-family: inherit;
}

button, .button {
    background: var(--color-accent);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 0.6rem 1.2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    width: fit-content;
}

button.button-small, .button.button-small {
    padding: 0.3rem 0.6rem;
    font-size: 0.85rem;
}

button.danger, .button.danger {
    background: var(--color-danger);
}

.error {
    color: var(--color-danger);
    font-weight: 600;
}

.flash {
    background: #e9f7ef;
    border: 1px solid #18a957;
    color: #0f5132;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

video {
    width: 100%;
    border-radius: 8px;
    background: #000;
}

.timeline {
    margin-top: 1rem;
    background: #dde4e8;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.timeline-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.timeline-label {
    width: 90px;
    flex-shrink: 0;
    align-self: stretch;
}

.timeline-label:hover {
    opacity: 0.85;
}

.timeline-track {
    position: relative;
    flex: 1;
    height: 1.25rem;
    background: #cfd8dc;
    border: 1px solid #b0bec5;
    border-radius: 4px;
    overflow: hidden;
}

.timeline-segment {
    position: absolute;
    top: 0;
    bottom: 0;
    cursor: pointer;
    opacity: 0.85;
}

.timeline-segment:hover {
    opacity: 1;
}

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 100;
}

.modal-overlay.open {
    display: flex;
}

.modal-content {
    background: var(--color-accent-light);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1rem;
    width: 100%;
    max-width: 900px;
    color: #fff;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.modal-header h3 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    text-align: left;
    padding: 0.5rem;
    border-bottom: 1px solid var(--color-border);
}

.user-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    margin-top: 0.4rem;
}

.user-actions form {
    display: contents;
}

.user-actions label {
    font-weight: normal;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.user-actions button {
    text-align: center;
}

.edit-icon {
    margin-left: 0.4rem;
    text-decoration: none;
}

.teams-card details > summary,
.teams-card form button[type="submit"]:not(.danger),
.new-member-card form button[type="submit"] {
    background: var(--color-accent-light);
}

details > summary {
    background: var(--color-accent);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 0.6rem 1.2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-block;
    width: fit-content;
    list-style: none;
}

details > summary::-webkit-details-marker {
    display: none;
}

details ul {
    margin: 0.5rem 0 0;
    padding-left: 1.25rem;
}

.inline-form {
    display: inline-block;
    max-width: none;
}

select {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    color: var(--color-text);
    padding: 0.5rem;
    font-size: 1rem;
    font-family: inherit;
}

.home-columns {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.home-column {
    flex: 1;
    min-width: 0;
}

@media (max-width: 700px) {
    .home-columns {
        flex-direction: column;
    }
}

.attendance-row {
    margin-top: 0.75rem;
}

.attendance-form {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0.4rem;
    max-width: none;
}

.attendance-btn {
    padding: 0.3rem 0.7rem;
    font-size: 0.8rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    background: var(--color-bg);
    color: var(--color-text);
    cursor: pointer;
    font-family: inherit;
}

.attendance-btn.attendance-active.aanwezig {
    background: #2a7a2a;
    border-color: #2a7a2a;
    color: #fff;
}

.attendance-btn.attendance-active.afwezig {
    background: #b83232;
    border-color: #b83232;
    color: #fff;
}

.attendance-btn.attendance-active.misschien {
    background: #b07a00;
    border-color: #b07a00;
    color: #fff;
}

.upload-progress {
    height: 0.6rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    overflow: hidden;
}

.upload-progress-bar {
    height: 100%;
    width: 0;
    background: var(--color-accent);
    transition: width 0.2s ease;
}
