:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --bg-light: #ffffff;
    --bg-alt: #f1f5f9;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
}

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 0.5rem;
    justify-content: center;  
    align-items: center;}

.nav-brand {
    font-size: 1.5rem;
    margin-right: 2rem;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.main-menu {
    display: flex;
    gap: 2rem;
    row-gap: 0.5rem;
    flex-wrap: wrap;
}

.main-menu a {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: var(--transition);
    cursor: pointer;
}

.sub-menu {
    display: none;
    gap: 2rem;
}

.sub-menu.active {
    display: flex;
}

.sub-menu a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.85rem;
    transition: var(--transition);
}

.main-menu a:hover,
.sub-menu a:hover {
    color: var(--primary);
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

.hero {
    padding: 8rem 1rem 4rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 8rem 1rem 4rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.1;
}

h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
    position: relative;
}

.subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.section-container {
    padding: 5rem 1rem;
    transition: var(--transition);
    margin: 0 auto;
}

.section-container:nth-child(odd) {
    background-color: var(--bg-light);
}

.section-container:nth-child(even) {
    background-color: var(--bg-alt);
}

.section {
    max-width: 800px;
    margin: 0 auto;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.section.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
}

.section-icon {
    font-size: 1.5rem;
    color: var(--primary);
}

h2 {
    font-size: 2rem;
    color: var(--text-dark);
    font-weight: 700;
}

h3 {
    font-size: 1.25rem;
    color: var(--text-dark);
    margin: 1.5rem 0 1rem;
    font-weight: 600;
}

p {
    margin-bottom: 1.5rem;
    color: var(--text-light);
}

.red-text {
    color: red;
}

ul {
    list-style: none;
    margin-bottom: 1.5rem;
}

li {
    margin-bottom: 0.75rem;
    padding-left: 1.5rem;
    position: relative;
    color: var(--text-light);
}

li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--primary);
}

.scroll-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--primary);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    font-size: 1.5rem;
}

.scroll-top.visible {
    opacity: 1;
}

.scroll-top:hover {
    transform: translateY(-2px);
    background: var(--primary-dark);
}

.prevent-select {
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

/* For use with the tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}
th, td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
    vertical-align: top;
}
th {
    background-color: #f2f2f2;
    font-weight: bold;
}
.prerequisite {
    background-color: #e4cd68;
}
.table-section {
    background-color: #e6f2ff;
    font-weight: bold;
}
.example {
    font-style: italic;
    color: #666;
    font-size: 0.9em;
}
@media (max-width: 768px) {
    table {
        display: block;
        overflow-x: auto;
    }
}
/* For use with award categories */
.header {
    text-align: center;
    margin-bottom: 40px;
    border-bottom: 2px solid #2c3e50;
    padding-bottom: 20px;
}

.award-subtitle {
    font-style: italic;
    color: #7f8c8d;
    font-size: 18px;
}

.award-category {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 25px;
    overflow: hidden;
}
.award-header {
    background-color: #2c3e50;
    color: white;
    padding: 15px 20px;
    font-size: 20px;
    font-weight: bold;
}
.award-content {
    padding: 20px;
}
.description {
    margin-bottom: 15px;
    line-height: 1.6;
}
.criteria {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 5px;
    border-left: 4px solid #3498db;
}
.criteria h4 {
    margin-top: 0;
    color: #3498db;
}
.criteria ul {
    margin-bottom: 0;
    padding-left: 20px;
}
.trophy-icon {
    margin-right: 10px;
    color: #f1c40f;
}

/* Style the form element with a border around it */
form {
    border: 4px solid #f1f1f1;
}

/* Add some padding and a grey background color to containers */
.container {
    padding: 20px;
    background-color: #f1f1f1;
}

/* Style the input elements and the submit button */
input[type=text],
input[type=submit] {
    width: 100%;
    padding: 12px;
    margin: 8px 0;
    display: inline-block;
    border: 1px solid #ccc;
    box-sizing: border-box;
}

/* Add margins to the checkbox */
input[type=checkbox] {
    margin-top: 16px;
}

/* Style the submit button */
input[type=submit] {
    background-color: #04AA6D;
    color: white;
    border: none;
}

input[type=submit]:hover {
    opacity: 0.8;
}

@media (max-width: 768px) {
        
    .sub-menu {
            display: none;
            flex-direction: row;
            flex-wrap: wrap;
            overflow-x: visible;
            overflow-y: hidden;
            padding: 0;
            justify-content: flex-start;
            column-gap: 0.5rem;
            row-gap: 0.125rem;
        }
    
        .sub-menu.active {
            display: flex;
            margin-bottom: -1.0rem; /* NEW: Pulls content up to cancel sub-bottom space */
        }
    
        .sub-menu a {
            display: inline-block;
            flex: 0 0 auto;
            white-space: normal;
            padding: 0.2rem 0.375rem;
            font-size: 0.9rem;
            min-width: fit-content;
        }
    
    .nav-menu {
        display: flex;
        flex-direction: column;
        gap: 0.25rem; /* Halved from 0.5rem */
    }

    h1 {
        font-size: 2.5rem;
    }

    .section-container {
        padding: 3rem 1rem;
    }

    .hero {
        padding-top: calc(8rem + 100px);
    }

    .nav-brand {
        display: none;
    }
    
    pre {
        white-space: pre-wrap; /* NEW: Wraps lines but keeps spaces/tabs */
        word-wrap: break-word; /* NEW: Breaks super-long words if needed */
        overflow-x: auto; /* Fallback: Horizontal scroll only if still too wide */
        max-width: 100%; /* Ensures it never exceeds container */
        padding: 0.75rem; /* Slightly more padding for touch */
        font-size: 0.85rem; /* Optional: Smaller font on mobile to fit more */
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .hero {
        padding-top: calc(8rem + 60px); /* Boosts offset for tablet nav height (main + sub-menu ~80-100px total; inspect to fine-tune) */
    }
    
    .sub-menu.active {
        margin-bottom: -0.5rem; /* Reduces vertical bloat from active sub-menus */
    }
    
    .nav-menu {
        gap: 0.25rem; /* Compacts vertical spacing between menu rows */
    }
    
    .main-menu {
        row-gap: 0.25rem; /* Matches tighter gap for wrapped main items */
    }
    
    .sub-menu {
        flex-wrap: nowrap; /* Keeps sub-items in one row to minimize height */
        overflow-x: auto; /* Allows horizontal scroll if overflowing, avoiding extra rows */
        padding-bottom: 0.25rem; /* Subtle buffer for scroll bar */
    }
}