:root {
    --primary-color: hsl(0, 0%, 24%);
    --secondary-color: #5b5b5b;
    --navbar-height: 50px;
}

body {
    margin: 0;
    padding: 0;
    width: 100%;
    /* overflow-x: hidden; */
    font-family: Arial, sans-serif;
    background-color: var(--secondary-color);
    max-width: 100%;
    /* overflow: hidden; */
    box-sizing: border-box;
}
html {
    scroll-behavior: smooth;
}

html.menu-active,
body.menu-active {
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    position: relative;
}

.navbar {
    display: flex;
    height: var(--navbar-height);
    justify-content: space-between; /* Spread content evenly */
    align-items: center; /* Center items vertically in the navbar */
    background-color: var(--primary-color);
    border-bottom: 3px solid #000000;
    position: relative;
    z-index: 1000; /*above everything*/
}

.navbar a {
    cursor: pointer;
}

.navbar-left {
    display: flex; /* Ensure it's a flex container */
    align-items: center; /* Center items vertically */
    height: 100%;
    flex-shrink: 0; /* Prevent shrinking */
}

.navbar-left a {
    color: rgb(255, 255, 255);
    text-decoration: none;
    padding: 0 15px; /* Adjust horizontal padding */
    display: flex; /* Make <a> a flex container */
    align-items: center; /* Center text vertically */
    height: 100%; /* Match the height of the navbar */
}

.navbar-right {
    display: flex; /* Ensure it's a flex container */
    align-items: center; /* Center items vertically */
    height: 100%;
}

.navbar-left .home-button {
    font-weight: bold;
    font-size: 30px;
}

.navbar-center{
    display: flex; /* Ensure it's a flex container */
    align-items: center; /* Center items vertically */
    height: 100%;
    flex-grow: 1; /* Allow it to grow and take available space */
    justify-content: center; /* Center items horizontally */
    margin-right: 20px; /* Add some space to the right */
}

.navbar-center a {
    display: flex; /* Ensure <a> is a flex container */
    justify-content: center; /* Center text horizontally */
    text-align: center; /* Align text to the center */
    color: #FFFFFF;
    font-weight: bold;
    align-items: center;
}

.navbar-right a {
    color: rgb(190, 190, 190);
    text-decoration: none;
    padding: 0 15px; /* Adjust horizontal padding */
    display: flex; /* Make <a> a flex container */
    align-items: center; /* Center text vertically */
    height: 100%; /* Match the height of the navbar */
    transition: background-color 0.3s;
}

.navbar-right a:hover {
    color: #FFFFFF;
    transform: scale(1.1); /* Scale the text */
    transition: color 0.3s ease, transform 0.3s ease; /* Smooth transition for color and scaling */
    display: inline-flex; /* Ensure scaling doesn't affect layout */
    align-items: center; /* Keep the text vertically centered */
    justify-content: center; /* Center horizontally if needed */
}

.hamburger-button {
    display: none;
    margin-right: 20px;
    font-size: 1.5em;
    cursor: pointer;
}

.hamburger-button img {
    width: 30px;
    height: 30px;
}

/* Mobile Menu Styles */
.mobile-menu {
    display: flex;
    visibility: hidden; /* Hidden by default */
    opacity: 0; /* Fully transparent */
    flex-direction: column;
    position: fixed;
    top: -100%; /* Start off-screen */
    left: 0; /* Align to the left edge of the viewport */
    right: 0; /* Align to the right edge of the viewport */
    width: 100%; /* Ensure full width */
    background-color: var(--secondary-color);
    padding: 20px;
    border-bottom: 3px solid #000000;
    transition: top 0.3s ease, opacity 0.3s ease, visibility 0.3s ease; /* Smooth slide-in animation */
    z-index: 4; /* Ensure it's below the navbar */
    box-sizing: border-box; /* Include padding and border in the element's total width */
}

.mobile-menu.active {
    visibility: visible; /* Make the menu visible */
    opacity: 1; /* Fully opaque */
    top: calc(var(--navbar-height) - 10px); /* Adjust this value to match the height of your navbar */
}

