:root {
    --primary-color: #1c3144;           /* Primary dark color for text and headers */
    --secondary-color: #E0E2DB;         /* Accent light color for text on dark backgrounds */
    --background-color: #B8BDB5;        /* Overall background color */
    --muted-color: #D2D4C8;             /* Secondary/muted background */
    --border-color: #889696;            /* Borders and table accents */
}

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--primary-color);
    padding: 0;
    overflow-x: hidden;

    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
}

a {
    color: var(--primary-color);
    text-decoration: underline;
}

main a {
    text-decoration: none;
    padding: 7px;
}

.itis-link {
    color: var(--primary-color);
    text-align: center;
    padding: 10px;
    font-size: 20px;
    display: block;
    width: fit-content;
    margin: 0 auto;
    text-decoration: underline;
    font-weight: 600;
}

.primary-link {
    color: var(--secondary-color);
}

main a:hover {
    color: black;
}

hr {
    width: 50%;
    background-color: var(--border-color);
    height: 1px;
    border: none;
}

/* Header and Footer */
header, footer {
    background-color: var(--primary-color);
    padding: 20px;
    margin: -10px;
    text-align: center;
}

header img {
    width: 10%;
    max-height: 75px;
    max-width: 75px;
    position: absolute;
    left: 10px;
    padding-top: 20px;
}

footer {
    margin-top: auto;
}

h1 {
    color: var(--secondary-color);
}

footer p {
    color: var(--secondary-color);
    font-size: 12px;
    opacity: 0.8;
}

/* Typography */
h2 {
    color: var(--primary-color);
    text-align: center;
}

h3 {
    color: var(--primary-color);
}

main p {
    color: var(--primary-color);
    border-radius: 25px;
    text-align: left;
}

.center-p {
    text-align: center;
    font-weight: 475;
}

@media screen and (min-width: 768px) {
    main p {
        font-size: 20px;
    }
}

/* Containers */
.page-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.content-wrap {
    flex: 1;
}

/* Main Content */
main {
    box-sizing: border-box;
    height: 100%;
    padding: 10px 20px;
    overflow: hidden;
    max-width: 1200px; 
    width: 90%; 
    margin: 0 auto; 

    flex: 1;
}

    /* Tablet View (min-width: 768px) */
@media screen and (min-width: 768px) and (max-width: 1024px) {
    main {
        width: 95%; 
    }
    main p {
        font-size: 18px; 
    }
}

    /* Mobile View (max-width: 767px) */
@media screen and (max-width: 767px) {
    main {
        box-sizing: border-box;
        width: 100%; 
        padding: 5px; 
    }
    header img, footer img {
        width: 50px; 
    }
    main p {
        font-size: 16px; 
    }
}

.car-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.crap-link, .about-company {
    color: var(--primary-color);
    text-align: center;
    padding: 10px;
    font-size: 20px;
}

.ibex-image {
    width: 30%;
    display: block;
    margin-left: auto;
    margin-right: auto;
    border-radius: 15px;
}

.comp-img {
    width: 50%;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* Table Styling */
table {
    border-collapse: collapse;
    width: 100%;
    border: 1px solid var(--border-color);
}

th {
    background-color: var(--primary-color);
    color: var(--secondary-color);
    border: 1px solid var(--border-color);
}

td {
    border: 1px solid var(--border-color);
    padding: 8px;
}

tr:nth-child(even) {
    background-color: var(--muted-color);
}

tr:nth-child(odd) {
    background-color: var(--background-color);
}

tr:hover {
    background-color: var(--border-color);
}

/* Forms */
.contact-form {
    max-width: 600px;
    margin: 2rem auto;
    padding: 20px;
    background-color: var(--muted-color);
    border-radius: 8px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.form-group input[type="text"],
.form-group input[type="tel"],
.form-group input[type="email"],
.form-group select {
    box-sizing: border-box;
    width: 100%;
    padding: 8px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
}

button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    margin-right: 10px;
    background-color: var(--primary-color);
    color: var(--secondary-color);
}

.submit-btn, .reset-btn {
    background-color: var(--primary-color);
    color: var(--secondary-color);
}

.form-group label input[type="checkbox"],
.form-group label input[type="radio"] {
    margin-right: 8px;
}

.form-buttons {
    margin-top: 2rem;
}

.byo-form input[type="text"],
.byo-form input[type="file"],
.byo-form textarea {
    width: 100%;
    max-width: 400px;
    box-sizing: border-box;
}

.byo-form label {
    display: inline-block;
    width: 150px;
    text-align: right;
    margin-right: 10px;
    vertical-align: top;
}

.byo-form label,
.byo-form input[type="text"],
.byo-form input[type="file"],
.byo-form textarea,
#course-container {
    margin-bottom: 15px; 
}

