/* General Styles */
body {
    background-color: #2b2b2b;
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    color: #fff;
}

h2 {
    font-size: 1.5em;
    margin-bottom: 10px;
}

a {
    color: #007bff;
    text-decoration: none;
}

a:hover {
    color: #0056b3;
}

.site-content {
    max-width: 1600px;
    margin: 0 auto; /* Center the entire content horizontally */
    padding-top: 24px;
}

.site-content #primary {
    max-width: 1650px; 
    border: 3px solid #282a2d;
    background-color: #25272a;
    float: inline-start;
    /* margin-right: 30px; */
    width: 100%;
    color: #fff;
}

#main {
    text-align: -webkit-center;
    background: linear-gradient(to bottom, rgb(43 43 43 / 0%) 8%, /* Fully opaque background color at the top */ rgb(24 24 24) 17% /* Fully transparent halfway down */), url(https://thpsx.com/wp-content/themes/thpsx/background_2.png);
    background-repeat: no-repeat;
    background-size: 376%, 100%;
    background-position-x: 0px, 0px;
    background-position-y: 0px, 0px;
    border-radius: 12px;
    box-shadow: 0px 0px 4px 6px rgba(0, 0, 0, 0.5);
}

#thpsXImage {
    margin-bottom: -60px;
    height: auto;
    max-width: 50%;
    position: relative;
    margin-top: -16px;
}

/* Layout */
#vault-layout {
    display: block;
    width: 100%;
    margin: 0px auto;
    padding: 20px 0px 20px 0px;
    position: relative;
}

#theVaultImage {
    height: auto;
    max-width: 50%;
    position: relative;
    margin-top: -50px;
}

/* Layout */
#stats-vault-layout {
    display: grid;
    grid-template-columns: 20% 80%;
    gap: 20px;
    max-width: 1550px;
    margin: 0px auto;
    padding: 13px;
    position: relative;
}

/* Live Game Stats Panel */
#live-stats-panel {
    padding: 2px;
    border-radius: 15px;
    box-shadow: 0px 0px 4px 6px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
    margin-left: -20px;
    padding-bottom: 10px;
    background: linear-gradient(to bottom, rgb(43 43 43 / 0%) 9%, /* Fully opaque background color at the top */ rgb(24 24 24) 17% /* Fully transparent halfway down */), url(https://thpsx.com/wp-content/themes/thpsx/background_2.png);
    background-repeat: no-repeat;
    background-size: 342%, 342%;
    background-position-x: 0px, 0px;
    background-position-y: 0px, 0px;
}

#liveStatsBoarder {
    padding: 10px 4px;
    background: #171717;
    border-radius: 10px;
    margin-top: 2px;
    width: 100%;
}

#liveStatsBoarderInner {
    padding: 8px 0px 8px 0px;
    background: #171717;
    border-radius: 10px;
    margin-top: 0px;
    width: 98%;
    background: linear-gradient(to bottom, rgb(23 29 49 / 80%) 11%, rgb(1 1 1 / 97%) 149%), url(https://thpsx.com/wp-content/themes/thpsx/background_5.png);
    background-size: 220%;
    background-position-x: 1225px;
    background-position-y: 0px;
    background-repeat: repeat;
}

#liveStatsImage {
    max-width: 94%;
    margin-top: 20px;
}

#stats-summary {
    margin-top: 29px;
    margin-bottom: 6px;
    background-color: #25272a;
    border-radius: 5px;
    padding: 4px 20px;
    width: fit-content;
    border: 1px solid #007bff;
    /* width: 88%; */
    /* left: -2px; */
    top: -24px;
    position: relative;
}

.game-selector {
    display: block;
    /* flex-direction: column; */
    position: relative;
    /* left: 70px; */
    top: 0px;
    /* transform: translateY(-50%); */
    z-index: 10;
    width: 100%;
}

#game-selector-BG {
    background-color: #171717;
    padding: 29px 4px 0px 0px;
    border-radius: 0px 0px 8px 8px;
    margin-top: -37px;
}

