/* ════════════════════════════════════════════════════════════════
   Gold Prices Shortcodes – Frontend Styles
   gps-styles.css  |  v1.1.0
════════════════════════════════════════════════════════════════ */

/* ── Shared design tokens ────────────────────────────────────── */
.gps-card,
.gps-table-wrap {
    --gps-bg:       linear-gradient(135deg, #0f172a 0%, #1e293b 55%, #334155 100%);
    --gps-text:     #f8fafc;
    --gps-muted:    #cbd5e1;
    --gps-accent:   #fbbf24;
    --gps-accent-2: #fde68a;
    --gps-border:   rgba(255, 255, 255, 0.10);
    --gps-radius:   18px;
    border-radius:  var(--gps-radius);
    border:         1px solid var(--gps-border);
    background:     var(--gps-bg);
    color:          var(--gps-text);
    box-shadow:     0 14px 34px rgba(15, 23, 42, 0.28), 0 2px 6px rgba(0,0,0,.18);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* ── Price Card ──────────────────────────────────────────────── */
.gps-card {
    padding: 20px 22px;
    display: grid;
    gap: 8px;
    max-width: 360px;
    position: relative;
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease;
}

/* subtle gold shimmer line at top */
.gps-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #fbbf24 40%, #fde68a 60%, transparent);
    border-radius: var(--gps-radius) var(--gps-radius) 0 0;
}

.gps-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 44px rgba(15, 23, 42, 0.36), 0 4px 10px rgba(251,191,36,.12);
}

.gps-card__top {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gps-card__icon {
    font-size: 20px;
    filter: drop-shadow(0 2px 8px rgba(251, 191, 36, 0.35));
}

.gps-card__label {
    font-weight: 600;
    color: var(--gps-muted);
    letter-spacing: 0.2px;
    font-size: 13px;
}

.gps-card__value {
    font-size: clamp(24px, 3vw, 30px);
    font-weight: 800;
    line-height: 1.2;
    color: var(--gps-accent);
    /* FIX: was missing letter-spacing for better number readability */
    letter-spacing: -0.5px;
    font-variant-numeric: tabular-nums;
}

.gps-card__raw {
    font-size: 13px;
    color: var(--gps-muted);
    opacity: .8;
}

/* ── Price Table ─────────────────────────────────────────────── */
.gps-table-wrap {
    padding: 20px;
    overflow: hidden;
}

.gps-table-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 14px;
    /* FIX: was missing a bottom separator */
    border-bottom: 1px solid var(--gps-border);
}

.gps-table-title {
    margin: 0;
    font-size: clamp(17px, 2.2vw, 21px);
    font-weight: 700;
    color: var(--gps-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* gold dot accent before title */
.gps-table-title::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--gps-accent);
    flex-shrink: 0;
}

.gps-table-time {
    font-size: 11px;
    color: var(--gps-muted);
    white-space: nowrap;
    opacity: .75;
    background: rgba(255,255,255,.06);
    padding: 3px 9px;
    border-radius: 20px;
}

.gps-table-scroll {
    width: 100%;
    overflow-x: auto;
    /* FIX: smooth scrollbar on webkit */
    scrollbar-width: thin;
    scrollbar-color: rgba(251,191,36,.3) transparent;
}

.gps-table-scroll::-webkit-scrollbar { height: 4px; }
.gps-table-scroll::-webkit-scrollbar-track { background: transparent; }
.gps-table-scroll::-webkit-scrollbar-thumb { background: rgba(251,191,36,.3); border-radius: 4px; }

.gps-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 500px;
}

.gps-table th,
.gps-table td {
    text-align: start;
    padding: 13px 12px;
    border-bottom: 1px solid rgba(203, 213, 225, 0.10);
    vertical-align: middle;
}

