@media (max-width: 1200px) {
    .stats-box-wrapper {
        flex: 1 1 33.33%; /* Show 3 items per row on medium-large screens */
        max-width: 33.33%;
    }
}

@media (width: 1024px) {
    .servers .col-lg-3 {
        width: 50%;
    }
}

@media (max-width: 991px) {
    .floating-div {
        max-width: 100%;
    }

    header {
        white-space: nowrap;
        position: relative;
        display: flex;
        align-items: center;
        padding-right: 15px;
        left: 0;
        right: 0;
        padding-left: 15px;
    }

    .main {
        margin-left: 0;
        height: 100%;
        padding-top: 0px;
        display: block;
        transition: all .2s ease;
        margin-right: 0;
        overflow-y: auto;
        overflow-x: hidden;
        padding-right: 15px;
        min-height: 75vh;
        padding-left: 15px;
    }

    .header {
        background: rgb(var(--main-bg));
        position: fixed;
        left: 0;
        top: unset;
        bottom: 0;
        transition: all .2s ease;
        width: 100%;
        z-index: 150;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        align-items: center;
        height: 84px;
    }

    .p-links {
        display: flex;
        flex-direction: column;
        min-height: 100vh;
        position: relative;
        z-index: 99999;
    }

    .logo {
        display: none;
    }

    .menu span {
        display: none;
    }

    .menu li a i {
        font-size: 25px;
    }

    .menu span {
        display: none;
    }

    .menu {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        bottom: 0;
        gap: 30px;
        display: flex;
        flex-direction: row;
        align-items: center;
    }

.nav-item {
    position: relative;
    margin: 0 0.5rem;
    transition: all 0.2s;
}

.nav-item::after {
    content: '';
    display: block;
    width: 0;
    height: 2px;
    background: #904add;
    transition: width 0.3s;
    position: absolute;
    bottom: -2px;
    left: 0;
}

.nav-item:hover::after {
    width: 100%;
}

.profile {
    position: relative;
    margin-left: auto !important;
}

.mprofile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
    border-radius: 6px;
}

.mprofile:hover {
    background: rgba(255, 255, 255, 0.1);
}

.profile-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #904add;
}

.dropdown-content {
    position: absolute;
    right: 0;
    top: calc(100% + 5px);
    min-width: 240px;
    background: #2b2d31;
    border-radius: 6px;
    padding: 1rem;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    display: none;
    z-index: 1001;
    border: 1px solid #3d3f45;
}

.profile:hover .dropdown-content {
    display: block;
}

.nav-scroll-container {
    position: relative;
    display: flex;
    align-items: center;
    flex-grow: 1;
    max-width: 100%;
    margin: 0 15px;
    overflow: hidden;
}

.nav-links-wrapper {
    overflow-x: auto;
    scroll-behavior: smooth;
    white-space: nowrap;
    -ms-overflow-style: none;
    scrollbar-width: none;
    flex-grow: 1;
    padding: 5px 0;
    mask-image: linear-gradient(
        to right,
        transparent,
        black 50px,
        black calc(100% - 50px),
        transparent
    );
}

.nav-links-wrapper::-webkit-scrollbar {
    display: none;
}

.nav-scroll-arrow {
    display: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.3);
    border: none;
    color: white;
    border-radius: 50%;
    z-index: 1;
    transition: opacity 0.3s, transform 0.2s;
    opacity: 0;
    cursor: pointer;
}

.nav-scroll-arrow:hover {
    background: rgba(0, 0, 0, 0.5);
    transform: translateY(-50%) scale(1.1);
}

.nav-scroll-arrow-left { left: 10px; }
.nav-scroll-arrow-right { right: 10px; }

@media (min-width: 600px) and (max-width: 1300px) {
    .nav-scroll-container {
        padding: 0 50px;
    }
    
    .nav-scroll-arrow {
        display: block;
    }
    
    .nav-links-wrapper {
        overflow-x: hidden;
        padding: 0 20px;
    }
    
    .navbar-nav {
        display: inline-flex;
        flex-wrap: nowrap;
        transition: transform 0.3s;
    }
    
    .nav-scroll-container:hover .nav-scroll-arrow {
        opacity: 1;
    }
}

@media (max-width: 1300px) {
    .nav-scroll-container {
        max-width: 90%;
    }
}

@media (max-width: 992px) {
    .navbar-toggler {
        order: 1;
    }
    
    .d-flex.align-items-center.gap-2 {
        order: 3;
        margin-left: auto !important;
        padding-right: 1rem;
    }
    
    .navbar-collapse {
        order: 2;
        flex-basis: 100%;
        margin-top: 1rem;
    }
    
    .nav-item::after {
        display: none;
    }
}