.game-button {
    /*writing-mode: vertical-rl; */
    /* transform: rotate(180deg); */
    text-align: center;
    height: 25px;
    width: 94px;
    padding: 2px 3px;
    background-color: #1e1e1e;
    color: #fff;
    border: 1px solid #007bff;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.game-button:hover {
    background-color: #007bff;
    color: white;
}

.game-button.active {
    background-color: #007bff;
    color: white;
    border: 1px solid #0056b3;
    cursor: default;
}

/* Live Stats Cards */
.live-stats-cards {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
    width: 100%;
    position: relative;
    margin-top: -14px;
}

.live-stats-card {
    background: linear-gradient(145deg, #252525, #1a1a1a);
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5), inset 0 1px 2px rgba(255, 255, 255, 0.05);
    padding: 10px;
    color: #f0f0f0;
    text-align: center;
    font-family: 'Arial', sans-serif;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
    /*width: 94%; */
    /* left: 23px;*/
}

.live-stats-card:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.7), inset 0 2px 4px rgba(255, 255, 255, 0.1);
}

.live-stats-card h3 {
    font-size: 1.4em;
    margin-top: 5px;
    margin-bottom: 15px;
    color: #ffffff;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 5px;
}

.live-stats-card p {
    margin: 5px 0;
    font-size: 1em;
    line-height: 1.6;
    color: #cccccc;
}

.live-stats-card p:first-of-type {
    margin-top: 10px;
    font-size: 1.1em;
    color: #007bff;
    font-weight: bold;
}

.live-stats-card .icon-game,
.live-stats-card .icon-level,
.live-stats-card .icon-players {
    margin-right: 5px;
    vertical-align: middle;
}

.live-stats-card:hover h3 {
    color: #007bff;
}

/* Add background effect to cards */
.live-stats-card::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(19, 24, 31, 0.2), transparent);
    transform: rotate(45deg);
    z-index: 0;
    transition: opacity 0.3s ease;
}

.live-stats-card:hover::before {
    opacity: 0.6;
}

/* Ensure content is above background effects */
.live-stats-card * {
    position: relative;
    z-index: 1;
}

/* Player names styling */
.player-names {
    margin-top: 15px;
    font-size: 0.9em;
    color: #f0f0f0;
    background: rgba(255, 255, 255, 0.05);
    padding: 5px 10px;
    border-radius: 8px;
    display: inline-block;
}
.players-section {
    margin-top: -5px;
    font-size: 14px;
}

.players-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 columns of equal width */    
    padding: 0;
    margin: 0;
    list-style: none; /* Remove bullets */
}

.players-list li {
    font-size: 0.9em;
    color: #cccccc;
    padding: 0px;
    text-align: center; /* Center the text */
}

.live-stats-card.full-room {
    border-left: 5px solid red;
}

.live-stats-card.active-room {
    border-left: 5px solid green;
}

[data-tooltip] {
    position: relative;
    cursor: pointer;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    background-color: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 1000;
    top: 100%; /* Aligns below the element */
    left: 50%;
    transform: translateX(-50%);
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#live-streams-panel {
    background-color: #2b2b2b;
    padding: 0px;
    margin-bottom: 20px;
}

#live-streams-panel h2 {
    font-size: 1.5em;
    margin-top: 6px;
    margin-bottom: 10px;
    color: white;
}

.live-streams-cards {
    display: flex;
    flex-direction: column; /* Stacks embeds vertically */
    gap: 15px;
}

.twitch-embed {
    width: 100%; /* Full width of the parent container */
    height: 360px;
}

.live-stream {
    border: none;
    border-radius: 10px;
    width: 100%;
    height: 315px; /* Adjust height as needed */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.twitch-embed-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 0px;
    background-color: #1e1e1e;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.twitch-channel-link {
    font-size: 1.2em;
    font-weight: bold;
    color: #9146ff; /* Twitch purple color */
    text-decoration: none;
    text-align: center;
}

