/*
	Theme Name: ROMSFUN-V2
	Theme URI: mail:foodcenter.live@gmail.com
	Description: ROMSFUN-V2
	Version: 1.0.0
	Author: Trump
	Author URI: mail:foodcenter.live@gmail.com
	Tags: Tailwindcss
	License: MIT
	Text Domain: romsfun
	License URI: http://opensource.org/licenses/mit-license.php
*/

#wpadminbar {
    position: absolute !important;
}

html {
    scroll-behavior: smooth;
}
/* Base font styles matching design */
body {
    font-family: "Plus Jakarta Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.6;
    background-color: #f3f3f3;
    color: #101828;
}

.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: #e91e63;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.scroll-to-top:hover {
    background-color: #c2185b;
    transform: translateY(-3px);
}

.scroll-to-top.hidden {
    display: none;
}

/* Horizontal Scroll Container */
.horizontal-scroll-container {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: rgba(155, 155, 155, 0.5) transparent;
}

.horizontal-scroll-container::-webkit-scrollbar {
    height: 8px;
}

.horizontal-scroll-container::-webkit-scrollbar-track {
    background: transparent;
}

.horizontal-scroll-container::-webkit-scrollbar-thumb {
    background-color: rgba(155, 155, 155, 0.5);
    border-radius: 4px;
}

.horizontal-scroll-container::-webkit-scrollbar-thumb:hover {
    background-color: rgba(155, 155, 155, 0.7);
}

.horizontal-scroll-wrapper {
    display: flex;
    padding: 16px 0;
    scroll-snap-type: x mandatory;
    touch-action: pan-x pan-y;
}

.horizontal-scroll-wrapper > * {
    scroll-snap-align: start;
}

/* Carousel styles */
.carousel-container {
    position: relative;
    overflow-x: hidden;
    overflow-y: visible;
    padding: 0;
}

.carousel-wrapper {
    display: flex;
    transition: transform 0.5s ease-in-out;
    will-change: transform;
    padding: 16px 0;
    margin: 0 -4px;
}

.carousel-button {
    background-color: #e91e63;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.carousel-button:hover:not(.disabled):not(:disabled) {
    background-color: #c2185b;
    transform: scale(1.1);
}

.carousel-button.disabled,
.carousel-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.carousel-button.disabled:hover,
.carousel-button:disabled:hover {
    background-color: #e91e63;
    transform: none;
}

/* Badge styles for Popular ROMs */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background-color: #f3f4f6;
    border-radius: 12px;
    font-size: 12px;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.badge-genre {
    background-color: #e0e7ff;
    color: #3730a3;
    border-color: #c7d2fe;
}

.badge-info {
    background-color: #f3f4f6;
    color: #6b7280;
    border-color: #e5e7eb;
}

.carousel-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Header Menu Styles */
.header-nav-link {
    display: inline-block;
    padding: 8px 16px;
    background-color: white;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    border-radius: 4px;
    transition: all 0.3s;
}

.header-nav-link:hover {
    background-color: #f3f4f6;
}

.header-nav-link.active {
    background-color: #e91e63;
    color: white;
}

/* Mobile Menu Styles */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

.mobile-menu-overlay.active {
    display: block;
}

.mobile-menu-panel {
    position: fixed;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100vh;
    background-color: #e91e63;
    z-index: 1000;
    transition: left 0.3s ease-in-out;
    overflow-y: auto;
}

.mobile-menu-panel.active {
    z-index: 999999;
    left: 0;
}

.mobile-menu-header {
    background-color: #e91e63;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.mobile-menu-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.mobile-menu-close:hover {
    opacity: 0.8;
}

.mobile-menu-content {
    padding: 0;
}

.mobile-menu-item {
    display: block;
    padding: 16px 20px;
    color: white;
    text-decoration: none;
    font-size: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.2s;
}

.mobile-menu-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.mobile-menu-item.active {
    background-color: white;
    color: #e91e63;
}

/* Container max-width for desktop */
@media (min-width: 1024px) {
    .content-container {
        max-width: 1200px;
        margin: 0 auto;
    }
}

/* Custom Multi-Select Dropdown Styles */
.custom-select-wrapper {
    position: relative;
}

.custom-select-trigger {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    font-size: 14px;
    color: #333;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s;
}

.custom-select-trigger:hover {
    border-color: #e91e63;
}

.custom-select-trigger.active {
    border-color: #e91e63;
    box-shadow: 0 0 0 3px rgba(233, 30, 99, 0.1);
}

.custom-select-trigger .selected-text {
    flex: 1;
    text-align: left;
    color: #666;
}

.custom-select-trigger .selected-text.has-selection {
    color: #333;
}

.custom-select-trigger .arrow {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #666;
    transition: transform 0.3s;
    margin-left: 10px;
}

.custom-select-trigger.active .arrow {
    transform: rotate(180deg);
}

