body {
    animation: bodyWhite ease 2s;
    font-family: "Inconsolata";
    margin: 0;
    overflow: hidden;
    background-color: black;
}
canvas {
    display: block;
}
#header {
    position: absolute;
    top: 50%;
    left: 50%;
    text-align: center;
    color: #fff;
    z-index: 2;
    width: 85vw; /* Set a maximum width for the header */
    margin: 0 calc(auto + 24px); /* Center the header horizontally */
    transition:top 0.3s cubic-bezier(0,-0.01,.47,1)
    ;
}

#header.at_top {
    top: 20%;
}

#header p {
    text-align: center;
    overflow: hidden;
    white-space: nowrap;
    position: relative; /* Add relative positioning */
    /* margin-bottom: 30px; /* Add some space below the <p> */
}
#links {
    position: absolute;
    top: 80%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #fff;
    background-color: #0f0f0f;
    z-index: 1;
    max-width: 80%; /* Set a maximum width for the header */
    margin: 0 calc(auto + 24px); /* Center the header horizontally */

}
#name {
    justify-content: center;
    align-items: center;
    display: flex;
}
#name h1 {
    margin-top: 35px;
}
#logo {
    max-height: 100%;
    height: auto;
    display: inline-block; /* Display logo as inline-block */
    margin-right: 10px; /* Add margin to separate logo from text */
}
#top_border {
    animation: slideOutAnim cubic-bezier(0.4, 0, 0.2, 1) 3s;
    animation-fill-mode: backwards;
    position: absolute;
    width: 100%;
    background-color: #fff;
    opacity: 0;
    z-index: 3;
    margin-top: 0px;
}
#bottom_border {
    animation: slideOutAnim cubic-bezier(0.4, 0, 0.2, 1) 3s;
    animation-fill-mode: backwards;
    position: absolute;
    width: 100%;
    background-color: #fff;
    opacity: 0;
    z-index: 3;
    margin-bottom: 0px;
    transform: translate(0%, calc(100vh - 100%));
}
@keyframes slideOutAnim {
    0% {
        background-color: #000;
        opacity: 1;
        height: 50%
    }
    25% {
        background-color: #fff;
        opacity: 1;
        height: 50%;
    }
    100% {
        opacity: 1;
        height: 0%;
    }
}

img { /* remove blur on pixelated, courtesy of SO */
    image-rendering: optimizeSpeed;             /* STOP SMOOTHING, GIVE ME SPEED  */
    image-rendering: -moz-crisp-edges;          /* Firefox                        */
    image-rendering: -o-crisp-edges;            /* Opera                          */
    image-rendering: -webkit-optimize-contrast; /* Chrome (and eventually Safari) */
    image-rendering: pixelated;                 /* Universal support since 2021   */
    image-rendering: optimize-contrast;         /* CSS3 Proposed                  */
    -ms-interpolation-mode: nearest-neighbor;   /* IE8+                           */
}

#header p span {
    position: relative;
    display: inline-block;
    cursor: pointer;
    padding: 3px;
    z-index: 2;
    /* Removes Highlight */
    -webkit-user-select: none; /* Safari */
    -ms-user-select: none; /* IE 10 and IE 11 */
    user-select: none; /* Standard syntax */
}

#header p span::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: #fff;
    color: #fff;
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease-out, background-color 0.3s ease-out;
}

#header p span:nth-child(1)::before {
    background-color: #e38314; /* Unique color for the first dropdown */
}

#header p span:nth-child(3)::before {
    background-color: #1ed630; /* Unique color for the second dropdown */
}

#header p span:nth-child(5)::before {
    background-color: #a731d6; /* Unique color for the third dropdown */
}

#header p span:nth-child(7)::before {
    background-color: #FF5700; /* Unique color for the third dropdown */
}

#header p span:nth-child(1).active {
    background-color: #e38314; /* Unique color for the first dropdown */
}

#header p span:nth-child(3).active {
    background-color: #1ed630; /* Unique color for the second dropdown */
}

#header p span:nth-child(5).active {
    background-color: #a731d6; /* Unique color for the third dropdown */
}