.twitch-channel-link:hover {
    text-decoration: underline;
}


/* Center Vault Panel */
#vault-panel {
    width: 100%;
    max-width: 1550px;
    background-color: #2b2b2b;
    padding: 6px 6px;
    border-radius: 10px;
    box-shadow: 0px 0px 4px 6px rgba(0, 0, 0, 0.5);
    background: linear-gradient(to bottom, rgb(43 43 43 / 0%) 19%, /* Fully opaque background color at the top */ rgb(24 24 24) 30% /* Fully transparent halfway down */), url(https://thpsx.com/wp-content/themes/thpsx/background_2.png);
    background-repeat: no-repeat;
    background-size: 376%, 100%;
    background-position-x: 0px, 0px;
    background-position-y: 0px, 0px;
    position: relative;
    overflow: hidden;
}
/* Vault panel overlay styles */
#vault-panel.loading::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%; /* Match the width of the vault panel */
    height: 100%; /* Match the height of the vault panel */
    background-color: rgba(0, 0, 0, 0.1); /* Semi-transparent black */
    backdrop-filter: blur(1px); /* Blur effect */
    z-index: 10; /* Ensure it appears above the content */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Spinner for the vault panel */
#vault-panel.loading::after {
    content: "";
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #ffffff; /* White spinner */
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    position: absolute;
    top: 8%; /* Center spinner vertically */
    left: 50%; /* Center spinner horizontally */
    transform: translate(-50%, -50%);
    z-index: 11; /* Above the overlay */
}

/* Floating Navigation Panel */
#floating-nav-panel {
    background-color: #1e1e1e;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0px 0px 4px 6px rgba(0, 0, 0, 0.5);
    position: fixed;
    top: 666px;
    left: calc(60% + 300px);
    width: 250px;
    z-index: 1000;
    overflow-y: auto;
    max-height: calc(100vh - 200px);
}

#floating-nav-panel form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#floating-nav-panel input{
    padding: 10px 15px;
    background-color: #25272a;
    color: #fff;
    border: 1px solid #007bff;
    border-radius: 5px;    
    font-size: 1em;
    transition: background-color 0.3s ease, color 0.3s ease;
}

#floating-nav-panel select,
#floating-nav-panel button {
    padding: 10px 15px;
    background-color: #1e1e1e;
    color: #fff;
    border: 1px solid #007bff;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease, color 0.3s ease;
}

#nav-content form {
    display: block;
}

#nav-content label {
    margin-left: 10px;
}


#nav-content input{
    background-color: #25272a;
    color: #fff;
    border: 1px solid #007bff;
    border-radius: 5px;    
    font-size: 1em;
    transition: background-color 0.3s ease, color 0.3s ease;
}

#nav-content select {
    padding: 5px 5px;
    background-color: #1e1e1e;
    color: #fff;
    border: 1px solid #007bff;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease, color 0.3s ease;
    margin-right: 10px;
}

#nav-content button {
    padding: 8px 13px;
    margin-left: 6px;
    background-color: #1e1e1e;
    color: #fff;
    border: 1px solid #007bff;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease, color 0.3s ease;
}

:root {
    --nav-horizontal-offset: 0px; /* Default offset */
}

#nav-content button:hover {
    background-color: #0056b3;
}

#nav-content {
    position: relative;
    z-index: 1;
    margin-top: -20px;
    width: fit-content;
    background: #171717;
    padding: 4px 4px;
    border-radius: 5px 5px 0px 0px;
}


#floating-nav-panel button:hover {
    background-color: #0056b3;
}

/* Vault Cards */
/* Vault Cards */
.vault-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    /* margin-left: 122px; */
    padding: 10px;
    background: #171717;
    border-radius: 10px;
    margin-top: -35px;
    width: 100%;
}

#theCards {
    margin-top: 20px;
}

