/* --- Custom Slider Styles --- */

/* Force 5 items per row on movie sections */
@media screen and (min-width: 62em) { /* Apply on larger screens */
    .MovieList.Rows > .TPostMv {
        -webkit-box-flex: 0;
        -webkit-flex: 0 0 20% !important;
        -ms-flex: 0 0 20% !important;
        flex: 0 0 20% !important;
        max-width: 20% !important;
    }
}


/* Add spacing between movie sections */
.Main > section {
    margin-bottom: 40px !important;
}


/* Uppercase section titles and add border */
.Top .Title {
    text-transform: uppercase !important;
    position: relative;
    padding-bottom: 10px;
}

.Top .Title:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background-color: #de1212;
}

/* Origin name styling for movie slider */
.MovieListTop .TPostMv .OriginName {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 4px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 5px;
}

/* Adjust title spacing when origin name is present */
.MovieListTop .TPostMv .Title {
    margin-bottom: 2px;
}

/* --- Custom Header Styles --- */

/* == Desktop Styles (min-width: 62em) == */
@media screen and (min-width: 62em) {
    /* Make search bar a fixed element on the right */
    .Header .Search {
        float: right;
        margin: 20px 0;
        width: 280px;
        position: relative;
    }

    /* Make the input field always visible */
    .Header .Search input {
        position: static !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        background-color: rgba(0, 0, 0, 0.3) !important;
        border: 1px solid rgba(255, 255, 255, 0.2) !important;
        border-radius: 20px !important;
        padding: 8px 45px 8px 20px !important;
        color: #fff !important;
        width: 100% !important;
        height: 40px !important;
        box-sizing: border-box;
        line-height: 24px;
        transition: background-color .2s;
    }

    .Header .Search input:focus {
        background-color: rgba(0, 0, 0, 0.5) !important;
    }

    .Header .Search input::placeholder {
        color: rgba(255, 255, 255, 0.7);
    }

    /* Position the search button (label) inside the input */
    .Header .Search .SearchBtn {
        position: absolute;
        right: 0;
        top: 0;
        width: 45px;
        height: 40px;
        cursor: pointer;
    }

    /* The search icon (magnifying glass) */
    .Header .Search .SearchBtn:before {
        font-size: 16px;
        line-height: 40px;
        width: 45px;
        text-align: center;
        color: #fff;
    }

    /* Hide the close icon (X) on desktop */
    .Header .Search .SearchBtn > i {
        display: none !important;
    }

    /* Prevent the toggle from hiding logo/menu on desktop */
    .Header .Top.open .Logo, .Header .Top.open .MenuBtn {
        opacity: 1 !important;
        visibility: visible !important;
    }
}

/* == Mobile Styles (max-width: 62em) == */
@media screen and (max-width: 62em) {
    /* Use flexbox for balanced header */
    .Header .Top {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 10px; /* Add some padding */
    }

    .Header .Logo {
        flex-grow: 1;
        text-align: center;
        padding: 10px 0;
    }

    .Header .Logo img {
        height: 35px;
        width: auto;
    }

    .MenuBtn, .Header .Search .SearchBtn {
        margin: 0 !important;
        flex-shrink: 0;
    }

    /* The search form container is hidden by default on mobile */
    .Header .Search input {
        display: none;
    }
    
    /* The search button (magnifying glass icon) */
    .Header .Search .SearchBtn {
        float: none; /* Override default float */
        color: #fff;
    }

    /* When search is OPEN on mobile */
    .Header .Top.open .Search {
        display: block;
        position: fixed;
        left: 0;
        top: 0;
        width: 100%;
        height: 80px;
        background-color: #1a1a1a;
        z-index: 20;
        padding: 20px;
    }
    
    .Header .Top.open .Search input {
        display: block;
        background-color: #333 !important;
        border: none !important;
        border-radius: 8px !important;
        height: 40px !important;
        color: #fff !important;
        padding: 8px 15px !important;
    }

    /* Hide the menu and logo when search is open */
    .Header .Top.open .MenuBtn, .Header .Top.open .Logo {
        opacity: 0 !important;
        visibility: hidden !important;
    }

    /* Position the search button (now the close button) correctly */
    .Header .Top.open .Search .SearchBtn {
        position: fixed;
        top: 20px;
        right: 20px;
        z-index: 21;
    }
}

/* --- Search Results Styles --- */
.Search .Result {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-top: 5px;
    max-height: 500px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    display: none;
}

.Search .Result.On {
    display: block;
}

.Search .Result .trloading {
    padding: 20px;
    text-align: center;
    color: #fff;
}

.Search .Result .trloading i {
    margin-right: 8px;
}

/* ResultList from theme */
.Search .Result .ResultList {
    padding: 10px;
}

