/*
Theme Name: Delta Scripts Theme
Theme URI: https://delta-scripts.org
Author: Delta Scripts Team
Author URI: https://delta-scripts.org
Description: A premium Roblox script-sharing platform theme with Firebase Auth integration, real-time comments and forum, and a modern gamer-inspired design. Powered by Delta executor community.
Version: 1.2.2
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: delta-scripts
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 ===== */
html {
    color-scheme: light;
}

html.dark {
    color-scheme: dark;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

/* ===== NAVBAR ===== */
.navbar {
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid #e2e8f0;
}

/* ===== 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-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.2s ease;
    display: block;
    text-decoration: none;
    color: inherit;
}

.script-card:hover {
    border-color: #9333ea;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

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

/* ===== DARK MODE ===== */
.dark body {
    background-color: #0f172a;
    color: #f1f5f9;
}

.dark .navbar {
    background-color: rgba(15, 23, 42, 0.8);
    border-color: #1e293b;
}

.dark .navbar a,
.dark .navbar span {
    color: #f1f5f9;
}

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

.dark h1,
.dark h2,
.dark h3,
.dark h4 {
    color: white;
}

.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 full width */
    .search-container {
        border-radius: 0.75rem;
        flex-direction: column;
        padding: 8px;
        gap: 8px;
    }
    .search-input {
        width: 100%;
        padding: 10px 14px;
        font-size: 14px;
        border-radius: 0.5rem;
    }
    .search-button {
        width: 100%;
        border-radius: 0.5rem;
        padding: 10px;
        font-size: 14px;
    }
}

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