#vault-cards .card {
    background-color: #1e1e1e;
    border-radius: 10px;
    padding: 12px 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 300px;
    text-align: center;
    height: 256px;
    margin-top: 10px;
}


#NoResults {
    left: 45%;
    position: relative;
}

.card {
    width: 32%;
    min-width: 300px;
    background-color: #1e1e1e;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    position: relative;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 360px;
    color: #ffffff;
    background: linear-gradient(to bottom, rgb(23 29 49 / 67%) 11%, rgb(24 24 24 / 91%) 25%), url(https://thpsx.com/wp-content/themes/thpsx/background_5.png);
    background-size: 108%;
    background-position-x: 133px;
    background-position-y: 0px;
    background-repeat: repeat;
}

.card:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.7), inset 0 2px 4px rgba(255, 255, 255, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card a {
    color: inherit; 
    text-decoration: none; 
}

.card-link {
    text-decoration: none;
    color: white;
}

.card-img {
    width: calc(100% - 20px); 
    height: auto;
    margin: 10px auto;
    height: 150px; 
    cursor: pointer;
    object-fit: contain; 
}

.card-body {
    padding: 1px;
    flex-grow: 1; 
}

.card-title {
    font-size: 1.2em;
    margin-top: 0px;
    margin-bottom: 0px;
    white-space: nowrap;
    overflow: hidden;
    position: relative;
    padding: 3px 4px;
    border-radius: 5px 5px 0px 0px;
    color: #fdfcfb;
    opacity: 1;
    display: block;
    max-width: 100%;
}

.card-author {
    font-size: 1em;
    color: #ccc;
    margin-top: -10px;
    margin-bottom: 0px;
    font-family: 'Poppins', sans-serif;
}

.card-desc {
    font-size: 0.9em;
    margin-bottom: 65px;
    height: 65px;
    overflow: hidden;
    padding: 0px 10px 0px 10px;
    font-family: 'Poppins', sans-serif;
}

.card-rating {
    margin-bottom: 15px;
}

.stars {
    background: url('https://thpsx.com/thevaultdir/ratingStars.png') repeat-x;
    height: 20px;
    background-size: contain;
}

.card-download-btn {
    padding: 10px 15px;
    background-color: #1e1e1e;
    color: #fff;
    border: 1px solid #007bff;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.card-download-btn:hover {
    background-color: #0056b3;
}

.card-download-count {
    position: absolute; 
    bottom: 6px; 
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.9em;
    color: #ccc;
}

.card-download-count p {
    margin-bottom: 0px;
}

/* Card Types (Bottom Border Colors) */
.card.Parks { border-bottom: 5px solid green; }
.card.Skaters { border-bottom: 5px solid blue; }
.card.CustomSkaters { border-bottom: 5px solid orange; }
.card.CustomLevels { border-bottom: 5px solid purple; }
.card.General { border-bottom: 5px solid gray; }

/* Full Image Overlay */
.full-image-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s, opacity 0.3s ease-in-out;
}

.full-image-overlay img {
    max-width: 90vh;
    max-height: 90vh;
    border-radius: 10px;
    display: block; /* Ensures the image behaves properly as a block element */
    margin: 0 auto; /* Centers the image horizontally */
}

.full-image-overlay .image-container {
    position: relative; /* Makes the image container a positioning context */
    display: inline-block; /* Ensures the container wraps around the image size */
}

.full-image-overlay .close-btn {
    position: relative;
    float: right;
    top: 10px; /* Aligns with the top of the image */
    right: 10px; /* Aligns with the right of the image */
    background: #ff5f5f;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.2em;
    z-index: 10; /* Ensures the button stays on top */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5); /* Optional shadow for visibility */
}

/* Show overlay */
.full-image-overlay.show {
    visibility: visible;
    opacity: 1;
}

.vaultTitle {
    margin-top: -20px;
    height: 80px;
    width: 100%;
    position: absolute;
}
/* Pagination Buttons */
.pagination {
    display: block;
    position: relative;
    margin: 0px 0px 0px 0px;
    width: 100%;   
}

