/* ===========================================
   Gold Price VN — Plugin Styles
   Branding: Gold #C8A951, Dark #1A1A1A
   =========================================== */

/* Reset & Variables */
:root {
    --gpv-gold: #C8A951;
    --gpv-gold-light: #E8D9A0;
    --gpv-gold-dark: #A68B3C;
    --gpv-dark: #1A1A1A;
    --gpv-dark2: #2A2A2A;
    --gpv-dark3: #333;
    --gpv-bg: #F9F6EE;
    --gpv-white: #FFFFFF;
    --gpv-up: #27ae60;
    --gpv-down: #e74c3c;
    --gpv-border: #E8E0C8;
    --gpv-text: #444;
    --gpv-text-light: #888;
    --gpv-radius: 8px;
    --gpv-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

/* Đăng Kha 2 Khoa: full-width price pages and profile-style tools. */
.gpv-main-content-wide{display:block!important}
.gpv-main-content-wide .gpv-content-left{width:100%!important;max-width:none!important}
.gpv-main-content-wide+.gpv-content-right,.gpv-content-right,.gpv-footer-links{display:none!important}
.gpv-insights{margin:28px 0 10px;border:1px solid #eadfc8;border-radius:12px;background:#fff;overflow:hidden;box-shadow:0 8px 24px rgba(72,35,20,.08)}
.gpv-narration{margin:18px;padding:14px 18px;border-left:3px solid #d8a83d;border-radius:7px;background:#fffdf8;max-height:310px;overflow:auto}
.gpv-narration p{margin:0 0 11px;font-size:13px;line-height:1.65;color:#403633}
.gpv-narration p:last-child{margin-bottom:0}
.gpv-tool-panels{border-top:1px solid #eee}
.gpv-tool-panel{padding:22px;background:#fff}
.gpv-tool-panel[hidden]{display:none!important}
.gpv-tool-panel h3{margin:0 0 6px;font-size:18px;color:#2b211f}
.gpv-tool-note{margin:0 0 18px;color:#776b68;font-size:12px}
.gpv-chart-wrap{height:330px;position:relative}
.gpv-forecast-table{overflow-x:auto}
.gpv-forecast-table table{width:100%;border-collapse:collapse;font-size:13px}
.gpv-forecast-table th,.gpv-forecast-table td{padding:11px;border-bottom:1px solid #eee;text-align:left;white-space:nowrap}
.gpv-forecast-table th{background:#fff9ee;color:#6e5014}
.gpv-calc-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.gpv-calc-grid label{display:grid;gap:6px;font-size:12px;font-weight:700;color:#645955}
.gpv-calc-grid input,.gpv-calc-grid select{width:100%;height:44px;margin:0;padding:0 12px;border:1px solid #dfd6cb;border-radius:8px;background:#fff;color:#2e2826}
.gpv-calc-result{display:flex;justify-content:space-between;gap:15px;margin-top:16px;padding:16px;border-left:3px solid #7b1016;border-radius:8px;background:#fff9ee}
.gpv-calc-result strong{color:#7b1016}.gpv-calc-result span{color:#655b57;font-size:12px}
.gpv-tool-actions{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;padding:14px 18px 18px;background:#fff}
.gpv-tool-actions button{min-height:46px;border:0;border-radius:8px;background:#d5b44f;color:#fff;font-weight:800;cursor:pointer;transition:transform .15s,filter .15s}
.gpv-tool-actions button:nth-child(2){background:#c99612}.gpv-tool-actions button:nth-child(3){background:#68473d}
.gpv-tool-actions button:hover,.gpv-tool-actions button.is-active{filter:brightness(.9);transform:translateY(-1px)}
@media(max-width:640px){.gpv-narration{margin:12px;padding:12px}.gpv-tool-panel{padding:16px}.gpv-chart-wrap{height:260px}.gpv-calc-grid{grid-template-columns:1fr}.gpv-calc-result{display:grid}.gpv-tool-actions{gap:7px;padding:10px}.gpv-tool-actions button{font-size:12px}}

/* ===== PAGE WRAPPER ===== */
.gpv-page-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 15px 40px;
}

.gpv-update-info {
    font-size: 14px;
    color: var(--gpv-text);
    margin-bottom: 20px;
    padding: 10px 16px;
    background: var(--gpv-bg);
    border-radius: 6px;
    border-left: 4px solid var(--gpv-gold);
}

.gpv-ref-badge {
    display: inline-block;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 3px;
    margin-left: 6px;
    vertical-align: middle;
    font-weight: 600;
    background: #FFF3CD;
    color: #856404;
    border: 1px solid #FFE69C;
}

.gpv-calculated {
    background: rgba(255,243,205,0.15);
}

/* Converter Mini (sidebar) */
.gpv-converter-mini input,
.gpv-converter-mini select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--gpv-border);
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 8px;
    background: var(--gpv-bg);
}
.gpv-converter-mini input:focus,
.gpv-converter-mini select:focus {
    border-color: var(--gpv-gold);
    outline: none;
}

/* Service links */
.gpv-service-links {
    list-style: none;
    padding: 0;
    margin: 0;
}
.gpv-service-links li {
    padding: 6px 0;
    border-bottom: 1px solid var(--gpv-border);
}
.gpv-service-links li:last-child { border: none; }
.gpv-service-links a {
    color: var(--gpv-text);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}
.gpv-service-links a:hover {
    color: var(--gpv-gold-dark);
}

/* ===== TABLE WRAP ===== */
.gpv-table-wrap {
    background: var(--gpv-white);
    border-radius: var(--gpv-radius);
    box-shadow: var(--gpv-shadow);
    overflow: hidden;
    margin-bottom: 24px;
    border: 1px solid var(--gpv-border);
}

.gpv-table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--gpv-dark), var(--gpv-dark2));
    color: var(--gpv-gold);
    flex-wrap: wrap;
    gap: 8px;
}

.gpv-table-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--gpv-gold);
}

.gpv-update-time {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--gpv-gold-light);
}

.gpv-refresh-btn {
    background: rgba(200,169,81,0.15);
    border: 1px solid var(--gpv-gold);
    color: var(--gpv-gold);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.gpv-refresh-btn:hover {
    background: var(--gpv-gold);
    color: var(--gpv-dark);
    transform: rotate(180deg);
}

/* ===== UNIT TABS ===== */
.gpv-unit-tabs {
    display: flex;
    gap: 0;
    padding: 0;
    background: var(--gpv-bg);
    border-bottom: 1px solid var(--gpv-border);
}

.gpv-tab {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--gpv-text);
    transition: all 0.25s;
    border-bottom: 3px solid transparent;
}

.gpv-tab:hover {
    background: rgba(200,169,81,0.08);
    color: var(--gpv-gold-dark);
}

.gpv-tab.active {
    background: var(--gpv-white);
    color: var(--gpv-gold-dark);
    border-bottom-color: var(--gpv-gold);
}

/* ===== TABLE ===== */
.gpv-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.gpv-table thead {
    background: var(--gpv-bg);
}

.gpv-table thead th {
    padding: 12px 14px;
    text-align: left;
    font-weight: 700;
    color: var(--gpv-dark3);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 2px solid var(--gpv-border);
    white-space: nowrap;
}

.gpv-table tbody tr {
    border-bottom: 1px solid #f0ece0;
    transition: background 0.2s;
}

.gpv-table tbody tr:hover {
    background: rgba(200,169,81,0.04);
}

.gpv-table tbody tr:last-child {
    border-bottom: none;
}

.gpv-table td {
    padding: 11px 14px;
    vertical-align: middle;
}

.gpv-table td strong {
    color: var(--gpv-dark);
    font-weight: 600;
}

.gpv-type-badge {
    display: inline-block;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 6px;
    vertical-align: middle;
    font-weight: 600;
    background: var(--gpv-bg);
    color: var(--gpv-gold-dark);
    border: 1px solid var(--gpv-border);
}

.gpv-price {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.gpv-buy {
    color: var(--gpv-up);
}

.gpv-sell {
    color: var(--gpv-down);
}

.gpv-change {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.gpv-up { color: var(--gpv-up); }
.gpv-down { color: var(--gpv-down); }
.gpv-no-change { color: var(--gpv-text-light); }

.gpv-row.gpv-world {
    background: linear-gradient(90deg, rgba(200,169,81,0.06), transparent);
}

.gpv-row.gpv-world td:first-child strong {
    color: var(--gpv-gold-dark);
}

.gpv-note {
    padding: 10px 20px;
    font-size: 12px;
    color: var(--gpv-text-light);
    background: var(--gpv-bg);
    margin: 0;
    border-top: 1px solid var(--gpv-border);
}

.gpv-error {
    padding: 20px;
    text-align: center;
    color: var(--gpv-down);
    background: #fef2f2;
    border-radius: var(--gpv-radius);
    border: 1px solid #fecaca;
}

/* ===== CHART ===== */
.gpv-chart-wrap {
    background: var(--gpv-white);
    border-radius: var(--gpv-radius);
    box-shadow: var(--gpv-shadow);
    padding: 20px;
    margin-bottom: 24px;
    border: 1px solid var(--gpv-border);
}

.gpv-chart-wrap h3 {
    margin: 0 0 16px;
    font-size: 18px;
    color: var(--gpv-dark);
}

/* ===== CONVERTER ===== */
.gpv-converter {
    background: var(--gpv-white);
    border-radius: var(--gpv-radius);
    box-shadow: var(--gpv-shadow);
    padding: 20px;
    margin-bottom: 24px;
    border: 1px solid var(--gpv-border);
}

.gpv-converter h3 {
    margin: 0 0 16px;
    font-size: 16px;
    color: var(--gpv-dark);
}

.gpv-conv-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.gpv-conv-row label {
    min-width: 80px;
    font-weight: 600;
    color: var(--gpv-dark3);
    font-size: 14px;
}

.gpv-conv-row input,
.gpv-conv-row select {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--gpv-border);
    border-radius: 6px;
    font-size: 14px;
    background: var(--gpv-bg);
    transition: border 0.2s;
}

.gpv-conv-row input:focus,
.gpv-conv-row select:focus {
    border-color: var(--gpv-gold);
    outline: none;
    box-shadow: 0 0 0 3px rgba(200,169,81,0.15);
}

.gpv-conv-result {
    background: var(--gpv-bg);
    padding: 12px 16px;
    border-radius: 6px;
    border-left: 4px solid var(--gpv-gold);
    margin-bottom: 12px;
}

.gpv-conv-result p { margin: 0; font-size: 14px; color: var(--gpv-dark3); }

.gpv-conv-price {
    background: linear-gradient(135deg, var(--gpv-dark), var(--gpv-dark2));
    color: var(--gpv-gold);
    padding: 12px 16px;
    border-radius: 6px;
    text-align: center;
}

.gpv-conv-price p { margin: 0; font-size: 15px; }
.gpv-conv-price strong { font-size: 20px; }

/* ===== SIDEBAR ===== */
.gpv-sidebar {
    position: sticky;
    top: 20px;
}

.gpv-sidebar-box {
    background: var(--gpv-white);
    border-radius: var(--gpv-radius);
    box-shadow: var(--gpv-shadow);
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid var(--gpv-border);
}

.gpv-sidebar-box h4 {
    margin: 0 0 12px;
    font-size: 15px;
    color: var(--gpv-dark);
    padding-bottom: 8px;
    border-bottom: 2px solid var(--gpv-gold);
}

/* Quick price */
.gpv-quick-price {
    background: linear-gradient(135deg, var(--gpv-dark), var(--gpv-dark2));
    border: 1px solid var(--gpv-gold-dark);
}

.gpv-quick-price h4 {
    color: var(--gpv-gold);
    border-bottom-color: rgba(200,169,81,0.3);
}

.gpv-quick-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(200,169,81,0.12);
}

.gpv-quick-item:last-child { border-bottom: none; }

.gpv-ql {
    font-weight: 600;
    color: var(--gpv-gold-light);
    font-size: 13px;
}

.gpv-qp {
    font-weight: 700;
    color: var(--gpv-gold);
    font-size: 14px;
}

/* Province links */
.gpv-prov-link {
    display: inline-block;
    padding: 4px 8px;
    margin: 2px;
    font-size: 12px;
    color: var(--gpv-text);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s;
    background: var(--gpv-bg);
}

.gpv-prov-link:hover {
    background: var(--gpv-gold);
    color: var(--gpv-dark);
}

/* Brand links */
.gpv-brand-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.gpv-brand-links a {
    display: inline-block;
    padding: 6px 12px;
    font-size: 13px;
    color: var(--gpv-gold-dark);
    text-decoration: none;
    border: 1px solid var(--gpv-border);
    border-radius: 20px;
    transition: all 0.2s;
    font-weight: 600;
}

.gpv-brand-links a:hover {
    background: var(--gpv-gold);
    color: var(--gpv-dark);
    border-color: var(--gpv-gold);
}

/* ===== PROVINCE PAGE ===== */
.gpv-breadcrumb {
    padding: 12px 0;
    font-size: 13px;
    color: var(--gpv-text-light);
    margin-bottom: 16px;
}

.gpv-breadcrumb a {
    color: var(--gpv-gold-dark);
    text-decoration: none;
}

.gpv-breadcrumb a:hover { text-decoration: underline; }

.gpv-province-page {
    overflow-x: hidden;
    max-width: 100%;
    box-sizing: border-box;
}

.gpv-province-page h1 {
    font-size: 28px;
    color: var(--gpv-dark);
    margin-bottom: 12px;
    line-height: 1.3;
}

.gpv-intro {
    font-size: 15px;
    line-height: 1.7;
    color: var(--gpv-text);
    margin-bottom: 24px;
    padding: 16px;
    background: var(--gpv-bg);
    border-radius: var(--gpv-radius);
    border-left: 4px solid var(--gpv-gold);
}

.gpv-main-content {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    align-items: start;
}

.gpv-content-left { min-width: 0; }

.gpv-seo-content {
    margin-top: 24px;
    padding: 20px;
    background: var(--gpv-white);
    border-radius: var(--gpv-radius);
    border: 1px solid var(--gpv-border);
    line-height: 1.8;
    color: var(--gpv-text);
    font-size: 15px;
}

.gpv-seo-content h2 {
    font-size: 22px;
    color: var(--gpv-dark);
    margin-top: 0;
    margin-bottom: 12px;
}

.gpv-seo-content h3 {
    font-size: 18px;
    color: var(--gpv-dark3);
}

/* ===== FAQ ===== */
.gpv-faq {
    margin-top: 24px;
}

.gpv-faq > h2 {
    font-size: 22px;
    color: var(--gpv-dark);
    margin-bottom: 16px;
}

.gpv-faq-item {
    margin-bottom: 8px;
    border: 1px solid var(--gpv-border);
    border-radius: var(--gpv-radius);
    overflow: hidden;
    background: var(--gpv-white);
}

.gpv-faq-q {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border: none;
    background: var(--gpv-bg);
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: var(--gpv-dark);
    text-align: left;
    transition: all 0.2s;
}

.gpv-faq-q:hover {
    background: rgba(200,169,81,0.1);
}

.gpv-faq-icon {
    font-size: 12px;
    transition: transform 0.3s;
    color: var(--gpv-gold-dark);
}

.gpv-faq-item.active .gpv-faq-icon {
    transform: rotate(180deg);
}

.gpv-faq-a {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease;
    padding: 0 18px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--gpv-text);
}

.gpv-faq-item.active .gpv-faq-a {
    max-height: 500px;
    padding: 14px 18px;
    border-top: 1px solid var(--gpv-border);
}

/* (old footer styles removed — see new styles below) */

/* ===== LOADING STATE ===== */
.gpv-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.gpv-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid var(--gpv-border);
    border-top-color: var(--gpv-gold);
    border-radius: 50%;
    animation: gpv-spin 0.8s linear infinite;
}

@keyframes gpv-spin {
    to { transform: rotate(360deg); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .gpv-main-content {
        grid-template-columns: 1fr;
    }
    .gpv-sidebar {
        position: static;
    }
}

@media (max-width: 640px) {
    .gpv-table-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .gpv-table {
        font-size: 13px;
    }
    .gpv-table thead th,
    .gpv-table td {
        padding: 10px 8px;
    }
    .gpv-type-badge,
    .gpv-ref-badge {
        display: none;
    }
    /* Mobile: chỉ giữ 3 cột (Loại vàng, Mua, Bán) */
    .gpv-col-extra,
    .gpv-col-change {
        display: none !important;
    }
    .gpv-table thead th:first-child {
        width: 45%;
    }
    .gpv-tab {
        padding: 8px 10px;
        font-size: 12px;
    }
    .gpv-province-page {
    overflow-x: hidden;
    max-width: 100%;
    box-sizing: border-box;
}

.gpv-province-page h1 {
        font-size: 22px;
    }
    .gpv-conv-row {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }
    .gpv-conv-row label {
        min-width: auto;
    }
}

/* ===== FOOTER LINKS — 2x3 GRID CARDS ===== */
.gpv-footer-links {
    margin-top: 32px;
    padding: 24px;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border-radius: var(--gpv-radius);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    box-sizing: border-box;
    max-width: 100%;
    overflow: hidden;
}

.gpv-link-section {
    background: rgba(255,255,255,0.04);
    border-radius: 8px;
    padding: 16px;
    border: 1px solid rgba(200,169,81,0.12);
    margin-bottom: 0;
    padding-bottom: 16px;
    border-bottom: none;
    min-width: 0;
    overflow: hidden;
    box-sizing: border-box;
}
.gpv-link-section:last-child {
    margin-bottom: 0;
    padding-bottom: 16px;
    border-bottom: none;
}

.gpv-footer-links h3 {
    color: var(--gpv-gold);
    margin: 0 0 12px;
    font-size: 14px;
    text-align: left;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(200,169,81,0.2);
    letter-spacing: 0.3px;
}

.gpv-scroll-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-start;
    max-height: 110px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(200,169,81,0.4) transparent;
    width: 100%;
}

.gpv-scroll-row::-webkit-scrollbar {
    width: 3px;
}
.gpv-scroll-row::-webkit-scrollbar-thumb {
    background: rgba(200,169,81,0.4);
    border-radius: 3px;
}
.gpv-scroll-row::-webkit-scrollbar-track {
    background: transparent;
}

.gpv-scroll-row a {
    display: inline-block;
    padding: 4px 10px;
    font-size: 11px;
    color: #d4d4d4;
    text-decoration: none;
    border-radius: 14px;
    transition: all 0.2s;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1.4;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gpv-scroll-row a:hover {
    background: var(--gpv-gold);
    color: #1a1a2e;
    border-color: var(--gpv-gold);
    font-weight: 600;
}



@media (max-width: 640px) {
    .gpv-footer-links {
        grid-template-columns: 1fr;
        padding: 12px;
        gap: 10px;
        margin-left: -15px;
        margin-right: -15px;
        border-radius: 0;
        max-width: calc(100% + 30px);
    }
    .gpv-link-section {
        padding: 12px;
        overflow: visible;
    }
    .gpv-scroll-row {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        max-height: none;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        padding-bottom: 8px;
        margin-right: -12px;
        padding-right: 12px;
    }
    .gpv-scroll-row a {
        scroll-snap-align: start;
        font-size: 12px;
        padding: 5px 12px;
        flex-shrink: 0;
    }
    .gpv-footer-links h3 {
        font-size: 13px;
        margin-bottom: 8px;
    }
}

