/**
 * gpgm-style.css
 * Frontend styles for Gold Price Geo Master.
 * Three schemes: gold (default), dark, light.
 *
 * @package GoldPriceGeoMaster
 */

/* ── CSS Variables ─────────────────────────────────────────────────────────── */

.gpgm-scheme-gold {
    --gpgm-bg:         #f0faf6;
    --gpgm-border:     #1b7f5c;
    --gpgm-accent:     #1b7f5c;
    --gpgm-text:       #1a2e25;
    --gpgm-muted:      #4a7a64;
    --gpgm-badge-bg:   #1b7f5c;
    --gpgm-badge-text: #ffffff;
    --gpgm-row-hover:  #d8f0e6;
    --gpgm-head-bg:    #1b7f5c;
    --gpgm-head-text:  #ffffff;
    --gpgm-refresh-bg: #1b7f5c;
    --gpgm-refresh-fg: #fff;
}

.gpgm-scheme-dark {
    --gpgm-bg:         #1a1a2e;
    --gpgm-border:     #e0b800;
    --gpgm-accent:     #ffd700;
    --gpgm-text:       #e8e8e8;
    --gpgm-muted:      #9a9a9a;
    --gpgm-badge-bg:   #e0b800;
    --gpgm-badge-text: #1a1a2e;
    --gpgm-row-hover:  #16213e;
    --gpgm-head-bg:    #0f3460;
    --gpgm-head-text:  #ffd700;
    --gpgm-refresh-bg: #e0b800;
    --gpgm-refresh-fg: #1a1a2e;
}

.gpgm-scheme-light {
    --gpgm-bg:         #ffffff;
    --gpgm-border:     #d0d0d0;
    --gpgm-accent:     #555;
    --gpgm-text:       #111;
    --gpgm-muted:      #666;
    --gpgm-badge-bg:   #eee;
    --gpgm-badge-text: #333;
    --gpgm-row-hover:  #f5f5f5;
    --gpgm-head-bg:    #f0f0f0;
    --gpgm-head-text:  #333;
    --gpgm-refresh-bg: #555;
    --gpgm-refresh-fg: #fff;
}

/* ── Base Reset ────────────────────────────────────────────────────────────── */

.gpgm-price-block,
.gpgm-table-wrapper,
.gpgm-converter,
.gpgm-ticker,
.gpgm-price-inline {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    box-sizing: border-box;
}

/* ── Price Block ───────────────────────────────────────────────────────────── */

.gpgm-price-block {
    display:       inline-block;
    background:    var(--gpgm-bg);
    border:        2px solid var(--gpgm-border);
    border-radius: 12px;
    padding:       18px 24px;
    margin:        8px 0;
    color:         var(--gpgm-text);
    min-width:     220px;
    position:      relative;
    transition:    box-shadow 0.2s ease;
}

.gpgm-price-block:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

.gpgm-price-main {
    display:        flex;
    flex-direction: column;
    gap:            2px;
    margin-bottom:  10px;
}

.gpgm-price-value {
    font-size:   2rem;
    font-weight: 700;
    color:       var(--gpgm-accent);
    line-height: 1.1;
}

.gpgm-price-unit {
    font-size: 0.85rem;
    color:     var(--gpgm-muted);
}

.gpgm-price-tola {
    font-size:    1.2rem;
    font-weight:  600;
    color:        var(--gpgm-text);
    margin-bottom: 8px;
    padding:       6px 10px;
    background:    var(--gpgm-badge-bg);
    border-radius: 6px;
    display:       inline-block;
}

.gpgm-price-meta {
    display:   flex;
    gap:       10px;
    font-size: 0.8rem;
    color:     var(--gpgm-muted);
    flex-wrap: wrap;
}

.gpgm-markup-info {
    background:    var(--gpgm-badge-bg);
    color:         var(--gpgm-badge-text);
    padding:       2px 6px;
    border-radius: 4px;
    font-weight:   600;
    font-size:     0.75rem;
}

/* ── Inline Price Span ─────────────────────────────────────────────────────── */

.gpgm-price-inline {
    display:    inline-flex;
    align-items: center;
    gap:         6px;
    background: var(--gpgm-bg);
    border:     1px solid var(--gpgm-border);
    padding:    4px 10px;
    border-radius: 6px;
    font-weight:   700;
    color:         var(--gpgm-accent);
}

.gpgm-price-inline small {
    font-weight: 400;
    color:       var(--gpgm-muted);
    font-size:   0.8em;
}