button[type="submit"],
button[type="reset"] {
    margin-top: 20px; 
}

#course-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-left: 160px;
    gap: 10px; 
}

.course-entry {
    display: flex;
    align-items: center;
    gap: 10px; 
}

.course-entry input[type="text"] {
    width: 300px;
}

#add-course {
    align-self: flex-start;
    margin-top: 10px;
}

#agreement {
    vertical-align: middle;
    margin-right: 5px;
}

label[for="agreement"] {
    display: inline-flex;
    align-items: center;
    margin-left: 160px;
    white-space: nowrap;
}

#agreement {
    vertical-align: middle;
    margin-right: 5px;
}

label[for="agreement"] {
    display: inline-flex;
    align-items: center;
    margin-left: 160px; 
    white-space: nowrap;
}

.button-container {
    display: flex;
    justify-content: center;
    gap: 10px; 
    margin-top: 20px; 
}

/* Form Styling */
#user-info-form {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    max-width: 400px;
    margin: 0 auto;
}

#user-info-form label,
#user-info-form input {
    width: 100%;
    margin-bottom: 10px;
}

#favorite-number {
    margin-bottom: 10px;
    width: 100%;
}

#user-info-form button, 
#favorite-number + button {
    align-self: center;
    width: 100%;
    max-width: 150px;
}

/* First Scripts Page */

#first-scripts-page {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#first-scripts-page form, #first-scripts-page #favorite-number, 
#first-scripts-page #greeting, #first-scripts-page #ibex-image-container {
    width: 300px;
    margin: 0 auto;
    text-align: center;
}

#first-scripts-page #favorite-number {
    width: 26%;
}

#first-scripts-page button {
    margin: 5px;
}

#first-scripts-page #surprise-features-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

#first-scripts-page #surprise-features-container button {
    flex: 1;
    padding: 10px;
    font-size: 1rem;
}

#ibex-image {
    display: none;
    max-width: 100%;
    height: auto;
}

/* Images */
.cert-image {
    width: 60%;
    height: 100%;
    object-fit: cover;
}

.cert-link {
    text-decoration: underline;
    font-size: larger;
}

.slideshow-container {
    width: 80%;
    max-width: 800px;
    margin: 20px auto;
    position: relative;
}

.slideshow img {
    width: 100%;
    display: none;
}

.slideshow img.active {
    display: block;
}

.caption {
    text-align: center;
    font-size: 1.2em;
    margin-top: 10px;
}

.thumbnails {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.thumbnails img {
    width: 80px;
    height: auto;
    margin: 0 5px;
    cursor: pointer;
    box-sizing: border-box;
    border: 2px solid transparent;
}

.thumbnails img.active {
    border-color: var(--primary-color);
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    width: 100%;
    max-width: 800px;
    margin: 15px auto 0;
}

#prev-btn, #next-btn {
    padding: 10px 20px;
    font-size: 1em;
    cursor: pointer;
    border: none;
    background-color: var(--primary-color);
    color: white;
    border-radius: 5px;
}

#prev-btn:hover, #next-btn:hover {
    background-color: darkcyan;
}

.review-image {
    width: 40%;
    object-fit: cover;
    border-radius: 15px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}