.Search .Result .ResultList > .Title {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 15px 0;
    padding: 0 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.Search .Result .ResultList .TPost {
    display: flex;
    align-items: center;
    padding: 12px 10px;
    text-decoration: none;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background-color 0.2s;
}

.Search .Result .ResultList .TPost:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.Search .Result .ResultList .TPost:last-child {
    border-bottom: none;
}

.Search .Result .ResultList .TPost .Image {
    flex-shrink: 0;
    width: 60px;
    height: 85px;
    margin-right: 15px;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.Search .Result .ResultList .TPost .Image figure {
    margin: 0;
    width: 100%;
    height: 100%;
}

.Search .Result .ResultList .TPost .Image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.Search .Result .ResultList .TPost .Content {
    flex-grow: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.Search .Result .ResultList .TPost .Content .Title {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-transform: none;
    line-height: 1.3;
}

.Search .Result .ResultList .TPost .Info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.Search .Result .ResultList .TPost .Info span {
    display: inline-block;
}

.Search .Result .ResultList .TPost .Info .Vote {
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.Search .Result .ResultList .TPost .Info .Date {
    color: #de1212;
    font-weight: 600;
}

.Search .Result .ResultList .TPost .Info .Time {
    color: rgba(255, 255, 255, 0.5);
}

.Search .Result .ResultList .TPost .Info span:not(:last-child)::after {
    content: "•";
    margin-left: 8px;
    color: rgba(255, 255, 255, 0.3);
}

/* Mobile adjustments for search results */
@media screen and (max-width: 62em) {
    .Search .Result {
        position: fixed;
        top: 80px;
        left: 0;
        right: 0;
        border-radius: 0;
        max-height: calc(100vh - 80px);
        border: none;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .Search .Result .ResultList .TPost .Image {
        width: 55px;
        height: 78px;
        margin-right: 12px;
    }
    
    .Search .Result .ResultList .TPost .Content .Title {
        font-size: 14px;
    }
    
    .Search .Result .ResultList .TPost .Info {\n        font-size: 11px;\n        gap: 6px;\n    }\n}\n\n/* --- New Footer Styles --- */\n.new-footer {\n    background-color: #1a1a1a;\n    color: rgba(255, 255, 255, 0.7);\n    padding: 50px 0 30px;\n    border-top: 1px solid rgba(255, 255, 255, 0.1);\n}\n\n.new-footer .container {\n    max-width: 1200px;\n    margin: 0 auto;\n    padding: 0 15px;\n}\n\n.new-footer .footer-top {\n    display: grid;\n    grid-template-columns: auto 1fr auto;\n    align-items: center;\n    gap: 30px;\n    margin-bottom: 30px;\n    padding-bottom: 30px;\n    border-bottom: 1px solid rgba(255, 255, 255, 0.1);\n}\n\n.new-footer .footer-logo .logo img {\n    max-height: 45px;\n    display: block;\n}\n\n.new-footer .footer-social {\n    justify-self: center;\n}\n\n.new-footer .social-links {\n    display: flex;\n    gap: 10px;\n}\n\n.new-footer .social-links a {\n    display: flex;\n    justify-content: center;\n    align-items: center;\n    width: 40px;\n    height: 40px;\n    background-color: rgba(255, 255, 255, 0.05);\n    border-radius: 50%;\n    color: #fff;\n    text-decoration: none;\n    transition: background-color 0.3s;\n}\n\n.new-footer .social-links a:hover {\n    background-color: #de1212;\n}\n\n.new-footer .footer-menus {\n    display: flex;\n    gap: 40px;\n    justify-self: end;\n}\n\n.new-footer .menu-column {\n    display: flex;\n    flex-direction: column;\n    gap: 12px;\n}\n\n.new-footer .menu-column a {\n    color: rgba(255, 255, 255, 0.7);\n    text-decoration: none;\n    transition: color 0.3s;\n}\n\n.new-footer .menu-column a:hover {\n    color: #fff;\n}\n\n.new-footer .footer-description {\n    margin-bottom: 30px;\n    line-height: 1.6;\n    font-size: 14px;\n    max-width: 800px;\n}\n\n.new-footer .footer-copyright {\n    text-align: left;\n    font-size: 14px;\n    color: rgba(255, 255, 255, 0.5);\n}\n\n.scroll-to-top-button {\n    position: fixed;\n    bottom: 20px;\n    right: 20px;\n    width: 50px;\n    height: 50px;\n    background-color: #de1212;\n    color: #fff;\n    border: none;\n    border-radius: 8px;\n    cursor: pointer;\n    display: none;\n    justify-content: center;\n    align-items: center;\n    font-size: 20px;\n    z-index: 1000;\n    transition: opacity 0.3s, visibility 0.3s;\n}\n\n.scroll-to-top-button.show {\n    display: flex;\n}\n\n\n/* Responsive Footer */\n@media (max-width: 768px) {\n    .new-footer .footer-top {\n        flex-direction: column;\n        align-items: center;\n        text-align: center;\n    }\n\n    .new-footer .footer-logo-social {\n        margin-bottom: 30px;\n        display: flex;\n        flex-direction: column;\n        align-items: center;\n    }\n\n    .new-footer .footer-menus {\n        flex-direction: column;\n        gap: 20px;\n        width: 100%;\n        align-items: center;\n    }\n    \n    .new-footer .menu-column {\n        align-items: center;\n    }\n\n    .new-footer .footer-description,\n    .new-footer .footer-copyright {\n        text-align: center;\n    }\n}