/* ── Multi-metal Table ─────────────────────────────────────────────────────── */

.gpgm-table-wrapper {
    background:    var(--gpgm-bg);
    border:        2px solid var(--gpgm-border);
    border-radius: 12px;
    padding:       20px;
    overflow-x:    auto;
    margin:        12px 0;
    color:         var(--gpgm-text);
}

.gpgm-location-label {
    font-size:     0.9rem;
    color:         var(--gpgm-muted);
    margin-bottom: 12px;
}

.gpgm-metals-table {
    width:           100%;
    border-collapse: separate;
    border-spacing:  0;
    font-size:       0.95rem;
}

.gpgm-metals-table thead tr {
    background: var(--gpgm-head-bg);
    color:      var(--gpgm-head-text);
}

.gpgm-metals-table th,
.gpgm-metals-table td {
    padding:    12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--gpgm-border);
    white-space: nowrap;
}

.gpgm-metals-table th:first-child { border-radius: 8px 0 0 0; }
.gpgm-metals-table th:last-child  { border-radius: 0 8px 0 0; }
.gpgm-metals-table th             { font-weight: 700; }

.gpgm-metals-table tbody tr:hover {
    background: var(--gpgm-row-hover);
}

.gpgm-metals-table .gpgm-metal-name {
    font-weight: 600;
    display:     flex;
    align-items: center;
    gap:         8px;
}

