/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Comic Sans MS', sans-serif;
    color: #2f1e2f;
}

/* 70s-inspired background with purple accents */
body {
    background: linear-gradient(135deg, #8c5523, #800080);
    background-image: url("A100 drawbars rectangle.png");
    background-repeat: no-repeat;
    background-position: center;
    background-attachment: fixed;
    background-size: 100%;
}

/* Header styling */
header {
    background: black;
    padding: 0.2rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

h1 {
    font-family: 'Harlow Solid Italic', 'Comic Sans MS', 'Edwardian Script ITC', cursive;
    color: rgb(256, 210, 0);
    font-size: 90px;
    text-shadow: 3px 3px #2f1e2f;
    margin-bottom: 1rem;
    letter-spacing: 3px;
}

/* Navigation styling */
nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    background: rgba(196, 100, 0, 0.2);
    padding: 0.5rem;
    border-radius: 5px;
    border: 2px solid rgb(230, 134, 249);
}

nav ul li {
    margin: 0 0.5rem;
    font-size: 1.2rem;
    text-transform: uppercase;
}

nav ul li a {
    color: rgb(230, 134, 249);
    text-decoration: none;
    font-family: 'Oswald', sans-serif;
    font-weight: bold;
    padding: 0.5rem 1rem;
    transition: background 0.3s ease, color 0.3s ease;
}

nav ul li a:hover {
    background: #ff4500;
    color: #fff;
    border-radius: 5px;
}

nav ul li a.active {
    background: rgb(148, 0, 211);
    color: #fff;
    border-radius: 5px;
}

nav ul li .separator {
    color: rgb(230, 134, 249);
    font-weight: bold;
}

/* Main content */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 1rem;
    background: rgba(255, 230, 210, 0.85);
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 3px solid rgb(75, 0, 130);
    padding-bottom: 60px;
}

.hero {
    text-align: center;
    padding: 3rem 1rem;
}

h2 {
    font-family: 'Comic Sans MS', 'Harlow Solid Italic', 'Edwardian Script ITC', cursive;
    color: rgb(255, 0, 0);
    font-size: 35px;
    text-shadow: 2px 2px #2f1e2f;
    margin-bottom: 1rem;
    text-align: center;
}

p {
    font-family: 'Tahoma', sans-serif;
    color: rgb(7, 140, 42);
    font-size: 20px;
    line-height: 1.6;
    text-align: center;
}

/* Table styling for Dates page */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background: #f5f5dc;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border: 2px solid rgb(75, 0, 130);
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid rgb(230, 134, 249);
}

th {
    background: rgb(148, 0, 211);
    color: #fff;
    font-family: 'Harlow Solid Italic', 'Edwardian Script ITC', cursive;
    font-size: 1.3rem;
}

td {
    font-family: 'Tahoma', sans-serif;
    font-size: 1rem;
    color: rgb(7, 140, 42);
}

/* Column widths */
th:nth-child(1), td:nth-child(1) { width: 25%; }
th:nth-child(2), td:nth-child(2) { width: 10%; }
th:nth-child(3), td:nth-child(3) { width: 20%; }
th:nth-child(4), td:nth-child(4) { width: 20%; }
th:nth-child(5), td:nth-child(5) { width: 20%; }

/* Link styles */
a:link, a:visited {
    font-family: 'Tahoma', sans-serif;
    font-size: 20px;
    color: rgb(230, 134, 249);
}
a:hover {
    font-family: 'Tahoma', sans-serif;
    font-size: 20px;
    color: rgb(255, 0, 0);
}
a:active {
    font-family: 'Tahoma', sans-serif;
    font-size: 20px;
    color: rgb(97, 134, 249);
}

/* Highlight styles */
mark {
    background-color: black;
    color: rgb(230, 134, 249);
}

/* Footer styling */
footer {
    background: rgba(75, 0, 130, 0.8);
    color: rgb(230, 134, 249);
    text-align: center;
    padding: 0.2rem;
    font-family: 'Tahoma', sans-serif;
    font-size: 0.7rem;
    border-top: 3px solid rgb(230, 134, 249);
    width: 100%;
    position: fixed;
    bottom: 0;
    left: 0;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    overflow: auto;
}

