@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@300;400;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Oswald', sans-serif;
    background-color: #f9f9f9;
    color: #333;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Sticky header to keep top-banner + nav visible */
.sticky-header {
    position: sticky;
    top: 0;
    z-index: 9999;
    background-color: #fff;
}

/* Top Banner */
.top-banner {
    border-bottom: 1px solid #ddd;
    padding: 20px 0;
    width: 100%;
    text-align: center;
}

.banner-link {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
}

.site-logo {
    height: 40px;
    width: 40px;
    object-fit: contain;
}

.banner-text {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.site-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #111;
    margin-bottom: 5px;
}

.site-subtitle {
    font-size: 0.9rem;
    font-weight: 300;
    color: #666;
}

/* Main nav bar container */
.main-nav {
    display: flex;
    justify-content: center;
    padding: 10px 0;
    background-color: #fff;
    /* Removed border-bottom to remove gray line */
}

/* Center area: hamburger + search bar in one row */
.nav-center {
    display: flex;
    flex-direction: row;
    align-items: center;
    position: relative;
    width: auto;
    gap: 15px;
}

/* Hamburger menu icon */
.hamburger {
    cursor: pointer;
    position: relative;
}
.hamburger .bar {
    width: 25px;
    height: 3px;
    background-color: #007BFF;
    margin: 4px 0;
}

/* Search form to the right of hamburger */
.nav-search {
    display: flex;
    align-items: center;
    gap: 5px;
}
#search-input {
    padding: 5px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px 0 0 4px;
    outline: none;
}
#search-form button {
    padding: 5px 10px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-left: none;
    border-radius: 0 4px 4px 0;
    background-color: #007BFF;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.2s;
}
#search-form button:hover {
    background-color: #0056b3;
}

/* The hidden nav links that drop down from under the hamburger */
.nav-links {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    background-color: #fff;
    /* remove border */
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease;
}

/* Show the menu by increasing max-height */
.nav-links.show {
    max-height: 200px;
}

/* Each link is a block inside the drop-down */
.nav-links a {
    display: block;
    padding: 10px;
    text-align: center;
    text-decoration: none;
    color: #007BFF;
    border-bottom: 1px solid #eee;
}
.nav-links a:hover {
    background-color: #f5f5f5;
}

/* Page Content: Reduced top margin */
.page-content {
    max-width: 1200px;
    width: 100%;
    margin: 1px auto;
    padding: 20px;
    text-align: center;
}

/* --------------------------- */
/* SECTION SPACING ADDED HERE */
/* --------------------------- */
/* Increase spacing between sections */
#explore-bodybuilders-section,
#open-schedule-section,
#recent-contests-section {
    margin-bottom: 50px; /* more space between sections */
}

/* Slightly increase spacing between section titles and tables */
#explore-bodybuilders-section h1,
#open-schedule-section h1,
#recent-contests-section h1 {
    margin-bottom: 15px; /* extra space between heading and table */
}
/* --------------------------- */

/* Reduced bottom margin of h1#title for less vertical space (used on other pages) */
h1#title {
    font-size: 2rem;
    font-weight: 700;
    color: #111;
    margin-bottom: 20px;
}

/* General container */
.container {
    max-width: 800px;
    width: 100%;
    margin: 40px auto;
}

/* Search Results */
#search-results {
    margin-top: 20px;
    text-align: center;
}
#search-results ul {
    list-style: none;
    padding: 0;
    display: inline-block;
    text-align: left;
}
#search-results li {
    margin: 10px 0;
}
#search-results li a {
    text-decoration: none;
    color: #007BFF;
    font-weight: 500;
}
#search-results li a:hover {
    text-decoration: underline;
}

/* Tables */
table {
    width: 100%;
    max-width: 600px;
    border-collapse: collapse;
    margin: 0 auto;
}
th, td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: center;
}
th {
    background-color: #f2f2f2;
    font-weight: 600;
}
tr:nth-child(even) {
    background-color: #f9f9f9;
}
tr:hover {
    background-color: #e9e9e9;
}

/* Athlete name and Instagram link on Bodybuilder Details page */
#bodybuilder-name {
    font-size: 2rem;
    font-weight: 600;
    color: #222;
    margin-bottom: 20px;
    text-align: center;
}

/* Instagram link styling */
.instagram-link {
    display: block;
    margin: 20px auto;
}

/* --- Responsive Adjustments (Media Queries) --- */
@media (max-width: 600px) {
    .site-title {
        font-size: 1.5rem;
    }
    .site-subtitle {
        font-size: 0.8rem;
    }
    #search-input, #search-form button {
        font-size: 0.9rem;
    }
    h1#title {
        font-size: 1.8rem;
    }
    .page-content {
        padding: 10px;
    }
    .container {
        margin: 20px auto;
    }
    table th, table td {
        padding: 8px;
        font-size: 0.9rem;
    }
}

@media (max-width: 400px) {
    .site-title {
        font-size: 1.3rem;
    }
    .site-subtitle {
        font-size: 0.75rem;
    }
    #search-input, #search-form button {
        font-size: 0.85rem;
        width: 100%;
    }
    table th, table td {
        font-size: 0.85rem;
        padding: 6px;
    }
}

/* Advanced search form styling */
#advanced-search-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 40px;
    text-align: left;
}

#advanced-search-form h2 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 5px;
}

.filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

filter-group label {
    font-weight: 500;
}

#advanced-results-table {
    width: 100%;
    max-width: 800px;
    border-collapse: collapse;
    margin: 20px auto;
}
#advanced-results-table th, #advanced-results-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: center;
}
#advanced-results-table th {
    background-color: #f2f2f2;
    font-weight: 600;
}
#advanced-results-table tr:nth-child(even) {
    background-color: #f9f9f9;
}
