* {
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #ffffff; /* Changed to white for a patriotic background */
    padding: 20px;
    margin: 0;
    font-size: 16px;
}

/* Main content container */
body::before {
    content: '';
}

h1 {
    color: #B22234; /* American flag red */
    text-align: left;
    font-size: 2.5em;
    margin: 20px auto;
    max-width: 700px;
}

.intro {
    max-width: 700px;
    margin: 0 auto 30px;
    text-align: center;
}

.intro > p,
.intro ul,
.intro ol {
    text-align: left;
    margin: 0.5em auto;
    max-width: 660px;
    width: 100%;
}

.intro ul,
.intro ol {
    padding-left: 1.25em;
}

.intro li {
    margin-bottom: 0.35em;
}

.section-heading {
    font-weight: 700;
    margin-top: 1em;
    margin-bottom: 0.35em;
}

form {
    max-width: 700px;
    margin: 0 auto 30px;
}

.form-group {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

button[type="submit"] {
    width: 100%;
    background-color: #B22234; /* Red submit button */
    color: white;
    font-weight: bold;
    font-size: 1em;
    letter-spacing: 1px;
    padding: 10px;
    height: auto;
    line-height: normal;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button[type="submit"]:hover,
button[type="submit"]:active {
    background-color: #0047AB; /* Blue on hover or click */
}

a.button, 
button.button,
button[type="submit"].button {
    display: inline-block;
    width: auto;
    padding: 10px 15px;
    background-color: #0047AB; /* American flag blue */
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

a.button:hover, 
button.button:hover,
button[type="submit"].button:hover {
    background-color: #B22234; /* Red on hover */
}

.patriotic.red {
    color: #B22234; /* American flag red */
}

.patriotic.blue {
    color: #0047AB; /* American flag blue */
}

.error {
    color: #B22234;
    font-weight: bold;
    text-align: center;
    margin: 15px 0;
}

.location-info {
    margin-top: 1em;
}

.button-section {
    margin-top: 2em;
    text-align: center;
}

label {
    display: block;
    margin-bottom: 5px;
    color: #0047AB; /* Blue for label text */
}

input[type="text"],
select {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #B22234; /* Red border */
    border-radius: 4px;
    box-sizing: border-box;
}

.table-container {
    overflow-x: auto;
    max-width: 700px;
    margin: 0 auto;
}

.responsive-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    table-layout: fixed;
    border: 1px solid #ccc;
}

.responsive-table th, .responsive-table td {
    padding: 6px 8px;
    text-align: left;
    vertical-align: top;
    line-height: 1.4;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal; /* Allow wrapping */
    border: 1px solid #ddd;
}

.responsive-table tbody tr:nth-child(odd) {
    background-color: #fafafa;
}

.responsive-table th {
    background-color: #B22234; /* Red table header */
    color: white;
}

/* RSVP list table widths */
.three-column-table th:nth-child(1),
.three-column-table td:nth-child(1) {
    width: 35%;
}

.three-column-table th:nth-child(2),
.three-column-table td:nth-child(2) {
    width: 20%;
}

.three-column-table th:nth-child(3),
.three-column-table td:nth-child(3) {
    width: 45%;
}

/* Admin table widths */
.admin-table th:nth-child(1),
.admin-table td:nth-child(1) {
    width: 22%;
}

.admin-table th:nth-child(2),
.admin-table td:nth-child(2) {
    width: 20%;
}

.admin-table th:nth-child(3),
.admin-table td:nth-child(3) {
    width: 12%;
}

.admin-table th:nth-child(4),
.admin-table td:nth-child(4) {
    width: 30%;
}

.admin-table th:nth-child(5),
.admin-table td:nth-child(5) {
    width: 16%;
}

@media (max-width: 600px) {
    body {
        padding: 12px;
        font-size: 14px;
    }

    h1 {
        font-size: 1.8em;
        margin: 15px 0;
    }

    h2 {
        font-size: 1.3em;
    }

    input[type="text"], select, button[type="submit"] {
        font-size: 16px; /* Prevents zoom-in on iOS */
        padding: 12px;
    }

    button[type="submit"] {
        padding: 12px;
    }

    .intro {
        margin-bottom: 20px;
    }

    form {
        margin-bottom: 20px;
    }

    th, td {
        padding: 5px 3px;
        font-size: 12px;
    }

    /* More aggressive mobile column sizing */
    th:nth-child(1), 
    td:nth-child(1) {
        width: 28%;
    }

    th:nth-child(2), 
    td:nth-child(2) {
        width: 12%;
    }

    th:nth-child(3), 
    td:nth-child(3) {
        width: 60%;
        word-break: break-word;
        overflow-wrap: break-word;
    }

    .table-container {
        margin: 20px auto;
    }

    a.button, 
    button.button,
    button[type="submit"].button {
        width: 100%;
        text-align: center;
        padding: 12px;
    }
}

@media (min-width: 601px) and (max-width: 1024px) {
    body {
        padding: 16px;
    }

    h1 {
        font-size: 2.2em;
    }

    .intro, form, .table-container {
        max-width: 600px;
    }
}

@media (min-width: 1025px) {
    body {
        padding: 30px;
    }

    h1 {
        font-size: 2.5em;
    }

    .intro, form, .table-container {
        max-width: 700px;
    }
}
