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

body {
    font-family: Arial, sans-serif; /* Sans-serif for readability */
    font-size: 1.25rem; /* Base font size for accessibility */
    line-height: 1.5; /* Improved readability */
    color: #000000; /* Black text for high contrast */
    background-color: #FFFFFF; /* White background */
}

a {
    text-decoration: none; /* Remove underline for button-like appearance */
    color: inherit;
}

img {
    max-width: 100%; /* Responsive images */
    height: auto;
    display: block; /* Prevent extra space */
}

/* Theme colors: Black (#000000), Gold (#FFD700), White (#FFFFFF) */
:root {
    --color-primary: #000000; /* Black */
    --color-secondary: #E09900; /* Gold */
    --color-background: #FFFFFF; /* Pick */
    --color-text: #000000; /* Black text */
    --color-accent: #E09900; /* Gold accent */
}

/* Header styles */
header {
    background-color: var(--color-background); /* Black background */
    color: var(--color-background); /* White text */
    padding: 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

header a {
    color: var(--color-background); /* White links in header */
}

header h1 {
    font-size: 1.5rem;
    margin: 0 1rem;
    color: var(--color-background); /* White for readability */
}

header nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
}

header nav li {
    margin: 0.5rem;
}

header nav a {
    padding: 0.5rem 1rem;
    background-color: var(--color-secondary); /* Gold button */
    color: var(--color-primary); /* Black text */
    border: 2px solid var(--color-secondary); /* Gold border */
    border-radius: 4px; /* Rounded corners */
    transition: background-color 0.3s, color 0.3s; /* Smooth hover */
}

/* Link button styles */
a[href], button {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: var(--color-secondary); /* Gold background */
    color: var(--color-primary); /* Black text */
    border: 2px solid var(--color-secondary); /* Gold border */
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
    text-align: center;
}

/* Hover and focus states for accessibility */
a[href]:hover, a[href]:focus,
button:hover, button:focus {
    background-color: var(--color-primary); /* Invert: Black background */
    color: var(--color-secondary); /* Invert: Gold text */
    outline: 2px solid var(--color-accent); /* Visible focus */
}

/* Main content */
main {
    padding: 1rem;
    max-width: 1200px; /* Limit width for readability */
    margin: 0 auto;
}

/* Footer styles */
footer {
    background-color: var(--color-primary); /* Black background */
    color: var(--color-background); /* White text */
    text-align: center;
    padding: 1rem;
    margin-top: 1rem;
}

footer a {
    margin-left: 1rem;
}

/* Form styles for readability and accessibility */
form {
    display: flex;
    flex-direction: column;
    max-width: 600px;
    margin: 1rem auto;
}

label {
    margin-top: 0.5rem;
    font-weight: bold;
}

input, textarea, button {
    margin-top: 0.25rem;
    padding: 0.5rem;
    font-size: 1.25rem;
    border: 1px solid var(--color-primary); /* Black border */
    border-radius: 4px;
}

textarea {
    resize: vertical; /* Allow vertical resize */
}

button {
    margin-top: 1rem;
    width: auto;
    align-self: flex-start;
}

/* Table styles for admin panel */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

th, td {
    border: 1px solid var(--color-primary); /* Black borders */
    padding: 0.5rem;
    text-align: left;
}

th {
    background-color: var(--color-primary); /* Black header */
    color: var(--color-background); /* White text */
}

/* Responsive design */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: flex-start;
    }

    header nav ul {
        flex-direction: column;
    }

    header nav li {
        margin: 0.25rem 0;
    }

    main {
        padding: 0.5rem;
    }

    table {
        font-size: 1.25rem; /* Smaller text on mobile */
    }

    /* Stack table for mobile */
    table, thead, tbody, th, td, tr {
        display: block;
    }

    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    tr {
        border: 1px solid var(--color-primary);
        margin-bottom: 0.5rem;
    }

    td {
        border: none;
        border-bottom: 1px solid #eee;
        position: relative;
        padding-left: 50%;
    }

    td:before {
        position: absolute;
        top: 6px;
        left: 6px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        content: attr(data-label);
        font-weight: bold;
    }
}

/* Ensure high contrast ratios */
/* Black on white: 21:1 (passes) */
/* White on black: 21:1 (passes) */

/* Additional accessibility: Skip link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-secondary);
    color: var(--color-primary);
    padding: 8px;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}
