/*
Theme Name: RscriptBlox Theme
Theme URI: https://rscriptsblox.com
Author: RscriptBlox Team
Author URI: https://rscriptsblox.com
Description: A premium Roblox script-sharing platform theme with Firebase Auth integration, real-time comments and forum, and a modern clean design. Optimized for Rscript, Script Blox, Delta Script, and Roblox Lua scripts.
Version: 2.8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: rscriptsblox
Tags: gaming, scripts, roblox, dark-mode, custom-post-type, firebase

Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
*/

/* ===== BASE STYLES & LAYOUT STABILITY (ZERO CLS) ===== */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    color-scheme: light;
    background-color: #f8fafc;
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden !important;
    max-width: 100vw !important;
    width: 100% !important;
}

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #f8fafc !important;
    color: #1e293b !important;
    overflow-x: hidden !important;
    max-width: 100vw !important;
    width: 100% !important;
    position: relative;
    margin: 0;
    padding: 0;
}

img, svg, video, canvas {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Lucide Icon stability — prevents zero-size icon jumps before JS runs */
[data-lucide] {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: middle;
    flex-shrink: 0;
}

/* ===== NAVBAR (FIXED BY DEFAULT TO PREVENT 60px PAGE JUMPS) ===== */
.navbar {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    width: 100% !important;
    z-index: 9999;
    background-color: rgba(255, 255, 255, 0.88) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid #e2e8f0 !important;
    will-change: transform;
}

/* ===== FONT FALLBACK — prevent FOUT while Inter loads ===== */
body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* ===== SCRIPT CARDS ===== */
.script-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.script-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(2, 132, 199, 0.12);
    border-color: #38bdf8;
}

.sc-thumb-container,
.script-thumb-container,
.ss-thumb-wrap {
    position: relative !important;
    aspect-ratio: 16 / 9;
    overflow: hidden !important;
    background-color: #f1f5f9;
    width: 100%;
}

.sc-thumb,
.script-thumb,
.ss-thumb-wrap img {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    transition: transform 0.3s ease;
}

.script-card:hover .sc-thumb,
.script-card:hover .script-thumb {
    transform: scale(1.03);
}

/* Thumbnail Badges (Matches Image 2) */
.sc-badge-tl {
    position: absolute !important;
    top: 10px !important;
    left: 10px !important;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    color: #0f172a;
    padding: 3px 9px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    z-index: 2 !important;
}

.sc-badge-tr {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    color: #0f172a;
    padding: 3px 9px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    z-index: 2 !important;
}

.sc-badge-bl {
    position: absolute !important;
    bottom: 10px !important;
    left: 10px !important;
    background: #ffffff;
    color: #0f172a;
    padding: 3px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    z-index: 2 !important;
}

.sc-badge-bl.keysystem {
    background: #ffffff !important;
    color: #0f172a !important;
}

.sc-badge-bl.keyless {
    background: #ffffff !important;
    color: #16a34a !important;
}

.sc-badge-bl.keyless span {
    color: #16a34a !important;
}

.sc-badges-br {
    position: absolute !important;
    bottom: 10px !important;
    right: 10px !important;
    display: flex !important;
    align-items: center;
    gap: 6px;
    z-index: 2 !important;
}

.sc-icon-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.sc-circle-key {
    border: 1px solid #fee2e2;
}

.sc-circle-mobile {
    border: 1px solid #dbeafe;
}

