/* =========================================================
   My API Listings Pro v3 — Frontend Styles
   ========================================================= */

/* ── Grid ──────────────────────────────────────────────── */
.mal-grid {
    display: grid;
    grid-template-columns: repeat(var(--mal-cols, 3), 1fr);
    gap: 24px;
    padding: 16px 0;
}

@media (max-width: 900px) { .mal-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .mal-grid { grid-template-columns: 1fr; } }

/* ── Card ──────────────────────────────────────────────── */
.mal-card {
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0,0,0,0.09);
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
    transition: transform .2s ease, box-shadow .2s ease;
}

.mal-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(0,0,0,0.13);
}

/* ── Image + Read More overlay ─────────────────────────── */
.mal-card__image-wrap {
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.mal-card__image {
    display: block;
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform .3s ease;
}

.mal-card:hover .mal-card__image {
    transform: scale(1.03);
}

/* "Read More" button — position/style driven by CSS vars set via inline style on the card wrap */
.mal-card__read-more {
    position: absolute;
    /* Position defaults — overridden by PHP inline style per saved setting */
    bottom: 10px;
    right:  10px;
    top:    auto;
    left:   auto;
    transform: none;
    /* Color/style defaults — overridden by PHP inline style per saved setting */
    background: rgba(20, 20, 20, 0.82);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 6px 13px;
    border-radius: 6px;
    text-decoration: none;
    backdrop-filter: blur(2px);
    transition: background .18s, color .18s, filter .18s;
    white-space: nowrap;
}

.mal-card__read-more:hover {
    text-decoration: none;
    /* hover bg/color overridden by wp_add_inline_style from saved options */
}

/* ── Card body ─────────────────────────────────────────── */
.mal-card__body {
    padding: 16px 16px 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 8px;
}

.mal-card__name {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.35;
}

/* ── Meta list (Top Prize, Play Amount) ────────────────── */
.mal-card__meta {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 8px;
    row-gap: 3px;
}

.mal-card__meta li {
    font-size: 0.88rem;
    display: contents; /* lets each li's children participate in the parent grid */
}

.mal-meta__label {
    color: #6b7280;
    white-space: nowrap;
}

.mal-meta__value {
    font-weight: 600;
}

/* ── Play Now button ───────────────────────────────────── */
.mal-card__btn {
    display: block;
    text-align: center;
    padding: 11px 16px;
    border-radius: 8px; /* overridden by PHP inline style per saved setting */
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-decoration: none;
    margin-top: auto;
    transition: filter .15s ease, transform .1s ease;
}

.mal-card__btn:hover {
    filter: brightness(1.08);
    text-decoration: none;
    transform: translateY(-1px);
}

/* ── No results ────────────────────────────────────────── */
.mal-no-results {
    text-align: center;
    color: #9ca3af;
    padding: 48px 0;
}

/* ═══════════════════════════════════════════════════════
   FILTER BAR
══════════════════════════════════════════════════════ */
.mal-listing-wrap {
    /* Outer wrapper for filter + grid */
}

.mal-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 0 20px;
    /* justify-content set via inline style from admin option */
}

.mal-filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 18px;
    border-style: solid;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.02em;
    transition: background .15s ease, color .15s ease, border-color .15s ease, transform .1s ease;
    line-height: 1;
    white-space: nowrap;
}

.mal-filter-btn:hover:not(.mal-filter-active) {
    filter: brightness(0.93);
}

.mal-filter-btn.mal-filter-active {
    cursor: default;
}

.mal-grid-wrap {
    /* Swappable grid container */
    transition: opacity .2s ease;
}

/* ═══════════════════════════════════════════════════════
   LOAD MORE
══════════════════════════════════════════════════════ */
.mal-load-more-wrap {
    text-align: center;
    padding: 32px 0 16px;
}

.mal-load-more-btn {
    background: #111827;
    color: #fff;
    border: none;
    padding: 13px 40px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.02em;
    transition: background .2s;
}

.mal-load-more-btn:hover    { background: #374151; }
.mal-load-more-btn:disabled { opacity: .5; cursor: default; }

.mal-loading {
    display: block;
    color: #9ca3af;
    font-size: 0.875rem;
    margin-top: 12px;
    animation: mal-pulse 1.2s ease-in-out infinite;
}

@keyframes mal-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.35; }
}

/* ═══════════════════════════════════════════════════════
   NUMBERED PAGINATION
══════════════════════════════════════════════════════ */
.mal-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 32px 0 16px;
    transition: opacity .2s;
}

.mal-pagination.mal-pag--loading {
    opacity: .5;
    pointer-events: none;
}

.mal-pag-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    color: #374151;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s ease;
    line-height: 1;
}

.mal-pag-btn:hover:not(:disabled):not(.mal-pag-active) {
    border-color: #2563eb;
    color: #2563eb;
    background: #eff6ff;
}

.mal-pag-btn.mal-pag-active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
    cursor: default;
}

.mal-pag-btn:disabled {
    opacity: .38;
    cursor: default;
}

.mal-pag-prev,
.mal-pag-next {
    font-size: 0.82rem;
    padding: 0 16px;
    min-width: auto;
}

.mal-pag-ellipsis {
    display: inline-flex;
    align-items: center;
    height: 40px;
    color: #9ca3af;
    font-weight: 600;
    padding: 0 4px;
    user-select: none;
}

/* ── Gutenberg block editor preview ───────────────────── */
.mal-block-editor-wrap {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    overflow: hidden;
    background: #f8fafc;
}

.mal-block-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: #1e293b;
    color: #fff;
}

.mal-block-label   { font-size: .8rem; font-weight: 700; letter-spacing: .05em; }

.mal-block-cols-badge {
    font-size: .75rem;
    background: rgba(255,255,255,.15);
    padding: 3px 10px;
    border-radius: 100px;
}

.mal-block-preview        { padding: 24px; }
.mal-block-preview-grid   { display: grid; gap: 16px; }

.mal-block-img-placeholder {
    height: 160px;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #94a3b8;
    position: relative;
}

.mal-block-read-more-preview {
    position: absolute;
    bottom: 8px; right: 8px;
    background: rgba(20,20,20,.8);
    color: #fff;
    font-size: .72rem;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 5px;
}

.mal-block-preview-note {
    text-align: center;
    color: #94a3b8;
    font-size: .8rem;
    margin: 12px 0 0;
}

/* ── Elementor editor placeholder ─────────────────────── */
.mal-elementor-editor-notice {
    background: #1e293b;
    color: #7dd3fc;
    font-size: .8rem;
    padding: 8px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.mal-card__image--placeholder {
    height: 180px;
    background: linear-gradient(135deg,#e2e8f0,#cbd5e1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: #94a3b8;
    position: relative;
}