.mobile-menu a {
    text-decoration: none;
    color: white;
    font-size: 1.1em;
    padding: 10px 0;
    border-bottom: 1px solid var(--primary-color); /* Optional: Add separators */
}

/* Overlay Styles */
.overlay {
    display: none;
    opacity: 0;
    position: fixed;
    top: calc(var(--navbar-height) - 10px);
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    transition: opacity 0.3s ease;
    z-index: 3;
}

.overlay.active {
    opacity: 1;
    display: block;
}

@media (max-width: 768px) {
    .navbar-right {
        display: none;
        align-items: center; /* Center items vertically */
        height: 100%;
    }

    .navbar-right.active {
        display: flex;
    }

    .hamburger-button {
        display: block;
    }
}

/* Voting */
.voting-container {
    display: flex;
    height: calc((var(--vh, 1vh) * 100) - var(--navbar-height)); /* Full height minus navbar */
    width: 100%;
    z-index: 0;
}

.vs-image {
    width: 30%;
    height: 30%;
    object-fit: contain;
    position: absolute;
    top: 40%;
    left: 50%;
    pointer-events: none;
    transform: translate(-50%, 0);
    z-index: 1;
}

.option {
    flex: 1;
    position: relative;
    cursor: pointer;
    overflow: hidden;

    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.option.show {
    opacity: 1;
    transform: translateY(0);
}

.option-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.option-image:hover {
    transform: scale(1.1);
}

.option-title {
    position: absolute;
    top: 10px;
    width: 100%;
    text-align: center;
    font-weight: bold;
    font-size: 3em;
    color: white;
    /* text-shadow: 2px 2px 4px black; */
    z-index: 1;
    pointer-events: none;
    text-shadow: 1.41px 1.41px black, 2px 0 black, 1.41px -1.41px black, 0 -2px black, -1.41px -1.41px black, -2px 0 black, -1.41px 1.41px black, 0 2px black;
}

@media (max-width: 550px) {
    .voting-container {
        flex-direction: column;
    }

    .option {
        height: calc(45vh); /* Adjust height for mobile */
    }

    .option-title {
        font-size: 2em; /* Adjust font size for mobile */
    }

    .vs-image {
        width: 60%;
        height: 60%;
        top: 23%;
    }
}

/* leaderboard */
/* Container styling */
.leaderboard-container {
    padding-left: 2rem; /* Space to the left side */
    color: white; /* Make text white */
}

/* Table base styling */
.leaderboard-table {
    width: 90%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-family: sans-serif;
}

/* Header row */
.leaderboard-table thead th {
    text-align: left;
    font-weight: bold;
    padding: 12px 16px;
    border-bottom: 2px solid white;
}

/* Slightly wider Rank column */
/* Make Rank column 40px wide and square */
.leaderboard-table tbody td:first-child {
    width: 40px;
    height: 40px;
    text-align: center;
    vertical-align: middle;
    border-radius: 4px;
    font-weight: bold;
}

/* Also update the <th> for consistent width */
.leaderboard-table thead th:first-child {
    width: 40px;
    text-align: center;
}

/* Row styling */
.leaderboard-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.leaderboard-table tbody td {
    text-align: left;
    padding: 10px 16px;
    color: white;
}

/* Top 3 special styles */
.leaderboard-table tbody tr:nth-child(1) td:first-child {
    background-color: gold;
    color: black;
    font-weight: bold;
    border-radius: 4px;
}

.leaderboard-table tbody tr:nth-child(2) td:first-child {
    background-color: silver;
    color: black;
    font-weight: bold;
    border-radius: 4px;
}

.leaderboard-table tbody tr:nth-child(3) td:first-child {
    background-color: #cd7f32; /* bronze */
    color: black;
    font-weight: bold;
    border-radius: 4px;
}

/* About */
.about-container h2 {
    font-size: 2em;
    color: white;
    text-align: center;
    margin-bottom: 20px;
}

.about-container p {
    font-size: 1.2em;
    color: white;
    text-align: center;
    width: 50%;
    margin-bottom: 20px;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 550px) {
    .about-container p {
        width: 80%;
    }
}