.topbar {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 0;
} 

.topbar-toprow {
    display: flex;
    justify-self: center;
    align-items: center;
    height: 7dvh;
    width: 100%;
    background-color: var(--background-color2);
    border-bottom: 0.3dvw solid var(--border-color);
    padding-bottom: 0.2dvh;
}


.topbar-left {
    height: 100%;
    display: flex;
    width: 25dvw;
}

topbar-left a {
    display: block;
    height: 100%;
    width: 100%; 
}

.topbar-logo {
    rotate: -6deg;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: all 0.8s ease-in-out;
}

.topbar-logo:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px 0 var(--shadow-color);
    rotate: 0deg;
    transition: all 1.0s ease-in-out;
}



.topbar-middle {
    width: 50dvw;
    display: flex;
    justify-content: center;
    align-items: center;
}

.topbar-middle h2 {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    text-decoration: underline;
    font-family: var(--main-font-family2);
    text-shadow: 2px 2px 4px var(--shadow-color);
    font-weight: bold;
    color: var(--text-color4);
    text-decoration: none;
    text-shadow: 3px 3px 7px var(--shadow-color2);
    -webkit-text-stroke: 1.4px var(--text-outline-color);
    margin: 0;
}

.topbar-middle-link {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

.topbar-middle-link:hover {
    transform: scale(1.05);
    transition: all 0.3s ease;
}

.topbar-middle-link h2 {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-family: var(--main-font-family2);
    text-shadow: 3px 3px 7px var(--shadow-color2);
    -webkit-text-stroke: 1.4px var(--text-outline-color);
    color: var(--text-color4);
    text-decoration: none;
    margin: 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.topbar-middle-link:hover h2 {
    color: var(--highlight-color);
    text-shadow: 3px 3px 9px var(--shadow-color2);
}

.topbar-right {
    width: 25dvw;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
    position: relative;
}

/* Topbar dropdown support */
.topbar-right .nav-dropdown {
    position: relative;
}

.topbar-right .navlink-dropdown-menu {
    top: calc(7dvh + 0.5rem) !important;
    right: 0 !important;
    left: auto !important;
    margin-left: auto !important;
    margin-right: 1.5% !important;
    width: auto !important;
    min-width: 200px;
    max-width: 300px;
    justify-content: flex-start !important;
    flex-direction: column !important;
    align-items: stretch !important;
}

.topbar-bottom-row {
    padding: 0 !important;
    padding-top: 0.2dvh;
    padding-bottom: 0.2dvh;
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    align-self: center;
    min-height: fit-content;
    height: 4.5dvh;
    padding: 0;
    background-color: var(--background-color3);
    border-top: 0.3dvw solid var(--border-color2);
    border-bottom: 0.4dvw solid var(--border-color3);
}

.topbar-bottom-row a {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: auto;
    margin: 0;
    font-size: 1.512rem;
    font-weight: bold;
    color: var(--text-color);
    text-decoration: none;
    text-shadow: 2px 2px 4px var(--shadow-color);
    transition: all 1.0s ease-in-out;
}

.topbar-bottom-row a:hover {
    color: var(--highlight-color);
    text-shadow: 2px 2px 4px var(--shadow-color2);
    transform: scale(1.05);
    transition: all 0.8s ease-in-out;
}


.search-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: 85%;
    max-width: 15rem;
    gap: 0;
}

.search-box input[type="text"] {
    border: 1px solid var(--border-color);
    border-radius: 0.6rem 0 0 0.6rem;
    border-right: none;
    padding: 0 0.8rem;
    font-size: 1.134rem;
    background: var(--background-color5);
    outline: none;
    color: white;
    box-shadow: 0 2px 8px 0 var(--shadow-color2);
    z-index: 0;
    position: relative;
    height: 100%;
    box-sizing: border-box;
    width: 15rem;
    line-height: 1;
    margin: 0;
    vertical-align: middle;
}

.search-box input[type="text"]::placeholder {
    color: #353434;
}

.search-box button[type="submit"] {
    border: 1px solid var(--border-color);
    border-left: none;
    background: var(--highlight-color2);
    color: var(--text-color3);
    border-radius: 0 0.6rem 0.6rem 0;
    padding: 0 0.8rem;
    font-size: 1.26rem;
    cursor: pointer;
    z-index: 1;
    box-shadow: 0 2px 8px 0 var(--shadow-color2);
    position: relative;
    height: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    margin: 0;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.search-box button[type="submit"]:hover {
    background: var(--highlight-color);
    color: var(--highlight-color2);
    box-shadow: 0 4px 14px 0 var(--shadow-color);
}

/* ============================================================
   RESPONSIVE: Galaxy S23 and similar (360px - 480px)
   ============================================================ */

@media (max-width: 480px) {
    .topbar-toprow {
        height: auto;
        min-height: 6dvh;
        flex-wrap: wrap;
        padding: 0.375rem;
    }

    .topbar-left {
        width: 28%;
        min-width: 80px;
    }

    .topbar-middle {
        width: 44%;
        min-width: 0;
        flex: 1;
    }

    .topbar-middle h2 {
        width: 100%;
        font-size: 1.1025rem; /* Fixed size for mobile */
        text-align: center;
        padding: 0 0.25rem;
        line-height: 1.15;
        -webkit-text-stroke: 1px var(--text-outline-color);
    }

    .topbar-right {
        width: 28%;
        min-width: 80px;
        justify-content: flex-end;
        gap: 0.375rem;
    }

    .topbar-right .navlink-button {
        font-size: 1.02375rem;
        padding: 0.25rem 0.375rem;
    }

    .topbar-bottom-row {
        height: auto;
        min-height: 4dvh;
        flex-direction: column;
        padding: 0.375rem;
        gap: 0.375rem;
    }

    .topbar-bottom-row-left,
    .topbar-bottom-row-middle,
    .topbar-bottom-row-right {
        width: 100%;
        justify-content: center;
    }

    .topbar-bottom-row a {
        font-size: 0.945rem;
        padding: 0.375rem 0.5rem;
        text-align: center;
        line-height: 1.3;
    }

    .search-box {
        width: 100%;
        max-width: 100%;
        height: 2.25rem;
    }

    .search-box input[type="text"] {
        width: calc(100% - 2.75rem);
        font-size: 1.1025rem;
        padding: 0 0.5rem;
    }

    .search-box button[type="submit"] {
        width: 2.75rem;
        padding: 0 0.5rem;
        font-size: 1.1025rem;
    }

    .topbar-right .navlink-dropdown-menu {
        width: calc(100% - 1.5rem) !important;
        max-width: calc(100% - 1.5rem) !important;
        right: 0.75rem !important;
        left: 0.75rem !important;
        margin: 0 !important;
    }
    
    /* Hide topbar navigation links on mobile */
    .topbar-right .navlink-button:not(.has-dropdown) {
        display: none !important;
    }
    
    .topbar-right .nav-dropdown {
        display: none !important;
    }
}

/* ============================================================
   RESPONSIVE: MOBILE BREAKPOINT (< 768px)
   ============================================================ */

@media (max-width: 768px) and (min-width: 481px) {
    .topbar-toprow {
        height: auto;
        min-height: 7dvh;
        flex-wrap: wrap;
        padding: 0.5rem;
    }

    .topbar-left {
        width: 30%;
        min-width: 100px;
    }

    .topbar-middle {
        width: 40%;
        min-width: 0;
        flex: 1;
    }

    .topbar-middle h2 {
        width: 100%;
        font-size: 1.1025rem;
        text-align: center;
        padding: 0 0.5rem;
        line-height: 1.2;
    }

    .topbar-right {
        width: 30%;
        min-width: 100px;
        justify-content: flex-end;
        gap: 0.5rem;
    }

    .topbar-right .navlink-button {
        font-size: 1.1025rem;
        padding: 0.25rem 0.4rem;
    }

    .topbar-bottom-row {
        height: auto;
        min-height: 4.5dvh;
        flex-direction: column;
        padding: 0.5rem;
        gap: 0.5rem;
    }

    .topbar-bottom-row-left,
    .topbar-bottom-row-middle,
    .topbar-bottom-row-right {
        width: 100%;
        justify-content: center;
    }

    .topbar-bottom-row a {
        font-size: 1.1025rem;
        padding: 0.5rem;
        text-align: center;
    }

    .search-box {
        width: 100%;
        max-width: 100%;
        height: 2.5rem;
    }

    .search-box input[type="text"] {
        width: calc(100% - 3rem);
        font-size: 1.1025rem;
        padding: 0 0.6rem;
    }

    .search-box button[type="submit"] {
        width: 3rem;
        padding: 0 0.5rem;
        font-size: 1.1025rem;
    }

    .topbar-right .navlink-dropdown-menu {
        width: calc(100vw - 2rem) !important;
        max-width: calc(100vw - 2rem) !important;
        right: 1rem !important;
        left: 1rem !important;
        margin: 0 !important;
    }
}

/* ============================================================
   RESPONSIVE: TABLET BREAKPOINT (768px - 1024px)
   ============================================================ */

@media (min-width: 769px) and (max-width: 1024px) {
    .topbar-toprow {
        padding: 0.5rem;
    }

    .topbar-left {
        width: 20%;
    }

    .topbar-middle {
        width: 60%;
    }

    .topbar-middle h2 {
        font-size: 1.26rem;
    }

    .topbar-right {
        width: 20%;
    }

    .search-box {
        max-width: 12rem;
    }

    .search-box input[type="text"] {
        width: calc(100% - 2.5rem);
    }
}