/* General Styles */
.main-navigation a {
    display: block;
    text-decoration: none;
    color: #fff;
    text-transform: uppercase;
    font-weight: 700;
    font-size: 17px;
    top: 50%;
    transform: translateY(-50%);
    position: relative;
    margin-top: -1px;
    border-bottom: 2px solid transparent;
    font-family: 'Roboto', sans-serif;
}

body {
    background-color: #2b2b2b;
    margin: 0;
    padding: 0;
    font-family: 'Nunito Sans', 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;
}


/* 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;
}

/* Center Vault Panel */
#vault-panel {
    width: 100%;
    max-width: 1550px;
    background-color: #2b2b2b;
    padding: 15px;
    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);
    margin-left: 1550px;
}

#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 20px;
    border-radius: 5px 5px 0px 0px;
}

/* Vault Cards */
.vault-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    /* margin-left: 122px; */
    padding: 10px;
    background: #171717;
    border-radius: 10px;
    margin-top: 0px;
    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-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: 96%;
}

.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;
    }

    #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;
    }

    .full-image-overlay img {
        width: 100%;
    }

    #popular-downloads-panel {
        display: none; /* Hide by default */
    }

    .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 {
        max-width: 345px !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;
    }
}

/* Wrapper to lock button in place */
#button-wrapper {
    position: fixed; /* Locks the wrapper to the viewport */
    left: 0; /* Adjust horizontal position */
    top: 50%; /* Adjust vertical position */
    transform: translate(0, -50%); /* Centers it vertically */
    z-index: 100; /* Keeps it above other elements */
}

#popular-downloads-panel {
    padding: 10px 2px 20px;
    margin-bottom: 0px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    background: #171717;
    margin-top: 0px;
    margin-left: 0px;
    width: 320px;
    max-height: fit-content;
    position: relative;
    float: left;
}

/* 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: 11; /* 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-panel h3 {
    margin-top: -29px;
    margin-bottom: -30px;
    margin-left: 8px;
    padding: 4px 6px;
    border-radius: 5px 5px 0px 0px;
    width: 94%;
    height: 80px;
    background: #1e1e1e;
    position: absolute;
    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: 201%;
    background-position-x: 691px;
    background-position-y: 0px;
    background-repeat: repeat;
}
/*
.popular-downloads-full {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 6px;
}
*/
#popular-downloads-filter {
    display: flex;
    gap: 10px;
    margin-top: 30px;
    margin-bottom: 6px;
    place-content: center;
    width: fit-content;
    padding: 6px 14px 0px;
    border-radius: 5px 5px 0px 0px;
    z-index: 10;
    position: relative;
}

#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 {
    padding: 12px 0px 12px 0px;
    margin-top: -6px;
    margin-bottom: -15px;
    border-radius: 0px 0px 5px 5px;
}

#popular-downloads-content .popular-cards {
    display: block;
}

#popular-downloads-content .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;
}

#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: 95%;
}

#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 */
}

/* 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;
}

#tags-panel {
    float: right;
    background: #171717;
    border-radius: 8px;
    padding: 15px 8px 11px 8px;
    width: 100%;
    margin-top: 96px;
    box-shadow: 0px 0px 4px 2px rgba(0, 0, 0, 0.5);
    max-height: fit-content;
}

#tags-panel.collapsed {
    margin-top: 66px;
    margin-left: 30px;
    width: 0; /* Collapse to zero width */
    padding: 0; /* Remove padding when collapsed */
    border: none; /* Hide border when collapsed */    
}

#tags-inner-panel {
    background: #1e1e1e;
    padding: 4px;
    border-radius: 5px;
    margin-top: -40px;
    opacity: 1;
}

#tags-panel h3 {
    font-size: 1.2rem;
    color: #fff;
    margin-top: 0px;
    margin-bottom: 72px;
}

.tag-checkbox {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.tag-checkbox input {
    margin-right: 8px;
}

.tag-checkbox label {
    text-align: justify;
}

#tags-panel button[type="submit"] {
    padding: 10px;
    cursor: pointer;
    width: 100%;
    display: block;
    color: white;
    background-color: #1e1e1e;
    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;
}

#tags-panel button[type="submit"]:hover {
    background-color: #0056b3;
}

#toggle-tags-panel {
    position: relative;
    top: 5px;
    left: -2px;
    color: white;
    background-color: #1e1e1e;
    border: 1px solid #007bff;
    border-radius: 5px;
    text-decoration: none;
    font-size: 1em;
    text-align: center;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

#toggle-tags-panel:hover {
    background-color: #0056b3;
}

#tags-panel.collapsed #toggle-tags-panel {
    transform: translateX(50px); /* Move the button back to the edge */
    rotate: 90deg;
    margin-left: -59px;
    padding: 5px 12px;
}

/* Grid container */
#vault-grid {
    display: grid;
    grid-template-columns: 1fr 8fr auto;
    gap: 6px;
    margin-top: -35px;
    transition: grid-template-columns 0.3s ease; /* Smooth resizing */
}