/* Basic page formatting */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: Arial, Helvetica, sans-serif;
    background-color: #eef2f7;
    color: #1f2937;
    line-height: 1.6;
}

header {
    background-color: #1e3a5f;
    color: white;
    text-align: center;
    padding: 35px 20px;
}

header h1 {
    margin: 0 0 10px;
}

header p {
    max-width: 750px;
    margin: 0 auto;
}

main {
    width: 90%;
    max-width: 1000px;
    margin: 30px auto;
}

.card {
    background-color: white;
    margin-bottom: 30px;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
}

h2 {
    color: #1e3a5f;
    border-bottom: 2px solid #dbe4ee;
    padding-bottom: 8px;
}


/* General table formatting */

table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px auto;
}

caption {
    font-size: 1.15rem;
    font-weight: bold;
    margin-bottom: 10px;
    color: #334155;
}

th,
td {
    border: 1px solid #64748b;
    padding: 12px;
}

th {
    background-color: #1e3a5f;
    color: white;
    text-align: center;
}

.schedule-table td,
.student-table td {
    text-align: center;
}

.schedule-table tbody tr:nth-child(even),
.student-table tbody tr:nth-child(even) {
    background-color: #edf4fa;
}

.schedule-table tbody tr:hover,
.student-table tbody tr:hover {
    background-color: #dbeafe;
}


/* Image table formatting */

.image-table img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
}

.center-cell {
    text-align: center;
    vertical-align: middle;
}

.top-cell {
    text-align: left;
    vertical-align: top;
}

.right-cell {
    text-align: right;
    vertical-align: bottom;
}


/* Tic-Tac-Toe formatting */

.tic-tac-toe {
    width: 300px;
    height: 300px;
    border-collapse: collapse;
}

.tic-tac-toe td {
    width: 100px;
    height: 100px;
    border: 5px solid #1e3a5f;
    text-align: center;
    vertical-align: middle;
    font-size: 3rem;
    font-weight: bold;
    color: #1e3a5f;
    padding: 0;
}

.board-note {
    text-align: center;
    font-style: italic;
}


/* Form formatting */

form {
    max-width: 800px;
    margin: auto;
}

fieldset {
    border: 2px solid #94a3b8;
    border-radius: 8px;
    margin-bottom: 22px;
    padding: 20px;
}

legend {
    color: #1e3a5f;
    font-size: 1.15rem;
    font-weight: bold;
    padding: 0 8px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group > label,
.form-group > p {
    display: block;
    margin: 0 0 7px;
    font-weight: bold;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #94a3b8;
    border-radius: 5px;
    font-family: inherit;
    font-size: 1rem;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #60a5fa;
    border-color: #2563eb;
}

.inline-label,
.checkbox-label {
    display: inline-block;
    margin-right: 20px;
    margin-bottom: 8px;
}

input[type="color"] {
    width: 80px;
    height: 45px;
    border: none;
    cursor: pointer;
}

input[type="range"] {
    width: 60%;
    vertical-align: middle;
}

meter {
    width: 60%;
    height: 25px;
    vertical-align: middle;
}

.button-area {
    text-align: center;
}

input[type="submit"],
input[type="reset"] {
    border: none;
    border-radius: 5px;
    padding: 12px 24px;
    margin: 5px;
    font-size: 1rem;
    cursor: pointer;
}

input[type="submit"] {
    background-color: #1e3a5f;
    color: white;
}

input[type="reset"] {
    background-color: #dbe4ee;
    color: #1f2937;
}

input[type="submit"]:hover {
    background-color: #315b86;
}

input[type="reset"]:hover {
    background-color: #c3d2e2;
}


/* Footer formatting */

footer {
    background-color: #1e3a5f;
    color: white;
    text-align: center;
    padding: 15px;
}


/* Mobile formatting */

@media screen and (max-width: 650px) {
    main {
        width: 96%;
    }

    .card {
        padding: 15px;
        overflow-x: auto;
    }

    th,
    td {
        padding: 8px;
    }

    .tic-tac-toe {
        width: 240px;
        height: 240px;
    }

    .tic-tac-toe td {
        width: 80px;
        height: 80px;
        font-size: 2.2rem;
    }

    .inline-label,
    .checkbox-label {
        display: block;
    }

    input[type="range"],
    meter {
        width: 100%;
    }
}