#topPagi {
    margin-top: 0px;
}

#bottomPagi {
    margin-top: -33px;
    height: 60px;
}

.pagination a {
    display: block;
    color: white;
    background-color: #1e1e1e;
    padding: 10px 15px;
    border: 1px solid #007bff;
    border-radius: 5px;
    text-decoration: none;
    font-size: 1em;
    font-weight: bold;
    text-align: center;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;    
}
#pageCount{    
    margin-top: -10px;
    background: #1e1e1e;
    width: 100%;
    height: fit-content;
}
#topPagiPrev {
    float: left;
    z-index: 2;
    position: relative;
    margin-top: 29px;
    margin-left: 6px;
}
#topPagiNext {
    float: right;    
    z-index: 2;
    position: relative;
    margin-top: 29px;
    margin-right: 6px;
}
#bottomPagiPrev {
    float: left;
    margin-top: 20px;
}
#bottomPagiNext {
    float: right;
    margin-top: 20px;
}

.pagination a:hover {
    background-color: #007bff; /* Darker shade on hover */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Adds a slight shadow on hover */
}

.pagination span {
    background-color: #1e1e1e;
    border-radius: 5px;
    padding: 3px 5px;
    position: relative;
    bottom: -20px;
    display: block;
    width: 100%;
    height: 100%;
    font-size: 23px;
    font-weight: bold;
    background: linear-gradient(to bottom, rgb(23 29 49 / 67%) 11%, rgb(24 24 24 / 91%) 86%), url(https://thpsx.com/wp-content/themes/thpsx/background_5.png);
    background-size: 66%;
    background-position-x: 588px;
    background-position-y: 0px;
    background-repeat: repeat;
}



#toggle-panel-btn {
    display: none;
}

/* Responsive Design */
@media (max-width: 1024px) {
    #stats-vault-layout {
        grid-template-columns: 100%;
    }

    #live-stats-panel,
    #vault-panel,
    #floating-nav-panel {
        max-height: none;
        position: static;
    }

    #liveStatsImage {
        max-width: 50%;
        margin-top: 20px;
    }

    #floating-nav-panel {
        position: static;
        width: 100%;
        margin-top: 20px;
    }

    .card {
        width: 100%;
    }

    .isFirstCard {
        margin-top: 200px;
    }

    #nav-content form {
        width: 100%;
        display: grid;
    }
    #nav-content {
        width: 100%;       
    }

    #nav-content label {
        margin-left: 0px;
    }

    #nav-content button {
        margin-left: 0px;
    }

    #nav-content select {
        margin-right: 0px;
        text-align: center;
    }

    #nav-content input {
        margin-bottom: 4px;
    }
    
    #topPagiPrev {
        margin-top: 0px;
        margin-left: 0px;
    }

    #topPagiNext {
        margin-top: 0px;
        margin-right: 0px;
    }

    .pagination a {
        padding: 7px 10px;
    }

    #vault-panel {
        background: linear-gradient(to bottom, rgb(43 43 43 / 0%) 3%, /* Fully opaque background color at the top */ rgb(24 24 24) 6% /* Fully transparent halfway down */), url(https://thpsx.com/wp-content/themes/thpsx/background_2.png);
        background-repeat: no-repeat;
        background-size: 312%, 100%;
        background-position-x: 0px, 0px;
        background-position-y: 0px, 0px;
    }

}