.custom-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-top: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 380px;
    overflow-y: auto;
    display: none;
}

.custom-select-dropdown.active {
    display: block;
}

.custom-select-option {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 14px;
}

.custom-select-option:hover {
    background-color: #f5f5f5;
}

.custom-select-option input[type="checkbox"] {
    margin-right: 10px;
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #e91e63;
}

.custom-select-option input[type="radio"] {
    margin-right: 10px;
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #e91e63;
}

.custom-select-option label {
    cursor: pointer;
    flex: 1;
    margin: 0;
    font-size: 14px;
    color: #333;
}

/* Close dropdown when clicking outside */
.custom-select-wrapper.closing .custom-select-dropdown {
    animation: fadeOut 0.2s ease-out;
}



@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* Scrollbar styling for dropdown */
.custom-select-dropdown::-webkit-scrollbar {
    width: 8px;
}

.custom-select-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.custom-select-dropdown::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.custom-select-dropdown::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.revert * {
    all: revert;
    max-width: 100%;
}

/* Toast Notification Styles */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    pointer-events: auto;
    animation: slideInRight 0.3s ease-out;
    position: relative;
    overflow: hidden;
}

.toast::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: #e91e63;
}

.toast.success::before {
    background-color: #10b981;
}

.toast.error::before {
    background-color: #ef4444;
}

.toast.hiding {
    animation: slideOutRight 0.3s ease-in forwards;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast.success .toast-icon {
    color: #10b981;
}

.toast.error .toast-icon {
    color: #ef4444;
}

.toast-content {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
    color: #374151;
}

.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    border-radius: 4px;
}

.toast-close:hover {
    color: #374151;
    background-color: #f3f4f6;
}

/* Adjust for mobile */
@media (max-width: 640px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .toast {
        padding: 14px;
    }
    
    @keyframes slideInRight {
        from {
            transform: translateY(-100px);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }
    
    @keyframes slideOutRight {
        from {
            transform: translateY(0);
            opacity: 1;
        }
        to {
            transform: translateY(-100px);
            opacity: 0;
        }
    }
}

/* Adjust for admin bar */
body.admin-bar .toast-container {
    top: 52px;
}

@media screen and (max-width: 782px) {
    body.admin-bar .toast-container {
        top: 66px;
    }
}

#magic-search-results:not(:empty) {
    position: absolute;
    display: block;
    width: 100%;
    background: #ffffff;
    z-index: 1;
    top: 80px;
    left: 0;
    border: 1px solid #eee;
    border-radius: 40px;
    padding: 1.5rem;
    box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2);
}

.magic-search-item {
    font-size: small;
    margin-right: 0;
    display: block;
}

.magic-search-item a {
    padding: 0;
    margin-bottom: 10px;
    border: none;
    display: grid;
    grid-template-columns: 45px auto 65px;
    grid-template-rows: 45px;
    align-items: center;
    gap: 10px;
}

.magic-search-item a img {
    width: 45px;
    height: 45px;
    object-fit: cover;
    border-radius: 3px;
    margin-right: 10px;
    display: inline-block;
}

.float-search {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: calc(100% - 120px);
    z-index: 60;
}

.float-search__hide {
    display: none;
}

.float-search input {
    height: 50px;
    padding-left: 60px;
}

.float-search .float-search-result:not(:empty) {
    position: relative;
    display: block;
    width: 100%;
    background: #ffffff;
    z-index: 1;
    top: 65px;
    border: 1px solid #eee;
    border-radius: 40px;
    padding: 1.5rem;
    margin-bottom: 75px;
}

.float-search-bg {
    background: #00000096;
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    z-index: 50;
}

.float-search-bg__hide {
    display: none;
}

/* =============================================
   Account Widget Styles (rf-account)
   ============================================= */
.rf-account {
    position: relative;
    display: flex;
    align-items: center;
}

/* Guest sign-in icon button */
.rf-icon-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 6px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}
.rf-icon-btn:hover { background: rgba(255,255,255,0.15); }
.rf-icon-btn svg { width: 22px; height: 22px; flex-shrink: 0; }

/* Authed menu */
.rf-menu { position: relative; }

.rf-user-trigger {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    transition: background 0.2s;
}
.rf-user-trigger:hover { background: rgba(255,255,255,0.15); }

.rf-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.rf-name { font-size: 13px; font-weight: 600; max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rf-caret { font-size: 10px; line-height: 1; }

.rf-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: white;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.15), 0 2px 8px rgba(0,0,0,0.08);
    min-width: 200px;
    z-index: 99999;
    overflow: hidden;
    padding: 6px 0;
    /* Prevent clipping by sticky header */
    transform: translateZ(0);
}
.rf-menu.open .rf-dropdown { display: block; }

/* Logout item — separated with a top border */
.rf-di--logout {
    border-top: 1px solid #f3f4f6;
    margin-top: 4px;
}