@media (max-width: 576px) {
    .d-flex.align-items-center.gap-2 {
        gap: 0.5rem !important;
    }
    
    .btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .mprofile {
        padding: 0.25rem 0.5rem;
    }
}

    a.account img {
        width: 50px;
        height: 50px;
    }

    a.account {
        border-radius: 8px;
    }

    .account {
        margin-bottom: 10px;
    }

    .sep {
        display: none;
    }

    .p-links a {
        font-size: 16px;
        background: rgb(var(--bg));
        margin-bottom: 10px;
        padding: 15px;
        border-radius: 8px;
        font-weight: 600;
    }

    .logo.mobile {
        display: block;
    }

    .logo {
        margin-top: 0;
    }

    .logo img {
        max-width: 55px;
        max-height: 55px;
    }

    footer {
        padding: 15px;
        border-top: 1px solid rgb(var(--main-bg));
        padding-bottom: 100px;
    }

    .stats-box {
        margin-bottom: .25rem;
    }

    .leaderboards .top-img {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 30%;
        height: 100%;
        justify-content: space-between;
        overflow: hidden;
        gap: 1px;
    }

    .leaderboards .top-img img {
        width: 80px;
        height: 80px;
        border-radius: 4px;
        outline-offset: 0px;
    }

    .leaderboards .top-stats {
        display: grid;
        grid-template-columns: repeat(1, 1fr);
        align-items: center;
        width: 100%;
        height: 100%;
        justify-items: center;
        grid-gap: 15px;
    }


    .leaderboards .stats-block {
        padding: 15px;
        width: 100%;
    }

    .leaderboards .top-player {
        justify-content: center;
        background-color: var(--k4main-bg);
        border-radius: 12px;
        position: relative;
        display: flex;
        flex-direction: column;
        width: 100%;
        padding: 13px 13px;
        align-items: center;
        gap: 10px;
    }
}

@media (max-width: 768px) {


    .content {
        margin-bottom: 5px !important;
    }

    .server-modal .table tr {
        grid-template-columns: 80px 110px 1fr 1fr 1fr 1fr;
    }

    .left-menu-modal ul.nav {
        display: contents;
    }

    .left-menu-modal .modal-dialog {
        position: absolute;
        bottom: 60px;
        left: 50%;
        transform: translateX(-50%);
        width: calc(100% - 20px);
        transition: all 0.3s ease;
    }

    .left-menu-modal .modal-content {
        margin: 0 auto;
        border-radius: 8px;
        padding: 10px;
    }

    /* Remove the margin from the modal header for mobile */
    .left-menu-modal .modal-header {
        margin: 0;
    }

    .content img {
        max-width: 100%;
    }

    .card-link-hover .no-image {
        font-size: 2rem;
    }

    .carousel-text {
        max-width: 100%;
        padding-left: 15px;
    }

    .carousel-action {
        margin-top: 5px; /* Ensure button stays at the bottom */
        padding-right: 0;
        padding-left: 0;
    }

    .carousel-slide-bg {
        height: 400px; /* Maintain a smaller height for mobile */
    }

    .carousel-text h3 {
        font-size: 2rem; /* Smaller title on mobile */
    }

    .carousel-text p {
        font-size: 1rem; /* Smaller description on mobile */
    }

    .carousel-action a {
        font-size: 1rem;
        padding: 10px 20px;
    }

    .stats-box-wrapper {
        flex: 1 1 50%; /* Show 2 items per row on small screens */
        max-width: 50%;
    }

    .menu li a i {
        font-size: 35px;
    }

    #leaderboards-server-data .top-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .stats-box-wrapper {
        flex: 1 1 100%; /* Show 1 item per row on extra-small screens */
        max-width: 100%;
    }
}

@media (width: 425px) {
    .menu li a i {
        font-size: 30px;
    }
}

@media (max-width: 425px) {
    .server-modal .table tr {
        grid-template-columns: 80px 110px 1fr 1fr;
    }

    .server-modal {
        margin: 0;
    }

    .carousel-content {
        flex-direction: column;;
    }

    .menu li a i {
        font-size: 30px;
    }

    .card-link-hover .no-image {
        font-size: 1.5rem !important;
        height: 200px !important;
    }

    .news-img {
        display: none;
    }
}


@media (max-width: 375px) {
    .carousel-text p {
        font-size: 1rem;
    }
    .menu li a i {
        font-size: 20px;
    }
}


@media (max-width: 320px) {

    .logo img {
        display: none;
    }

    header {
        display: flex;
        justify-content: center;
    }

    .loader-logo {
        width: 350px;
    }


}

@media (max-width: 991px ) {
    .page-content-80 {
        width: 100%;
    }

    .support-content {
        width: fit-content !important;
    }
}