.modal-content {
    background-color: #f5f5dc;
    padding: 20px;
    border: 2px solid #800080;
    width: 90%;
    max-width: 700px;
    min-height: 300px;
    text-align: center;
    font-family: "Times New Roman", Times, serif;
    color: #800080;
    position: relative;
    border-radius: 10px;
}

.modal-content h2 {
    font-size: 50px;
    margin-bottom: 1rem;
}

.popup-image {
    max-width: 100%;
    height: auto;
    margin: 1rem auto;
    display: block;
    border: 2px solid #800080;
    border-radius: 5px;
}

.modal-content p {
    font-size: 25px;
    margin-bottom: 1rem;
    max-width: 100%;
    min-height: 100%;
}

.close {
    position: absolute;
    top: 10px;
    right: 15px;
    color: #800080;
    font-size: 28px;
    font-weight: bold;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1100; /* Ensure button is above modal content */
}

.close:hover,
.close:focus {
    color: #ff4500;
}

/* Prevent body layout shifts */
body {
    margin: 0;
    overflow: auto;
    width: 100%;
    box-sizing: border-box;
}

/* Responsive design for portrait devices (e.g., cell phones) */
@media screen and (orientation: portrait) and (max-width: 768px) {
    body {
        background-size: cover;
        background-position: top center;
    }

    h1 {
        font-size: 40px;
        letter-spacing: 2px;
    }

    nav ul {
        flex-direction: column;
        padding: 0.3rem;
    }

    nav ul li {
        margin: 0.2rem 0;
        font-size: 0.9rem;
    }

    nav ul li a {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }

    .hero {
        padding: 1.5rem 0.5rem;
    }

    h2 {
        font-size: 24px;
    }

    p {
        font-size: 16px;
        padding: 0 0.5rem;
    }

    main {
        margin: 1rem;
        padding: 0.5rem;
        padding-bottom: 70px;
    }

    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        font-size: 0.8rem;
    }

    th, td {
        padding: 0.5rem;
        min-width: 100px;
    }

    th:nth-child(1), td:nth-child(1) { width: 28%; }
    th:nth-child(2), td:nth-child(2) { width: 13%; }
    th:nth-child(3), td:nth-child(3) { width: 18%; }
    th:nth-child(4), td:nth-child(4) { width: 18%; }
    th:nth-child(5), td:nth-child(5) { width: 13%; }

    .modal-content {
        width: 95%;
        max-width: 90vw;
        min-height: 200px;
        max-height: 90%;
        padding: 15px;
    }

    .modal-content h2 {
        font-size: 30px;
    }

    .modal-content p {
        font-size: 18px;
    }

    .popup-image {
        max-width: 70%;
    }

    .close {
        font-size: 24px;
        top: 10px;
        right: 15px;
    }

    footer {
        font-size: 0.6rem;
        padding: 0.3rem;
    }
}

/* Responsive design for smaller portrait devices */
@media screen and (orientation: portrait) and (max-width: 480px) {
    h1 {
        font-size: 32px;
        letter-spacing: 1px;
    }

    nav ul li {
        font-size: 0.8rem;
    }

    nav ul li a {
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
    }

    h2 {
        font-size: 20px;
    }

    p {
        font-size: 14px;
    }

    table {
        font-size: 0.7rem;
    }

    th, td {
        padding: 0.4rem;
        min-width: 80px;
    }

    .modal-content {
        width: 98%;
        padding: 10px;
    }

    .modal-content h2 {
        font-size: 24px;
    }

    .modal-content p {
        font-size: 16px;
    }

    .popup-image {
        max-width: 60%;
    }

    .close {
        font-size: 22px;
        top: 8px;
        right: 12px;
    }
}

/* Ensure landscape devices use original styles */
@media screen and (orientation: landscape) {
    /* Original styles are applied by default */
}