.rf-di {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    color: #374151;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none !important;
    background: none;
    border: none;
    width: 100%;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    line-height: 1.4;
    text-align: left;
}
.rf-di:hover { background: #fdf2f8; color: #e91e63; }
.rf-di svg { width: 16px; height: 16px; flex-shrink: 0; color: #9ca3af; transition: color 0.15s; }
.rf-di:hover svg { color: #e91e63; }
.rf-di span { white-space: nowrap; }

/* Visibility toggles — JS sets .rf-authed on <html> */
.rf-guest-only  { display: flex; }
.rf-authed-only { display: none;  }
html.rf-authed .rf-guest-only  { display: none;  }
html.rf-authed .rf-authed-only { display: flex;  }

/* =============================================
   Mobile auth blocks
   ============================================= */
.rf-mobile-login {
    padding: 20px 16px;
    border-top: 1px solid rgba(255,255,255,0.15);
}
.rf-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 20px;
    background: white;
    color: #374151;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    transition: opacity 0.2s;
}
.rf-login-btn:hover { opacity: 0.9; }
.rf-g { width: 18px; height: 18px; flex-shrink: 0; }

.rf-m-account {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.15);
}
.rf-m-user {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 6px 0;
}
.rf-m-meta { flex: 1; text-align: left; }
.rf-m-name { font-size: 14px; font-weight: 700; }
.rf-m-email { font-size: 11px; opacity: 0.7; }
.rf-m-caret { width: 16px; height: 16px; transition: transform 0.2s; }
.rf-m-user[aria-expanded="true"] .rf-m-caret { transform: rotate(180deg); }

.rf-m-submenu { display: none; padding-left: 38px; }
.rf-m-user[aria-expanded="true"] + .rf-m-submenu { display: block; }

.rf-m-sub-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    color: rgba(255,255,255,0.9);
    font-size: 13px;
    text-decoration: none;
    background: none;
    border: none;
    width: 100%;
    cursor: pointer;
    border-top: 1px solid rgba(255,255,255,0.1);
}
.rf-m-sub-item svg { width: 15px; height: 15px; flex-shrink: 0; }

/* =============================================
   Float search: icon positioned inside input
   ============================================= */
.float-search .search-icon-inside {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #9ca3af;
    display: flex;
    align-items: center;
}
.float-search .search-icon-inside svg { width: 20px; height: 20px; }


/* =============================================
   Bookmark Button
   ============================================= */
.rf-bookmark-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1.5px solid #e5e7eb;
    background: white;
    color: #6b7280;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
}
.rf-bookmark-btn:hover {
    border-color: #e91e63;
    color: #e91e63;
}
.rf-bookmark-btn.bookmarked {
    background: #fce7f3;
    border-color: #e91e63;
    color: #e91e63;
}
.rf-bookmark-btn svg {
    width: 16px;
    height: 16px;
}

/* =============================================
   User auth pages — full-screen centering
   ============================================= */
.site-main.min-h-screen {
    min-height: 100vh;
}


/* =============================================
   Pagination — the_posts_pagination() output
   ============================================= */
.navigation.pagination {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.nav-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

.nav-pagination .nav-links {
    justify-content: center;
}

/* Individual page number */
.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border: 1.5px solid #e5e7eb;
    background: #ffffff;
    color: #374151;
    transition: all 0.15s;
    line-height: 1;
}

.page-numbers:hover {
    background: #fce7f3;
    border-color: #e91e63;
    color: #e91e63;
}

/* Current / active page */
.page-numbers.current {
    background: #e91e63;
    border-color: #e91e63;
    color: #ffffff;
    cursor: default;
}

/* Dots / ellipsis */
.page-numbers.dots {
    border: none;
    background: none;
    color: #9ca3af;
    min-width: auto;
    padding: 0 4px;
    pointer-events: none;
}

/* Prev / Next links (contain SVG arrows in most templates) */
.page-numbers.prev,
.page-numbers.next {
    padding: 0 14px;
    gap: 4px;
}

.page-numbers.prev svg,
.page-numbers.next svg {
    width: 12px;
    height: 12px;
    display: inline;
}


/* =============================================
   Comment form submit button (class_submit)
   ============================================= */
.rf-comment-submit {
    display: inline-flex;
    align-items: center;
    padding: 8px 24px;
    background: #e91e63;
    color: #ffffff;
    border: none;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    outline: none;
}
.rf-comment-submit:hover {
    background: #c2185b;
}
.rf-comment-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* bg-shell / text-ink — referenced in single.php share buttons */
.bg-shell { background-color: #f9fafb; }
.text-ink  { color: #374151; }


/* Ensure account dropdown is never clipped by the sticky header */
header.sticky { overflow: visible !important; }
header .content-container { overflow: visible; }
header .flex.items-center.gap-2 { overflow: visible; position: relative; }
#rf-account { overflow: visible; }
.rf-menu { overflow: visible; }