/* Card Body */
.sc-body {
    padding: 14px 16px 16px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.dark .sc-body {
    background: #0f172a;
}

.sc-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.sc-meta-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.sc-avatar-initials {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #7c3aed;
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: -0.02em;
}

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

.sc-game-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    font-size: 11.5px;
    font-weight: 700;
    color: #1e293b;
    background: #ffffff;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dark .sc-game-pill {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

.sc-likes {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11.5px;
    font-weight: 600;
    color: #94a3b8;
    white-space: nowrap;
}

.sc-title {
    color: #0f172a !important;
    font-size: 14.5px;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.15s ease;
}

.script-card:hover .sc-title {
    color: #0284c7 !important;
}

.dark .sc-title {
    color: #f8fafc !important;
}

.dark .script-card:hover .sc-title {
    color: #38bdf8 !important;
}

.sc-author-handle {
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    margin-top: auto;
}

.dark .sc-author-handle {
    color: #64748b;
}

/* ===== HERO ===== */
.hero-glow {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 800px;
    height: 600px;
    background: radial-gradient(circle, rgba(147, 51, 234, 0.05) 0%, rgba(59, 130, 246, 0.02) 50%, transparent 100%);
    filter: blur(80px);
    z-index: -1;
}

/* ===== CARDS ===== */
.card {
    background: white;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease-in-out;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 20px -10px rgba(0, 0, 0, 0.05);
    border-color: #9333ea;
}

.script-thumb-container {
    position: relative;
    height: 180px;
    overflow: hidden;
}

.script-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.script-card:hover .script-thumb {
    transform: scale(1.05);
}

/* ===== BADGES ===== */
.badge-free {
    background-color: #3b82f6;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
}

.badge-key {
    background-color: #eab308;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
}

.badge-views {
    background: #f1f5f9;
    color: #0284c7;
    padding: 6px 14px;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

/* ===== SEARCH ===== */
.search-container {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 9999px;
    padding: 4px;
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.search-input {
    flex: 1;
    padding: 12px 24px;
    border: none;
    outline: none;
    border-radius: 9999px;
    font-size: 1rem;
    color: #1e293b;
}

.search-button {
    background: #1e293b;
    color: white;
    padding: 10px 24px;
    border-radius: 9999px;
    font-weight: 700;
    transition: background 0.2s;
    flex-shrink: 0;
    border: none;
    cursor: pointer;
}

.search-button:hover {
    background: #0f172a;
}

@media (max-width: 640px) {
    .search-button {
        padding: 8px 16px;
        font-size: 14px;
    }

    .search-input {
        padding: 10px 16px;
        font-size: 14px;
    }
}

/* ===== FAQ ===== */
.faq-item {
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    background: white;
    margin-bottom: 1rem;
}

/* ===== STATUS ===== */
.online-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: #22c55e;
    border-radius: 50%;
}

/* ===== FOOTER ===== */
footer {
    background-color: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.discord-btn {
    background-color: #5865f2;
    color: white;
    padding: 12px 24px;
    border-radius: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.2s;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.discord-btn:hover {
    opacity: 0.9;
}

/* ===== CODE BLOCK ===== */
.code-block {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    tab-size: 4;
    color: #1e293b;
}

.code-block pre {
    margin: 0;
    padding: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: inherit;
    font-size: inherit;
}

.code-block code {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: inherit;
    font-size: inherit;
}

/* ===== FEATURE TAG ===== */
.feature-item::before {
    content: "+";
    color: #3b82f6;
    font-weight: 800;
    margin-right: 8px;
}

/* ===== SIDEBAR SCRIPT CARD ===== */
.sidebar-script-card:hover img {
    transform: scale(1.05);
}

/* ===== FORUM ===== */
.request-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.5rem;
    transition: all 0.2s;
}

.request-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.dark .request-card {
    background: #1e293b;
    border-color: #334155;
}

.dark .request-card h3 {
    color: #ffffff !important;
}

.dark .request-card p {
    color: #cbd5e1 !important;
}

.badge-category {
    background-color: #f1f5f9;
    color: #64748b;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.modal-overlay {
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

/* ===== FORM FIELDS ===== */
.form-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.input-field {
    background-color: #f1f5f9;
    border: 1px solid transparent;
    border-radius: 0.5rem;
    width: 100%;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
    color: #1e293b;
}

.dark .input-field {
    background-color: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

/* Dark mode for select dropdowns (filter controls on archive/home) */
.dark select {
    background-color: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

.dark select option {
    background-color: #1e293b;
    color: #f1f5f9;
}

/* Dark mode for contact/upload form inputs not using input-field class */
.dark input:not([type="radio"]):not([type="checkbox"]):not([type="file"]),
.dark textarea {
    background-color: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

/* Dark mode pagination */
.dark .xeno-pagination a {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

.dark .xeno-pagination a:hover {
    background: #334155;
}

.dark .xeno-pagination .current {
    background: #38bdf8;
    color: #0f172a;
}

/* Dark mode FAQ */
.dark .faq-item {
    background: #1e293b;
    border-color: #334155;
}

.dark .faq-item .text-slate-700 {
    color: #f1f5f9 !important;
}

.dark .faq-item .text-slate-500 {
    color: #94a3b8 !important;
}

.input-field:focus {
    background-color: white;
    border-color: #3b82f6;
    outline: none;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.05);
}

/* ===== CONTACT ===== */
.contact-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.08);
}

/* ===== LIGHT THEME ENFORCEMENT ===== */
html, body, .dark body {
    background-color: #f8fafc !important;
    color: #1e293b !important;
}

.navbar, .dark .navbar {
    background-color: rgba(255, 255, 255, 0.95) !important;
    border-color: #e2e8f0 !important;
}

.navbar a, .navbar span, .dark .navbar a, .dark .navbar span {
    color: #1e293b !important;
}

.card, .script-card, .dark .card, .dark .script-card {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
}

.dark h1,
.dark h2,
.dark h3,
.dark h4 {
    color: #0f172a !important;
}

.dark .text-slate-500,
.dark .text-slate-400 {
    color: #94a3b8;
}

.dark .badge-views {
    background: #1e293b;
    color: #38bdf8;
}

.dark .search-container {
    background: #1e293b;
    border-color: #334155;
}

.dark .search-input {
    background: transparent;
    color: white;
}

.dark footer {
    background: #0f172a;
    border-color: #1e293b;
}

.dark footer h3,
.dark footer h4,
.dark footer .text-slate-800,
.dark footer .text-slate-700 {
    color: #f1f5f9 !important;
}

.dark footer .text-slate-500,
.dark footer .text-slate-400 {
    color: #94a3b8 !important;
}

/* Dark mode script page */
.dark .bg-white {
    background-color: #1e293b !important;
}

.dark .border-slate-100 {
    border-color: #334155 !important;
}

.dark .text-slate-900,
.dark .text-slate-800 {
    color: #f1f5f9 !important;
}

.dark .bg-slate-50 {
    background-color: #0f172a !important;
}

.dark .bg-slate-100 {
    background-color: #334155 !important;
}

.dark .text-slate-600 {
    color: #cbd5e1 !important;
}

.dark .code-block {
    background: #0f172a;
    border-color: #334155;
    color: #ffffff;
}

/* ===== WORDPRESS OVERRIDES ===== */
.wp-block-post-content {
    max-width: none;
}

/* Pagination */
.xeno-pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.xeno-pagination a,
.xeno-pagination span {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 700;
    text-decoration: none;
}

.xeno-pagination a {
    background: white;
    border: 1px solid #e2e8f0;
    color: #1e293b;
}

.xeno-pagination a:hover {
    background: #f1f5f9;
}

.xeno-pagination .current {
    background: #1e293b;
    color: white;
}

/* Toast notification */
.xeno-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #1e293b;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 700;
    font-size: 0.875rem;
    z-index: 9999;
    animation: slideUp 0.3s ease;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ===== MOBILE MENU DARK MODE FIX ===== */
.mobile-menu-dropdown {
    background-color: rgba(255, 255, 255, 0.97);
}

.dark .mobile-menu-dropdown {
    background-color: #1e293b !important;
    border-color: #334155;
}

.dark .mobile-menu-dropdown a {
    color: #cbd5e1;
}

.dark .mobile-menu-dropdown a:hover {
    color: #38bdf8;
}

/* ===== COMPATIBLE EXECUTORS ===== */
.executor-tag {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
}

.dark .bg-slate-100 {
    background-color: #334155 !important;
}

.dark .text-slate-600 {
    color: #cbd5e1 !important;
}

/* ===== LOGO ===== */
.site-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
}

/* ===== WP ADMIN BAR FIX ===== */

/* The WP admin bar is 32px tall on desktop, 46px on mobile (<=782px).
   Our navbar is ~64px tall (py-3 = 12px*2 + ~40px content).
   We must push our navbar DOWN by the admin bar height so both are fully visible.
   Using !important to override Tailwind's top-0 utility. */

body.admin-bar nav.navbar {
    top: 32px !important;
}

/* Push page content down: existing mt-20 (80px) + admin bar (32px) = 112px
   mt-28 (112px) + admin bar (32px) = 144px — handled via padding-top */
body.admin-bar main {
    padding-top: 32px !important;
}

/* Mobile menu sits below navbar, which itself is 32px lower when admin bar shows */
body.admin-bar #mobile-menu {
    top: calc(64px + 32px) !important;
}

/* Mobile: WP admin bar is 46px tall */
@media screen and (max-width: 782px) {
    body.admin-bar nav.navbar {
        top: 46px !important;
    }
    body.admin-bar main {
        padding-top: 46px !important;
    }
    body.admin-bar #mobile-menu {
        top: calc(64px + 46px) !important;
    }
}

/* ===== RESPONSIVE — MOBILE FIRST ===== */

/* Small phones (max 480px) */
@media (max-width: 480px) {
    /* Navbar */
    .navbar {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    .site-logo {
        width: 28px;
        height: 28px;
    }

    /* Script card thumbnail shorter on tiny screens */
    .script-thumb-container {
        height: 150px;
    }

    /* Code block smaller font on tiny screens */
    .code-block {
        font-size: 0.75rem;
    }

    /* Toast full-width on tiny screens */
    .xeno-toast {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
        text-align: center;
    }

    /* Pagination wraps cleanly */
    .xeno-pagination {
        flex-wrap: wrap;
    }

    /* Badge views shrink */
    .badge-views {
        font-size: 11px;
        padding: 4px 10px;
    }

    /* Hero search single line pill with button inside (Image 2 style) */
    .search-container {
        border-radius: 9999px !important;
        flex-direction: row !important;
        padding: 4px 6px 4px 14px !important;
        gap: 6px !important;
        align-items: center !important;
        background: #ffffff !important;
        border: 1px solid #e2e8f0 !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    .search-input {
        width: auto !important;
        flex: 1 1 0% !important;
        min-width: 0 !important;
        padding: 8px 4px !important;
        font-size: 13px !important;
        border: none !important;
        outline: none !important;
        background: transparent !important;
    }
    .search-button {
        width: auto !important;
        border-radius: 9999px !important;
        padding: 8px 16px !important;
        font-size: 13px !important;
        font-weight: 700 !important;
        flex-shrink: 0 !important;
        white-space: nowrap !important;
    }
}

/* Tablets and up (max 768px) */
@media (max-width: 768px) {
    /* Single script page inner sections */
    .single-script-card-padding {
        padding: 1rem;
    }

    /* Description / features / code section inner padding */
    .bg-white.rounded-2xl.p-8 {
        padding: 1.25rem;
    }

    /* Footer stats row wraps */
    .footer-stats-row {
        flex-wrap: wrap;
        gap: 1rem;
    }

    /* Forum request card stacks */
    .request-card {
        padding: 1rem;
    }

    /* Script grid one column on small tablets */
    #trending-container,
    #recent-container {
        grid-template-columns: 1fr;
    }
}

/* Medium screens — tablet landscape (max 1024px) */
@media (max-width: 1024px) {
    /* Sidebar on single script stacks below content */
    aside.space-y-6 {
        width: 100%;
    }

    /* Similar scripts sidebar shows as horizontal scroll on tablet */
    .sidebar-script-card {
        min-width: 0;
    }
}

/* Laptop / Desktop (min 1024px) — ensure full layout */
@media (min-width: 1024px) {
    .search-container {
        max-width: 600px;
    }

    #trending-container,
    #recent-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Large desktop (min 1280px) */
@media (min-width: 1280px) {
    .max-w-7xl {
        max-width: 80rem;
    }
}

/* ===== SCRIPT CARD RESPONSIVE ===== */
@media (max-width: 640px) {
    .script-card {
        border-radius: 0.75rem;
    }
    .script-thumb-container {
        height: 160px;
    }
}

/* ===== SINGLE SCRIPT PAGE RESPONSIVE ===== */
@media (max-width: 768px) {
    /* All rounded cards reduce padding */
    .single-script-section {
        padding: 1rem !important;
    }

    /* Vote buttons full width stack */
    #btn-like, #btn-dislike {
        font-size: 0.7rem;
    }

    /* Code block horizontal scroll instead of wrap on mobile */
    .code-block {
        white-space: pre;
        overflow-x: auto;
        word-wrap: normal;
    }
    .code-block pre,
    .code-block code {
        white-space: pre;
        word-wrap: normal;
    }
}

/* ===== ARCHIVE PAGE RESPONSIVE ===== */
@media (max-width: 640px) {
    /* Filter controls stack vertically */
    .archive-filter-row {
        flex-direction: column;
        align-items: stretch;
    }
    .archive-filter-row select {
        width: 100%;
    }

    /* Pagination smaller text */
    .xeno-pagination a,
    .xeno-pagination span {
        padding: 0.4rem 0.75rem;
        font-size: 0.75rem;
    }
}

/* ===== UPLOAD PAGE RESPONSIVE ===== */
@media (max-width: 640px) {
    /* Two-column grid in upload form collapses */
    .upload-two-col {
        grid-template-columns: 1fr !important;
    }
}

/* ===== FOOTER RESPONSIVE ===== */
@media (max-width: 640px) {
    footer .flex.gap-10 {
        gap: 1.5rem;
    }
    .discord-btn {
        width: 100%;
        justify-content: center;
    }
    footer .flex.flex-wrap.justify-center.gap-6 {
        gap: 0.75rem;
        font-size: 9px;
    }
}

/* ===== DARK MODE RESPONSIVE FIXES ===== */
@media (max-width: 768px) {
    .dark .bg-white.rounded-2xl {
        background-color: #1e293b !important;
    }
}

/* ===== PREVENT HORIZONTAL OVERFLOW GLOBALLY ===== */
*, *::before, *::after {
    box-sizing: border-box;
}

img {
    max-width: 100%;
    height: auto;
}
.delta-live-search-results {
    z-index: 99999 !important;
}
/* ===================================================
   Live Search Dropdown Layering Fix
   =================================================== */
.search-container {
    position: relative !important;
    z-index: 9999 !important;
}

.delta-live-search-results {
    z-index: 99999 !important;
}

/* Ensure Hero section sits above following sections */
section:first-of-type,
.hero-section {
    position: relative !important;
    z-index: 30 !important;
    overflow: visible !important;
}