/* ═══════════════════════════════════════════════════════
   Blox Fruits Calculator — Premium Dark UI
   Pure CSS, no frameworks, mobile-first
   ═══════════════════════════════════════════════════════ */

/* ── RESET & BASE ── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Auto-adapting, built-in WP design palette via Transparency */
    --bg-body: transparent;
    --bg-card: rgba(0, 0, 0, 0.03);
    --bg-input: rgba(0, 0, 0, 0.06);
    --bg-hover: rgba(0, 0, 0, 0.09);
    --border: rgba(0, 0, 0, 0.1);
    --text: inherit;
    --text-dim: rgba(0, 0, 0, 0.6);
    --accent: #2563eb;
    --accent-glow: rgba(37, 99, 235, 0.15);
    --green: #10b981;
    --green-glow: rgba(16, 185, 129, 0.15);
    --red: #ef4444;
    --red-glow: rgba(239, 68, 68, 0.15);
    --yellow: #f59e0b;
    --yellow-glow: rgba(245, 158, 11, 0.15);

    /* Clean Borders & Shadows */
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    
    /* Spacing */
    --radius: 12px;
    --radius-sm: 8px;
    --gap: 16px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-card: rgba(255, 255, 255, 0.05);
        --bg-input: rgba(255, 255, 255, 0.08);
        --bg-hover: rgba(255, 255, 255, 0.12);
        --border: rgba(255, 255, 255, 0.15);
        --text-dim: rgba(255, 255, 255, 0.6);
        --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    }
}

html {
    scroll-behavior: smooth;
}

body {
    /* Inherit everything from WP Theme so it looks built-in */
    font-family: inherit;
    background: transparent;
    color: var(--text);
    line-height: inherit;
}

.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ── HEADER ── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(11, 14, 23, .85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: .5px;
    color: var(--accent);
}

.site-header nav a {
    color: var(--text-dim);
    text-decoration: none;
    margin-left: 24px;
    font-size: .9rem;
    transition: color .2s;
}

.site-header nav a:hover {
    color: var(--text);
}

/* ── HERO ── */
.hero {
    text-align: center;
    padding: 56px 0 40px;
    background: linear-gradient(180deg, rgba(108, 92, 231, .08) 0%, transparent 100%);
}

.hero h1 {
    font-size: clamp(1.75rem, 5vw, 2.75rem);
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-sub {
    font-size: 1.05rem;
    color: var(--text-dim);
    max-width: 520px;
    margin: 0 auto;
}

/* ── CALCULATOR GRID ── */
.calculator-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 24px;
    align-items: start;
    margin-bottom: 32px;
}

@media (max-width: 768px) {
    .calculator-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* ── TRADE SIDE CARDS ── */
.trade-side {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: box-shadow .3s;
}

.trade-side:hover {
    box-shadow: var(--card-shadow);
}

.trade-side h2 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.trade-give h2::before {
    content: '🔴';
}

.trade-receive h2::before {
    content: '🟢';
}

/* ── FRUIT SLOT (INVENTORY STYLE) ── */
.fruit-slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.fruit-slot {
    position: relative;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    animation: slotIn .3s ease;
    cursor: pointer;
    transition: transform .2s, border-color .2s;
}

.fruit-slot:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
}

.fruit-slot:empty {
    display: none;
}

@keyframes slotIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slot-image-container {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
}

.slot-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

.slot-name {
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.slot-value {
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* ── QUANTITY INPUT & REMOVE ── */
.slot-controls {
    display: flex;
    width: 100%;
    gap: 6px;
    margin-top: 4px;
}

.qty-input {
    width: 100%;
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 4px;
    color: var(--text);
    font-size: .85rem;
    text-align: center;
    transition: border-color .2s;
}

.qty-input:focus {
    border-color: var(--accent);
    outline: none;
}

.btn-remove {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.2);
    color: var(--red);
    width: 30px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s, color .2s;
}

.btn-remove:hover {
    background: var(--red);
    color: white;
}

/* ── MODAL OVERLAY ── */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s, visibility .3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: scale(0.95);
    transition: transform .3s;
    overflow: hidden;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.25rem;
    margin: 0;
}

.btn-close-modal {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color .2s;
}

.btn-close-modal:hover {
    color: var(--text);
}

.modal-controls {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    border-bottom: 1px solid var(--border);
    background: rgba(27, 32, 48, 0.3);
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box svg {
    position: absolute;
    left: 12px;
    color: var(--text-dim);
}

.search-box input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 12px 12px 40px;
    color: var(--text);
    font-size: 1rem;
    outline: none;
    transition: border-color .2s;
}

.search-box input:focus {
    border-color: var(--accent);
}

.filter-pills {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.pill {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-dim);
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 0.9rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all .2s;
}

.pill:hover {
    border-color: var(--accent);
    color: var(--text);
}

.pill.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

/* ── ITEM GRID ── */
.item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}

.grid-item {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform .2s, border-color .2s, box-shadow .2s;
    text-align: center;
}

.grid-item:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: var(--card-shadow);
}

.grid-image {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 12px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
    transition: transform 0.3s;
}

.grid-item:hover .grid-image {
    transform: scale(1.1) rotate(5deg);
}