.gps-table th {
    color: var(--gps-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    font-weight: 600;
}

/* FIX: was missing row hover state */
.gps-table tbody tr {
    transition: background .15s;
}

.gps-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

.gps-table tr:last-child td {
    border-bottom: none;
}

.gps-item-label {
    font-weight: 600;
    font-size: 14px;
}

.gps-item-value {
    display: inline-block;
    font-weight: 700;
    font-size: 15px;
    color: var(--gps-accent-2);
    margin-inline-end: 8px;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.3px;
}

.gps-item-raw {
    font-size: 12px;
    color: var(--gps-muted);
    opacity: .7;
}

/* ── Error box ───────────────────────────────────────────────── */
.gps-error-box {
    border: 1px solid #fecaca;
    background: #fff1f2;
    color: #9f1239;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gps-error-box::before {
    content: '⚠';
    font-size: 16px;
}

/* ── Ticker ──────────────────────────────────────────────────── */
.gps-ticker-wrap {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid var(--line, #eadfbf);
    border-radius: 999px;
    background: #fffef9;
    overflow: hidden;
    margin: auto;
    max-width: 100%;
    /* FIX: was missing shadow */
    box-shadow: 0 4px 14px rgba(120, 89, 24, 0.10);
}

.gps-ticker-label {
    background: linear-gradient(135deg, var(--gold, #d4af37) 0%, var(--gold-2, #f7df9f) 100%);
    color: #2a210f;
    font-weight: 800;
    padding: 10px 20px;
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 13px;
    letter-spacing: .3px;
    /* FIX: was missing right border separator */
    border-inline-end: 1px solid rgba(180,140,40,.3);
}

.gps-ticker-overflow {
    overflow: hidden;
    flex: 1;
    min-width: 0;
}

.gps-ticker-track {
    display: flex;
    align-items: center;
    gap: 32px;
    white-space: nowrap;
    padding: 10px 20px;
    /* FIX: changed from -45% to -50% for seamless infinite loop (items are duplicated) */
    animation: gpsTickerMove 32s linear infinite;
}

/* FIX: pause on hover for readability */
.gps-ticker-wrap:hover .gps-ticker-track {
    animation-play-state: paused;
}

.gps-ticker-track span {
    color: #6f5a2f;
    font-weight: 600;
    font-size: 14px;
    /* FIX: add a dot separator between items */
    padding-inline-start: 32px;
    position: relative;
}

.gps-ticker-track span::before {
    content: '•';
    position: absolute;
    inset-inline-start: 12px;
    color: #c9a227;
    opacity: .6;
}

.gps-ticker-track span:first-child::before {
    display: none;
}

@keyframes gpsTickerMove {
    from { transform: translateX(0); }
    /* FIX: was -45%, corrected to -50% for a seamless duplicate-based loop */
    to   { transform: translateX(-50%); }
}

/* ── Dual Price Cards Grid ───────────────────────────────────── */
.gps-prices-grid {
    /* FIX: was missing display:grid — relied on a theme class .two which may not exist */
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.gps-price-card {
    background: linear-gradient(180deg, #fffdf7 0%, #fff 100%);
    border-radius: 18px;
    /* FIX: original had border-top:4px + border:1px which conflict (border overrides border-top).
       Now using border + inset top highlight via box-shadow so both work. */
    border: 1px solid var(--line, #eadfbf);
    box-shadow:
        0 12px 26px rgba(120, 89, 24, 0.08),
        inset 0 3px 0 var(--gold, #d4af37);
    padding: 20px;
    transition: transform .2s ease, box-shadow .2s ease;
}

.gps-price-card:hover {
    transform: translateY(-2px);
    box-shadow:
        0 18px 36px rgba(120, 89, 24, 0.13),
        inset 0 3px 0 var(--gold, #d4af37);
}

.gps-price-card .section-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--line, #eadfbf);
}

.gps-price-card .section-head h2 {
    margin: 0;
    font-size: clamp(18px, 2vw, 22px);
    font-weight: 700;
    color: #2a1f0a;
}

.gps-price-card .section-head small {
    color: #9d8a5e;
    font-size: 12px;
}

.gps-price-card ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.gps-price-card li {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
    border-top: 1px dashed var(--line, #eadfbf);
    padding-block: 12px;
    transition: background .12s;
    border-radius: 6px;
    padding-inline: 4px;
}

.gps-price-card li:first-child {
    border-top: none;
}

.gps-price-card li:hover {
    background: rgba(212, 175, 55, 0.07);
}

.gps-price-card span {
    font-size: 14px;
    color: #5a4a2a;
}

.gps-price-card strong {
    color: #553f11;
    font-weight: 700;
    font-size: 15px;
    font-variant-numeric: tabular-nums;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 767px) {
    .gps-ticker-wrap {
        border-radius: 14px;
        flex-direction: column;
        align-items: stretch;
    }

    .gps-ticker-label {
        text-align: center;
        border-inline-end: none;
        border-bottom: 1px solid rgba(180,140,40,.3);
        border-radius: 0;
    }

    .gps-ticker-track {
        animation-duration: 22s;
    }

    .gps-price-card {
        padding: 14px;
    }

    .gps-prices-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
}

@media (max-width: 640px) {
    .gps-table-wrap {
        padding: 14px;
        border-radius: 14px;
    }

    .gps-table {
        min-width: 420px;
    }

    .gps-card {
        max-width: 100%;
    }
}