/* Metal icon dots */
.gpgm-icon-xau { width:12px;height:12px;border-radius:50%;display:inline-block;background:#ffd700; }
.gpgm-icon-xag { width:12px;height:12px;border-radius:50%;display:inline-block;background:#c0c0c0; }
.gpgm-icon-xpt { width:12px;height:12px;border-radius:50%;display:inline-block;background:#e5e4e2; }
.gpgm-icon-xpd { width:12px;height:12px;border-radius:50%;display:inline-block;background:#b0a090; }

/* ── Converter ─────────────────────────────────────────────────────────────── */

.gpgm-converter {
    background:    var(--gpgm-bg);
    border:        2px solid var(--gpgm-border);
    border-radius: 10px;
    padding:       16px 20px;
    display:       inline-block;
    margin:        8px 0;
    color:         var(--gpgm-text);
}

.gpgm-converter-result {
    font-size:   1.1rem;
    margin:      0 0 6px;
}

.gpgm-converted-value {
    color:     var(--gpgm-accent);
    font-size: 1.3em;
}

.gpgm-tola-note {
    font-size: 0.8rem;
    color:     var(--gpgm-muted);
    margin:    0;
}

/* ── Ticker Widget ─────────────────────────────────────────────────────────── */

.gpgm-ticker {
    background:    var(--gpgm-bg);
    border:        2px solid var(--gpgm-border);
    border-radius: 10px;
    padding:       14px;
    color:         var(--gpgm-text);
}

.gpgm-ticker-row {
    display:         flex;
    justify-content: space-between;
    align-items:     center;
    padding:         6px 0;
    border-bottom:   1px solid var(--gpgm-border);
}

.gpgm-ticker-row:last-of-type { border-bottom: none; }

.gpgm-ticker-label { font-weight: 600; }
.gpgm-ticker-price { color: var(--gpgm-accent); font-weight: 700; }
.gpgm-ticker-city  { font-size:0.78rem; color:var(--gpgm-muted); margin:6px 0 0; }

/* ── Notices ───────────────────────────────────────────────────────────────── */

.gpgm-delayed-notice {
    font-size:     0.78rem;
    color:         #e65100;
    margin:        6px 0 0;
    padding:       4px 8px;
    background:    #fff3e0;
    border-radius: 4px;
    border-left:   3px solid #e65100;
    display:       none;
}

.gpgm-pk-notice {
    font-size:     0.82rem;
    color:         #1565c0;
    background:    #e3f2fd;
    padding:       6px 10px;
    border-radius: 6px;
    border-left:   3px solid #1565c0;
    margin-bottom: 10px;
}

.gpgm-sarafa-badge {
    font-size:   0.75rem;
    background:  var(--gpgm-badge-bg);
    color:       var(--gpgm-badge-text);
    padding:     1px 5px;
    border-radius: 4px;
}

.gpgm-updated-at {
    font-size: 0.75rem;
    color:     var(--gpgm-muted);
    margin:    8px 0 0;
    text-align: right;
}

/* ── Refresh Button ────────────────────────────────────────────────────────── */

.gpgm-refresh-btn {
    position:    absolute;
    top:         10px;
    right:       10px;
    background:  var(--gpgm-refresh-bg);
    color:       var(--gpgm-refresh-fg);
    border:      none;
    border-radius: 6px;
    padding:     4px 10px;
    font-size:   0.8rem;
    cursor:      pointer;
    opacity:     0.7;
    transition:  opacity 0.2s;
}

.gpgm-refresh-btn:hover  { opacity: 1; }
.gpgm-refresh-btn:disabled { cursor: not-allowed; opacity: 0.4; }

.gpgm-table-wrapper .gpgm-refresh-btn {
    position: static;
    margin-top: 10px;
}

/* ── Flash Animation on Refresh ────────────────────────────────────────────── */

@keyframes gpgm-flash {
    0%   { background-color: var(--gpgm-badge-bg); }
    100% { background-color: transparent; }
}

.gpgm-refreshed {
    animation: gpgm-flash 0.8s ease-out;
}

/* ── Responsive ────────────────────────────────────────────────────────────── */

@media ( max-width: 600px ) {
    .gpgm-metals-table th,
    .gpgm-metals-table td {
        padding: 8px 10px;
        font-size: 0.85rem;
    }

    .gpgm-price-value {
        font-size: 1.5rem;
    }

    .gpgm-price-block {
        min-width: unset;
        width: 100%;
    }

    .gpgm-metals-table {
        font-size: 0.8rem;
    }
}

/* ── Price History Chart ───────────────────────────────────────────────────── */

.gpgm-chart-wrapper {
    background:    var(--gpgm-bg);
    border:        2px solid var(--gpgm-border);
    border-radius: 12px;
    padding:       20px 24px;
    margin:        12px 0;
    color:         var(--gpgm-text);
}

.gpgm-chart-title {
    font-size:     1.05rem;
    font-weight:   700;
    color:         var(--gpgm-accent);
    margin:        0 0 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--gpgm-border);
}

.gpgm-history-table-wrap .gpgm-chart-title {
    margin-bottom: 12px;
}

.gpgm-error {
    color: #c0392b;
    font-size: 0.9rem;
    padding: 8px 12px;
    background: #fdecea;
    border-radius: 6px;
    border-left: 3px solid #c0392b;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ADVANCED FEATURES v1.1  ·  #1b7f5c brand throughout
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Shared Advanced Widget Base ─────────────────────────────────────────── */
.gpgm-adv-widget {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background:  #f0faf6;
    border:      2px solid #1b7f5c;
    border-radius: 14px;
    overflow:    hidden;
    margin:      12px 0;
    box-shadow:  0 2px 12px rgba(27,127,92,0.13);
}

/* ── Widget Header ───────────────────────────────────────────────────────── */
.gpgm-adv-header {
    display:         flex;
    align-items:     center;
    gap:             8px;
    background:      #1b7f5c;
    color:           #fff;
    padding:         10px 18px;
    font-weight:     600;
    font-size:       0.95rem;
    letter-spacing:  0.02em;
}
.gpgm-live-dot {
    width:         10px;
    height:        10px;
    background:    #ff4b4b;
    border-radius: 50%;
    animation:     gpgm-pulse 1.4s ease-in-out infinite;
    flex-shrink:   0;
}
@keyframes gpgm-pulse {
    0%,100% { opacity:1; transform:scale(1); }
    50%      { opacity:0.5; transform:scale(1.3); }
}
.gpgm-live-label {
    background:    #ff4b4b;
    color:         #fff;
    font-size:     0.7rem;
    padding:       2px 7px;
    border-radius: 30px;
    font-weight:   700;
    letter-spacing:0.08em;
}
.gpgm-adv-title  { flex:1; font-size:1rem; }
.gpgm-adv-updated { font-size:0.78rem; opacity:0.8; margin-left:auto; }

/* ── Karat Row ───────────────────────────────────────────────────────────── */
.gpgm-karat-row {
    padding:        10px 16px;
    border-bottom:  1px solid rgba(27,127,92,0.15);
    display:        flex;
    align-items:    center;
    gap:            16px;
    flex-wrap:      wrap;
}
.gpgm-karat-row:last-of-type { border-bottom:none; }
.gpgm-karat-badge {
    background:    #1b7f5c;
    color:         #fff;
    font-weight:   700;
    font-size:     0.88rem;
    padding:       5px 13px;
    border-radius: 30px;
    min-width:     50px;
    text-align:    center;
    flex-shrink:   0;
}
.gpgm-price-cards {
    display:   flex;
    gap:       10px;
    flex-wrap: wrap;
    flex:      1;
}
.gpgm-price-card {
    flex:          1;
    min-width:     110px;
    background:    #fff;
    border:        1px solid rgba(27,127,92,0.25);
    border-radius: 10px;
    padding:       8px 12px;
    text-align:    center;
    transition:    box-shadow 0.2s;
}
.gpgm-price-card:hover {
    box-shadow: 0 2px 10px rgba(27,127,92,0.18);
    border-color: #1b7f5c;
}
.gpgm-card-label {
    font-size:  0.72rem;
    color:      #4a7a64;
    font-weight:600;
    margin-bottom:3px;
    text-transform:uppercase;
    letter-spacing:0.04em;
}
.gpgm-card-price {
    font-size:  1.1rem;
    font-weight:700;
    color:      #1b7f5c;
}

/* ── Advanced Calculator ─────────────────────────────────────────────────── */
.gpgm-calc-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background:  #f0faf6;
    border:      2px solid #1b7f5c;
    border-radius:14px;
    overflow:    hidden;
    margin:      12px 0;
    box-shadow:  0 2px 12px rgba(27,127,92,0.13);
}
.gpgm-calc-header {
    background:     #1b7f5c;
    color:          #fff;
    padding:        12px 20px;
    display:        flex;
    align-items:    center;
    gap:            10px;
    font-size:      1.05rem;
    font-weight:    700;
}
.gpgm-calc-icon { font-size:1.3rem; }
.gpgm-calc-body { padding:20px; }
.gpgm-calc-row {
    display:  flex;
    gap:      14px;
    margin-bottom:14px;
    flex-wrap:wrap;
}
.gpgm-calc-field {
    flex:       1;
    min-width:  160px;
    display:    flex;
    flex-direction:column;
    gap:        5px;
}
.gpgm-calc-label {
    font-size:  0.8rem;
    font-weight:600;
    color:      #1b7f5c;
    text-transform:uppercase;
    letter-spacing:0.04em;
}
.gpgm-calc-input,
.gpgm-calc-select {
    padding:       9px 13px;
    border:        2px solid rgba(27,127,92,0.35);
    border-radius: 8px;
    font-size:     0.95rem;
    color:         #1a2e25;
    background:    #fff;
    outline:       none;
    transition:    border-color 0.2s;
    width:         100%;
    box-sizing:    border-box;
}
.gpgm-calc-input:focus,
.gpgm-calc-select:focus { border-color:#1b7f5c; }
.gpgm-calc-btn {
    width:         100%;
    background:    #1b7f5c;
    color:         #fff;
    border:        none;
    border-radius: 10px;
    padding:       13px;
    font-size:     1rem;
    font-weight:   700;
    cursor:        pointer;
    letter-spacing:0.03em;
    transition:    background 0.2s, transform 0.1s;
    margin-top:    4px;
}
.gpgm-calc-btn:hover  { background:#155f45; }
.gpgm-calc-btn:active { transform:scale(0.98); }
.gpgm-calc-result {
    margin-top:    16px;
    background:    #fff;
    border:        2px solid #1b7f5c;
    border-radius: 12px;
    padding:       18px;
}
.gpgm-calc-result-main {
    display:        flex;
    flex-direction: column;
    align-items:    center;
    margin-bottom:  14px;
    gap:            4px;
}
.gpgm-calc-result-label {
    font-size:  0.82rem;
    color:      #4a7a64;
    font-weight:600;
    text-transform:uppercase;
    letter-spacing:0.04em;
}
.gpgm-calc-result-price {
    font-size:  2rem;
    font-weight:800;
    color:      #1b7f5c;
    text-align: center;
}
.gpgm-calc-br-table { width:100%; border-collapse:collapse; font-size:0.88rem; }
.gpgm-calc-br-table td {
    padding:       6px 10px;
    border-bottom: 1px solid rgba(27,127,92,0.12);
    color:         #1a2e25;
}
.gpgm-calc-br-table td:first-child { color:#4a7a64; }
.gpgm-calc-br-table tr:last-child td { border-bottom:none; }
.gpgm-calc-note { font-size:0.75rem; color:#4a7a64; margin-top:10px; text-align:center; }
.gpgm-calc-loading {
    margin-top: 16px;
    display:    flex;
    align-items:center;
    gap:        10px;
    color:      #4a7a64;
    font-size:  0.9rem;
    justify-content:center;
}
.gpgm-calc-spinner {
    width:  20px; height:20px;
    border: 3px solid rgba(27,127,92,0.2);
    border-top-color:#1b7f5c;
    border-radius:50%;
    animation:gpgm-spin 0.7s linear infinite;
}
@keyframes gpgm-spin { to { transform:rotate(360deg); } }

/* ── Purity Table ────────────────────────────────────────────────────────── */
.gpgm-purity-table-wrap,
.gpgm-cities-table-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    margin:      12px 0;
}
.gpgm-purity-title {
    font-size:   1.1rem;
    font-weight: 700;
    color:       #1b7f5c;
    margin:      0 0 12px;
    padding-bottom:8px;
    border-bottom:2px solid #1b7f5c;
}
.gpgm-purity-tbl .gpgm-purity-label { color:#1b7f5c; }
.gpgm-table-responsive { overflow-x:auto; }

/* ── International Spot Price Widget ─────────────────────────────────────── */
.gpgm-spot-widget {
    display:       inline-flex;
    flex-direction:column;
    gap:           4px;
    background:    #f0faf6;
    border:        2px solid #1b7f5c;
    border-radius: 14px;
    padding:       14px 22px;
    box-shadow:    0 2px 12px rgba(27,127,92,0.13);
    font-family:   -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}
.gpgm-spot-label {
    font-size:  0.78rem;
    font-weight:700;
    color:      #4a7a64;
    text-transform:uppercase;
    letter-spacing:0.05em;
}
.gpgm-spot-price {
    display:    flex;
    align-items:baseline;
    gap:        4px;
    color:      #1b7f5c;
}
.gpgm-spot-sym   { font-size:1.3rem; font-weight:700; }
.gpgm-spot-value { font-size:2.2rem; font-weight:800; line-height:1; }
.gpgm-spot-unit  { font-size:0.8rem; color:#4a7a64; }
.gpgm-spot-meta {
    display:    flex;
    align-items:center;
    gap:        6px;
    font-size:  0.78rem;
    color:      #4a7a64;
}
.gpgm-spot-live   { font-weight:600; color:#1b7f5c; }
.gpgm-spot-time   { margin-left:auto; }
.gpgm-delayed-tag { color:#c0392b; font-weight:600; }

/* ── Cities Table shortcode code pills ───────────────────────────────────── */
.gpgm-sc-copy {
    background:    #e8f5ef;
    color:         #1b7f5c;
    border:        1px solid rgba(27,127,92,0.3);
    border-radius: 5px;
    padding:       2px 7px;
    font-size:     0.75rem;
    word-break:    break-all;
    transition:    background 0.2s;
}
.gpgm-sc-copy:hover { background:#1b7f5c; color:#fff; }

/* ── Responsive tweaks ───────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .gpgm-price-cards   { gap:7px; }
    .gpgm-price-card    { min-width:80px; padding:6px 8px; }
    .gpgm-card-price    { font-size:0.95rem; }
    .gpgm-karat-row     { gap:8px; }
    .gpgm-calc-row      { flex-direction:column; gap:10px; }
    .gpgm-spot-value    { font-size:1.7rem; }
}

/* ── v1.3 Calculator Buy/Sell additions ─────────────────────────────────── */
.gpgm-trade-toggle {
    display:   flex;
    gap:       8px;
    margin-top:6px;
    flex-wrap: wrap;
}
.gpgm-trade-btn {
    flex:       1;
    min-width:  140px;
    padding:    10px 14px;
    border:     2px solid rgba(27,127,92,0.3);
    border-radius:10px;
    background: #fff;
    color:      #4a7a64;
    font-size:  0.9rem;
    font-weight:600;
    cursor:     pointer;
    transition: all 0.2s;
    text-align: center;
}
.gpgm-trade-btn.active[data-trade="buy"] {
    background:  #f0fdf4;
    border-color:#22c55e;
    color:       #15803d;
}
.gpgm-trade-btn.active[data-trade="sell"] {
    background:  #fffbeb;
    border-color:#f59e0b;
    color:       #92400e;
}
.gpgm-trade-btn:hover { border-color:#1b7f5c; }
.gpgm-trade-hint {
    font-size:  0.78rem;
    color:      #4a7a64;
    margin-top: 6px;
    font-style: italic;
}
.gpgm-calc-label-buy  { color:#15803d !important; }
.gpgm-calc-label-sell { color:#92400e !important; }
.gpgm-calc-ded-row td { color:#c0392b !important; }