.grid-name {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.grid-value {
    color: var(--text-dim);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.grid-type {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    margin-top: 8px;
    background: rgba(255, 255, 255, 0.05);
}

.type-fruit {
    color: #fe637b;
}

.type-gamepass {
    color: #feca57;
}

.type-limited {
    color: #48dbfb;
}

/* ── SIDE TOTAL ── */
.side-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
    font-size: .95rem;
}

.side-total strong {
    color: var(--accent);
    font-size: 1.25rem;
}

/* ── ADD BUTTON ── */
.btn-add {
    width: 100%;
    padding: 12px;
    background: rgba(108, 92, 231, .12);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px dashed var(--accent);
    transition: all .2s;
}

.btn-add:hover {
    background: rgba(108, 92, 231, .22);
    transform: translateY(-2px);
}


/* ── CENTER CONTROLS ── */
.center-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding-top: 60px;
}

@media (max-width: 768px) {
    .center-controls {
        flex-direction: row;
        justify-content: center;
        padding-top: 0;
    }
}

.btn-swap,
.btn-reset {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-swap:hover {
    background: var(--accent);
    color: #fff;
    box-shadow: var(--card-shadow);
}

.btn-reset:hover {
    background: var(--red);
    color: #fff;
    box-shadow: var(--card-shadow);
}

/* ── VERDICT CARD ── */
.verdict-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    text-align: center;
    transition: border-color .4s, box-shadow .4s;
}

.verdict-card h3 {
    font-size: 1.3rem;
    margin-bottom: 8px;
}

.verdict-card p {
    color: var(--text-dim);
    font-size: .95rem;
}

/* Verdict states */
.verdict-fair {
    border-color: var(--yellow);
    background: rgba(245, 158, 11, 0.05);
    box-shadow: var(--card-shadow);
}

.verdict-fair h3 {
    color: var(--yellow);
}

.verdict-over {
    border-color: var(--red);
    background: rgba(239, 68, 68, 0.05);
    box-shadow: var(--card-shadow);
}

.verdict-over h3 {
    color: var(--red);
}

.verdict-under {
    border-color: var(--green);
    background: rgba(16, 185, 129, 0.05);
    box-shadow: var(--card-shadow);
}

.verdict-under h3 {
    color: var(--green);
}

/* ── INFO SECTION ── */
.info-section {
    padding: 64px 0;
}

.info-section h2 {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 32px;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}

.step-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    transition: transform .25s, box-shadow .25s;
}

.step-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-shadow);
}

.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 14px;
}

.step-card h3 {
    font-size: 1.05rem;
    margin-bottom: 8px;
}

.step-card p {
    color: var(--text-dim);
    font-size: .88rem;
}

/* ── FOOTER ── */
.site-footer {
    padding: 28px 0;
    text-align: center;
    color: var(--text-dim);
    font-size: .8rem;
    border-top: 1px solid var(--border);
}

/* ── VALIDATION TOAST ── */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: var(--red);
    color: #fff;
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    font-size: .88rem;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(255, 107, 107, .4);
    opacity: 0;
    transition: transform .35s ease, opacity .35s ease;
    z-index: 200;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── HIDE WORDPRESS PAGE TITLE ── */
/* This removes the redundant "Blox Fruits Calculator" block above the tool */
.page-header,
.entry-header,
.page-title,
.entry-title,
.nv-page-title-wrap,
#page-header {
    display: none !important;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar {
    width: 10px; /* Wider for visibility */
}

::-webkit-scrollbar-track {
    background: var(--bg-input);
}

::-webkit-scrollbar-thumb {
    background: #888888; /* Solid, highly visible cursor */
    border-radius: 5px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
    background: #555555;
}

@media (prefers-color-scheme: dark) {
    ::-webkit-scrollbar-thumb {
        background: #aaaaaa;
    }
    ::-webkit-scrollbar-thumb:hover {
        background: #cccccc;
    }
}

/* ── MARKET TRENDS SECTION (NEXTJS STYLE) ── */
.trends-section {
    padding: 64px 0 32px;
}

.trends-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}

.trends-header h2 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text);
}

.trends-filters {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.trends-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
}

/* Modern NextJS Style Card */
.trend-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    z-index: 1;
}

.trend-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent);
    box-shadow: var(--card-shadow);
}

.trend-card-image {
    width: 90px;
    height: 90px;
    object-fit: contain;
    margin-bottom: 16px;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.5));
    transition: transform 0.5s ease;
}

.trend-card:hover .trend-card-image {
    transform: scale(1.15) rotate(5deg);
}

.trend-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.trend-card-price {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.trend-card-price span {
    font-size: 0.85rem;
    color: var(--text-dim);
    font-weight: 500;
}

.trend-card-meta {
    display: flex;
    justify-content: space-between;
    width: 100%;
    align-items: center;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.trend-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.trend-up {
    background: rgba(0, 214, 143, 0.1);
    color: var(--green);
    border: 1px solid rgba(0, 214, 143, 0.2);
}

.trend-down {
    background: rgba(255, 107, 107, 0.1);
    color: var(--red);
    border: 1px solid rgba(255, 107, 107, 0.2);
}

.trend-stable {
    background: rgba(255, 217, 61, 0.1);
    color: var(--yellow);
    border: 1px solid rgba(255, 217, 61, 0.2);
}

.trend-type {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}