@media (max-width: 420px) {
    
    #theVaultImage {
        max-width: 100%;
        margin-top: -38px;
    }

    #liveStatsImage {
        max-width: 70%;
        margin-top: 20px;
    }

    #thpsXImage {
        margin-bottom: -100px;
        height: auto;
        max-width: 77%;
        position: relative;
        margin-top: 40px;
    }

    .full-image-overlay img {
        width: 100%;
    }

    #popular-downloads-panel {
        /*display: none; /* Hide by default */
        margin-top: 100px !important;
    }

    #live-stats-panel {
        margin-left: 1px;
    }

    #stats-vault-layout {
        grid-template-columns: 100%;
        /* animation-direction: unset; */
        flex-flow: column-reverse;
        display: flex;
    }

    .vault-cards {
        grid-column: 1 / -1; /* Take up the full width */
    }

    #toggle-panel-btn {
        display: block;
        position: absolute;
        z-index: 20;
        padding: 7px 5px;
        background-color: #1e1e1e;
        color: #fff;
        border: 1px solid #007bff;
        border-radius: 5px;
        cursor: pointer;
        font-size: 1em;
        transition: background-color 0.3s ease, color 0.3s ease;
        transform: rotate(-90deg);
        transform-origin: center;
        width: max-content;
    }

    /* Show the popular downloads panel when active */
    #popular-downloads-panel.active {
        display: block; /* Make it visible */
        grid-column: 1 / -1; /* Take up full width */
        width: 100%;
    }

    /* Hide the vault cards when the panel is active */
    .vault-cards.hidden {
        display: none;
    }

    #popular-downloads-content .card {
        width: 100% !important;
        flex-direction: column !important;
    }
    .show-vault {
        margin-left: -81px !important;
    }
    .show-popular {
        margin-left: -49px !important;
    }
    .show-popular-onload {
        margin-left: -81px !important;
    }

    #vault-panel {
        background: linear-gradient(to bottom, rgb(43 43 43 / 0%) 3%, rgb(24 24 24) 14%), url(https://thpsx.com/wp-content/themes/thpsx/background_2.png);
        background-repeat: repeat;
        background-size: 312%, 100%;
        background-position-x: 0px, 0px;
        background-position-y: 0px, 0px;
    }
}

#popular-downloads-panel {
    padding: 10px 2px 12px;
    margin-bottom: 0px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    margin-top: 10px;
    width: 100%;
    position: relative;
    background: #171717;
}

/* Loading overlay styles */
#popular-downloads-panel.loading::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.1); /* Semi-transparent black */
    backdrop-filter: blur(1px); /* Blur effect */
    z-index: 10; /* Ensure it appears above the content */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Spinner for the loading effect */
#popular-downloads-panel.loading::after {
    content: "";
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #ffffff; /* White spinner */
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 110; /* Above the overlay */
}

/* Spinner animation */
@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

#recent-downloads-count {
    float: left;
    position: relative;
    margin-top: -58px;
    margin-left: 15px;
    /* font-size: 30px; */
    width: min-content;
}

#total-downloads-count {
    float: right;
    position: relative;
    margin-top: -58px;
    margin-right: 18px;
    /* font-size: 30px; */
    width: min-content;
}

#recent-downloads-count span {    
    font-size: 18px;
}

#total-downloads-count span {    
    font-size: 18px;
}

#popular-downloads-title {
    margin-top: 2px;
    height: 85px;
    width: 99%;
    position: relative;
    background: linear-gradient(to bottom, rgb(23 29 49 / 67%) 11%, rgb(24 24 24 / 91%) 86%), url(https://thpsx.com/wp-content/themes/thpsx/background_5.png);
    background-size: 44%;
    background-position-x: 774px;
    background-position-y: 0px;
    background-repeat: repeat;
    border-radius: 6px;
}