#header p span:nth-child(7).active {
    background-color: #FF5700; /* Unique color for the third dropdown */
}

#header p span:hover:nth-child(odd)::before,
#header p span.active:nth-child(odd)::before {
    transform: scaleX(1);
    transform-origin: bottom left;
}

.dropdown-content {
    pointer-events: none;
    display: block;
    position: absolute;
    background-color: #fff;
    color: #000;
    padding: 10px;
    z-index: 100;
    width: calc(100% - 20px);
    top: 0;
    text-align: center;
    transform: translateY(calc(37.33 * 4px));
    opacity: 0;
    transition: 
    transform 0.3s ease-in-out,
    opacity 0.3s ease-in-out
    ;
    z-index: 1;
    max-height: 60vh;
    overflow-y: auto;
    border-radius: 10px;
}


.dropdown-content.hidden {
    transform: translateY(calc(37.33 * 5px));
    opacity: 1;
    pointer-events: auto;
    display: block;
}

.latestDate {
    position: absolute;
    bottom: 10px;
    right: 10px;
    color: white;
    text-align: right;
}

a:link {
    color: #e38314;
    background-color: transparent;
    text-decoration: none;
}
a:visited {
    color: #a731d6;
    background-color: transparent;
    text-decoration: none;
}
a:hover {
    color: #ffffff;
    background-color: transparent;
    text-decoration: underline;
}
a:active {
    color: #1ed630;
    background-color: transparent;
    text-decoration: underline;
}

.container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px;
    border-radius: 10px;
    overflow-x: auto; /* Scrollbar if content exceeds width */
    max-height: calc(100vh - 37.33 * 4px);
    background-color: #ccc;
}
.box {
    display: flex;
    flex-direction: column;
    background-color: #2f2f2f;
    border: 1px solid #ccc;
    overflow: hidden;
    border-radius: 10px;
    horizontal-align: center;
}
.box img {
    width: 100%;
    height: auto;
    cursor: pointer;
}
.box p {
    padding: 5px;
    text-align: center;
    background-color: #fff;
    margin: 0px;
}

.video-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
}
.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

@media (max-width: 600px) {
    .container {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (max-width: 800px) {
    /* Adjust styles for smaller screens */
    #name {
        font-size: smaller;
    }
    #logo {
        height: 96px;
    }
    #header {
        transform: translate(-50%, -96px);
    }
}

@media (min-width: 800px) {
    /* Adjust styles for bigger screens */
    #logo {
        height: 128px;
    }
    #header {
        transform: translate(-50%, -128px);
    }
}

/* Mobile styles */
@media screen and (max-width: 600px) {
    /* Stack spans and remove the "|" */
    #header p span {
        display: block; /* Stack spans vertically on mobile */
    }

    /* Hide the "|" on mobile */
    #header p span:nth-child(even) {
        display: none; /* Hide the manually added "|" */
    }

    /* Relative position for mobile */
    .dropdown-content {
        position: absolute;
        display: block;
        top: 0;
        left: -10px;
        width: 100%;
        opacity: 0;
        transform: translateY(calc(37.33 * 4px + 20px));
        transition: 
            transform 0.3s ease-in-out,
            opacity 0.3s ease-in-out;
    }

    /* Shown state for dropdowns on mobile */
    .dropdown-content.hidden {
        display: block;
        opacity: 1;
        transform: translateY(calc(37.33 * 5px + 20px));
        pointer-events: auto;
    }
}


/* Styles for larger screens, keeping "|" and absolute dropdowns */
@media screen and (min-width: 600px) {
    #header p span + span {
        display: inline-block; /* Show the "|" between spans */
    }

    #header p span:last-child::after {
        content: ''; /* Remove "|" after the last span */
    }

    .dropdown-content {
        position: absolute; /* Keep dropdown position absolute on larger screens */
        transform: translateY(calc(37.33 * 4px));
        opacity: 0;
    }

    .dropdown-content.hidden {
        transform: translateY(calc(37.33 * 5px));
        opacity: 1;
    }
}
