/* =========================================================
   Live Gold Price — Frontend Styles
   ========================================================= */

/* ---- Wrapper ---- */
.lgp-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    border-radius: 12px;
    overflow: hidden;
    margin: 1.5em 0;
    box-shadow: 0 4px 24px rgba(0,0,0,.12);
    max-width: 100%;
}

.lgp-title {
    margin: 0 0 0.5em;
    font-size: 1.15em;
    font-weight: 700;
    padding: 16px 20px 0;
}

/* ---- Table ---- */
.lgp-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.lgp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
}

.lgp-table thead tr th {
    padding: 14px 18px;
    text-align: left;
    font-weight: 600;
    font-size: 0.8em;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.lgp-table tbody tr td {
    padding: 14px 18px;
    border-top: 1px solid rgba(0,0,0,.06);
    vertical-align: middle;
    white-space: nowrap;
}

.lgp-col-metal {
    min-width: 150px;
}

.lgp-col-price,
.lgp-col-gram {
    font-size: 1.05em;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* Metal cell layout */
.lgp-col-metal {
    display: flex !important;
    align-items: center;
    gap: 10px;
}

.lgp-icon {
    font-size: 1.4em;
    line-height: 1;
    flex-shrink: 0;
}

.lgp-metal-name {
    font-weight: 600;
}

.lgp-metal-code {
    font-size: 0.75em;
    opacity: .6;
    display: block;
    font-family: monospace;
}

/* Change column */
.lgp-col-change {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.lgp-change-up   { color: #16a34a; }
.lgp-change-down { color: #dc2626; }

.lgp-pct {
    font-size: 0.85em;
    opacity: .8;
    margin-left: 2px;
}

/* Footer */
.lgp-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 18px;
    font-size: 0.75em;
    opacity: .7;
    flex-wrap: wrap;
    gap: 6px;
}

.lgp-updated {
    display: flex;
    align-items: center;
    gap: 6px;
}

.lgp-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #16a34a;
    animation: lgp-pulse 2s infinite;
}

@keyframes lgp-pulse {
    0%,100% { opacity: 1; }
    50%      { opacity: .4; }
}

/* Error state */
.lgp-error {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9em;
}

/* =========================================================
   THEME: Gold (default)
   ========================================================= */
.lgp-theme-gold {
    background: linear-gradient(135deg, #1a1209 0%, #2d1f05 100%);
    color: #f5e6c0;
    border: 1px solid #8a6a1a;
}

.lgp-theme-gold .lgp-title    { color: #f0c84a; }

.lgp-theme-gold .lgp-table thead tr {
    background: rgba(212,170,60,.15);
}

.lgp-theme-gold .lgp-table thead th {
    color: #d4aa3c;
    border-bottom: 2px solid rgba(212,170,60,.35);
}

.lgp-theme-gold .lgp-table tbody tr:hover {
    background: rgba(212,170,60,.08);
}

.lgp-theme-gold .lgp-table tbody tr td {
    border-color: rgba(212,170,60,.12);
    color: #f5e6c0;
}

.lgp-theme-gold .lgp-col-price,
.lgp-theme-gold .lgp-col-gram {
    color: #f0c84a;
}

.lgp-theme-gold .lgp-sym {
    color: #d4aa3c;
    margin-right: 1px;
}

.lgp-theme-gold .lgp-footer {
    background: rgba(0,0,0,.2);
    color: #c9aa6a;
}

.lgp-theme-gold .lgp-error {
    color: #f5c842;
    background: rgba(212,170,60,.1);
}

/* =========================================================
   THEME: Dark
   ========================================================= */
.lgp-theme-dark {
    background: #0f172a;
    color: #e2e8f0;
    border: 1px solid #1e293b;
}

.lgp-theme-dark .lgp-title { color: #f1f5f9; }

.lgp-theme-dark .lgp-table thead tr {
    background: #1e293b;
}

.lgp-theme-dark .lgp-table thead th {
    color: #94a3b8;
    border-bottom: 2px solid #334155;
}

.lgp-theme-dark .lgp-table tbody tr:hover {
    background: #1e293b;
}

.lgp-theme-dark .lgp-table tbody tr td {
    border-color: #1e293b;
    color: #e2e8f0;
}

.lgp-theme-dark .lgp-col-price,
.lgp-theme-dark .lgp-col-gram {
    color: #60a5fa;
}

.lgp-theme-dark .lgp-sym { color: #94a3b8; }

.lgp-theme-dark .lgp-footer {
    background: #1e293b;
    color: #64748b;
}

.lgp-theme-dark .lgp-error {
    color: #fca5a5;
    background: rgba(220,38,38,.1);
}

/* =========================================================
   THEME: Light
   ========================================================= */
.lgp-theme-light {
    background: #ffffff;
    color: #1f2937;
    border: 1px solid #e5e7eb;
}

.lgp-theme-light .lgp-title { color: #111827; }

.lgp-theme-light .lgp-table thead tr {
    background: #f9fafb;
}

.lgp-theme-light .lgp-table thead th {
    color: #6b7280;
    border-bottom: 2px solid #e5e7eb;
}

.lgp-theme-light .lgp-table tbody tr:hover {
    background: #f9fafb;
}

.lgp-theme-light .lgp-table tbody tr td {
    border-color: #f3f4f6;
    color: #1f2937;
}

.lgp-theme-light .lgp-col-price,
.lgp-theme-light .lgp-col-gram {
    color: #1d4ed8;
}

.lgp-theme-light .lgp-sym { color: #6b7280; }

.lgp-theme-light .lgp-footer {
    background: #f9fafb;
    border-top: 1px solid #f3f4f6;
    color: #9ca3af;
}

.lgp-theme-light .lgp-error {
    color: #b91c1c;
    background: #fef2f2;
}

/* =========================================================
   THEME: Minimal
   ========================================================= */
.lgp-theme-minimal {
    background: transparent;
    color: inherit;
    border: 1px solid currentColor;
    box-shadow: none;
    opacity: .85;
}

.lgp-theme-minimal .lgp-table thead th {
    border-bottom: 1px solid currentColor;
    opacity: .6;
}

.lgp-theme-minimal .lgp-table tbody tr td {
    border-color: rgba(0,0,0,.08);
}

.lgp-theme-minimal .lgp-footer {
    opacity: .5;
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 600px) {
    .lgp-table thead tr th,
    .lgp-table tbody tr td {
        padding: 10px 12px;
        font-size: 0.85em;
    }

    .lgp-metal-code { display: none; }
    .lgp-icon       { font-size: 1.1em; }

    .lgp-footer {
        flex-direction: column;
        align-items: flex-start;
    }
}