#popular-downloads-panel h2 {
    font-size: 0;
    text-align: center;
    background-image: url(https://thpsx.com/wp-content/themes/thpsx/thpsx_logo_2025_v1.png);
    background-repeat: no-repeat;
    background-position: center;
    background-position-y: -28px;
    background-size: 35%;
    height: 160px;    
    position: relative;

    /* Apply radial gradient mask */
    -webkit-mask-image: radial-gradient(circle, rgba(0, 0, 0, 1) 60%, rgba(0, 0, 0, 0) 100%);
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    -webkit-mask-size: 100% 100%;
    mask-image: radial-gradient(circle, rgba(0, 0, 0, 1) 60%, rgba(0, 0, 0, 0) 100%);
    mask-repeat: no-repeat;
    mask-position: center;
    mask-size: 100% 100%;
}
#popular-downloads-panel h3 {
    margin-top: -2px;
    margin-bottom: -36px;
    /* background: #171717; */
    padding: 3px 6px 3px 6px;
    border-radius: 5px 5px 0px 0px;
    width: fit-content;
    font-size: 23px;
    font-weight: bold;
}
/*
.popular-downloads-full {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 6px;
}
*/
#popular-downloads-filter {
    display: flex;
    gap: 10px;
    margin-top: 35px;
    margin-bottom: 6px;
    place-content: center;
    background: #171717;
    width: fit-content;
    padding: 6px 10px 10px 10px;
    border-radius: 6px 6px 0px 0px;
}

#popular-downloads-filter button {
    padding: 10px 15px;
    background-color: #1e1e1e;
    color: #fff;
    border: 1px solid #007bff;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease, color 0.3s ease;
}

#popular-downloads-filter button:hover {
    background-color: #007bff;
    color: white;
}

#popular-downloads-filter button.active {
    background-color: #007bff;
    color: white;
    border: 1px solid #0056b3;
    cursor: default;
}

#popular-downloads-filter label {
    margin-right: 10px;
}

#popular-downloads-content {
    background: #171717;
    padding: 18px 0px 12px 0px;
    margin-top: -6px;
    margin-bottom: -15px;
    border-radius: 0px 0px 5px 5px;
    width: 100%;
}

#popular-downloads-content .popular-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-left: 12px;
    margin-right: 12px;
}

#popular-downloads-content .card {
    background-color: #1e1e1e;
    border-radius: 10px;
    padding: 15px 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    width: 12%;
    text-align: center;
    height: 256px;
    display: flex;    
}

#popular-downloads-content .card:hover {
    transform: scale(1.049);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.7), inset 0 2px 4px rgba(255, 255, 255, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-body p {
    text-align: center;
    margin-top: 4px;
}

#popular-downloads-content .card-body {
    padding: 1px;
    flex-grow: 1;
    margin-top: -58px;
}

#popular-downloads-content .card-img {
    width: 100%;
    max-height: 150px;
    object-fit: cover;
    border-radius: 5px;
    margin-top: 20px;
}

#popular-downloads-content .card-img:hover .card-title {
    opacity: 0; /* Makes the text invisible on hover */
}

#popular-downloads-content .card-title {
    font-size: 1.2em;
    margin-top: -140px;
    white-space: nowrap; /* Prevents text from wrapping */
    overflow: hidden; /* Hides overflowing content */
    position: relative; /* Ensures the animation stays within bounds */
    /*background: rgba(0, 0, 0, 0.5);*/
    padding: 0px 4px;
    border-radius: 5px 5px 0px 0px;
    color: #fdfcfb;
    opacity: 1;
    display: block;
    max-width: 100%;
}

#popular-downloads-content .card-author {
    text-align: center;    
    /*background: rgb(0 0 0 / 28%);*/
    padding: 0px 4px;
    border-radius: 5px;
    color: #ccc;
    margin-top: 155px;
}

#popular-downloads-content .title-author {
    margin: 0px 0px;
    justify-items: center;
}

#popular-downloads-content .card-title span {
    display: inline-block;
    position: absolute;
    animation: scroll-title 10s linear infinite; /* Adjust duration (10s) for speed */
}

#popular-downloads-form {
    z-index: 130;
}

/* Animation for scrolling */
@keyframes scroll-title {
    0% {
        transform: translateX(100%); /* Start offscreen on the right */
    }
    100% {
        transform: translateX(-100%); /* Scroll completely offscreen to the left */
    }
}


#popular-downloads-content .card-desc {
    font-size: 0.9em;
    color: #ccc;
    margin-top: 2px;
}

