/* RS Gold Prices - Gaming-Themed Design System */
/* RuneScape-inspired Gold/Bronze Medieval Aesthetic */

/* ===== CSS Variables - Gaming Color Palette ===== */
:root {
    /* Primary - Gold */
    --gold-primary: #D4AF37;
    --gold-light: #F7C600;
    --gold-dark: #B8860B;

    /* Secondary - Bronze */
    --bronze-primary: #CD7F32;
    --bronze-light: #E4934C;
    --bronze-dark: #8B4513;

    /* Backgrounds - Dark Medieval */
    --bg-primary: #1A1410;
    --bg-secondary: #2D2419;
    --bg-card: #3A2F23;
    --bg-hover: #4A3F33;

    /* Text - Parchment */
    --text-primary: #F5E6D3;
    --text-secondary: #C4B5A0;
    --text-muted: #8B7D6B;

    /* Game Accents */
    --osrs-accent: #7C142C;
    --rs3-accent: #53217B;
    --success: #15E9A0;
    --warning: #CC8C54;

    /* Typography */
    --font-heading: 'Cinzel', 'Trajan Pro', serif;
    --font-body: 'Lora', Georgia, serif;
    --font-ui: 'Lato', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'Roboto Mono', 'Courier New', monospace;
}

/* ===== Reset and Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    border: 3px solid var(--bronze-dark);
}

/* ===== Header ===== */
header {
    background: linear-gradient(135deg, var(--bg-primary) 0%, #0F0C0A 100%);
    color: var(--text-primary);
    padding: 40px 30px;
    text-align: center;
    position: relative;
    border-bottom: 4px solid var(--gold-dark);
}

header h1 {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--gold-primary);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8),
                 0 0 20px rgba(212, 175, 55, 0.3);
    letter-spacing: 2px;
}

header h1 a {
    color: inherit;
    text-decoration: none;
    transition: all 0.2s ease;
}

header h1 a:hover {
    color: var(--gold-light);
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.9),
                 0 0 30px rgba(212, 175, 55, 0.5);
}

header .subtitle {
    font-family: var(--font-ui);
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

header .last-update {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 300;
}

/* ===== Navigation ===== */
nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid var(--bronze-dark);
}

nav a {
    font-family: var(--font-ui);
    font-weight: 700;
    font-size: 1rem;
    color: var(--bronze-light);
    text-decoration: none;
    padding: 10px 20px;
    border: 2px solid var(--bronze-dark);
    border-radius: 6px;
    background: var(--bg-secondary);
    transition: all 0.3s ease;
}

nav a:hover {
    background: var(--bg-hover);
    color: var(--gold-light);
    border-color: var(--gold-primary);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
    transform: translateY(-2px);
}

nav a.active {
    background: var(--gold-primary);
    color: var(--bg-primary);
    border-color: var(--gold-dark);
}

/* ===== Language Switcher ===== */
.lang-switcher {
    position: absolute;
    top: 20px;
    right: 30px;
    display: flex;
    gap: 8px;
    background: var(--bg-card);
    padding: 8px;
    border-radius: 8px;
    border: 2px solid var(--bronze-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.lang-switcher a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s;
    font-family: var(--font-ui);
    font-weight: 700;
    font-size: 0.9rem;
}

.lang-switcher a:hover {
    background: var(--bg-hover);
    color: var(--gold-light);
}

.lang-switcher a.active {
    background: var(--gold-primary);
    color: var(--bg-primary);
    border: 2px solid var(--gold-dark);
}

.lang-switcher img {
    width: 24px;
    height: 16px;
    border-radius: 2px;
}

/* ===== Main Content ===== */
main {
    padding: 40px 30px;
    background: var(--bg-secondary);
}

/* ===== Price Grid ===== */
.price-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.price-section {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    border: 3px solid var(--bronze-dark);
    transition: all 0.3s ease;
}

.price-section:hover {
    border-color: var(--gold-dark);
    box-shadow: 0 6px 24px rgba(212, 175, 55, 0.3);
    transform: translateY(-2px);
}

.price-section h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--gold-primary);
    font-weight: 600;
    text-align: center;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--bronze-primary);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* ===== Table Styles ===== */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scroll on iOS */
}

table {
    width: 100%;
    min-width: 900px; /* Ensure table doesn't squish too much */
    border-collapse: collapse;
    background: var(--bg-secondary);
    border-radius: 8px;
    overflow: hidden;
}

thead {
    background: linear-gradient(135deg, var(--gold-dark) 0%, var(--bronze-primary) 100%);
    color: var(--bg-primary);
}

th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: var(--font-ui);
}

tbody tr {
    border-bottom: 1px solid var(--bronze-dark);
    transition: all 0.2s;
}

tbody tr:hover {
    background-color: var(--bg-hover);
}

tbody tr:last-child {
    border-bottom: none;
}

td {
    padding: 14px 16px;
    color: var(--text-primary);
}

td.rank {
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--gold-light);
    width: 70px;
    font-size: 1.1rem;
}

td.price {
    font-weight: 700;
    color: var(--success);
    font-size: 1.2rem;
    font-family: var(--font-mono);
}

td.no-data {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 24px;
}

td a {
    color: var(--bronze-light);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

td a:hover {
    color: var(--gold-light);
    text-decoration: underline;
}

/* ===== Best Price Highlight ===== */
tr.best-price {
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.15) 0%, rgba(212, 175, 55, 0.05) 100%) !important;
    border-left: 5px solid var(--gold-primary);
    box-shadow: inset 0 0 20px rgba(212, 175, 55, 0.1);
}

tr.best-price td.rank {
    color: var(--gold-primary);
    font-size: 1.3rem;
}

tr.best-price td.price {
    font-size: 1.4rem;
    color: var(--gold-light);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    font-weight: 700;
}

tr.best-price td.seller a {
    color: var(--gold-light);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* ===== Enhanced Price Table ===== */
.price-table {
    table-layout: fixed;
    width: 100%;
}

.price-table th,
.price-table td {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.price-table .col-rank {
    width: 44px;
}

.price-table .col-seller {
    width: 160px;
}

.price-table .col-seller a {
    white-space: normal;
    word-break: break-word;
}

.price-table .col-price {
    width: 100px;
    text-align: right;
    white-space: nowrap;
    overflow: visible;
}

.price-table .col-payment {
    width: 130px;
}

.price-table .col-delivery {
    width: 110px;
}

.price-table .col-stock {
    width: 110px;
}

.price-table .col-reviews {
    width: 90px;
    text-align: right;
}

.price-table td.seller a {
    font-weight: 600;
    font-size: 1rem;
}

.price-table td.price {
    font-size: 1.1rem;
    text-align: right;
}

/* ===== Badges ===== */
.badge-gold {
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-light));
    color: var(--bg-primary);
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.95rem;
    display: inline-block;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.4);
}

.badge-payment,
.badge-delivery,
.badge-stock {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-block;
}

.badge-payment {
    background: rgba(83, 33, 123, 0.2);
    border: 1px solid var(--rs3-accent);
    color: var(--text-secondary);
}

.badge-delivery {
    background: rgba(21, 233, 160, 0.15);
    border: 1px solid var(--success);
    color: var(--success);
}

.badge-stock {
    background: rgba(21, 233, 160, 0.1);
    border: 1px solid var(--success);
    color: var(--text-secondary);
}

/* ===== Payment Method Icons ===== */
.payment-icons {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
    overflow: hidden;
}

.price-table td.payment {
    white-space: normal;
    overflow: hidden;
}

.payment-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px;
    transition: all 0.2s;
}

.payment-icon:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.1);
}

/* Larger icons for calculator/details */
.payment-icons-large .payment-icon {
    width: 32px;
    height: 32px;
    padding: 4px;
}

/* ===== Coupon Codes ===== */
.price-table .col-coupon {
    width: 120px;
}

.price-table .col-discount {
    width: 70px;
    text-align: center;
    white-space: nowrap;
}

.price-table .col-visit {
    width: 140px;
}

.coupon-code {
    display: block;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    padding: 4px 6px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
    border: 2px solid transparent;
    user-select: none;
    position: relative;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.coupon-code:hover {
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    border-color: #a855f7;
}

.coupon-code::after {
    content: 'Click to copy';
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a2e;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 100;
}

.coupon-code:hover::after {
    opacity: 1;
}

.coupon-code.copied {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    animation: pulse-success 0.3s ease;
}

@keyframes pulse-success {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.no-coupon,
.no-discount {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.discount-badge {
    display: inline-block;
    padding: 4px 10px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

/* ===== Visit Merchant Button ===== */
.visit-btn {
    display: block;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    padding: 6px 8px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.82rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
    border: 2px solid transparent;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.visit-btn:hover {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
    border-color: #fcd34d;
}

.visit-btn:active {
    transform: translateY(0);
}

/* ===== Info Box ===== */
.info-box {
    background: var(--bg-card);
    border: 3px solid var(--bronze-primary);
    border-radius: 12px;
    padding: 24px;
    margin-top: 30px;
}

.info-box p {
    margin: 8px 0;
    color: var(--text-secondary);
}

.info-box strong {
    color: var(--gold-primary);
}

.info-box a {
    color: var(--gold-light);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.info-box a:hover {
    color: var(--gold-primary);
    text-decoration: underline;
}

/* ===== Content Sections ===== */
.content-intro {
    background: var(--bg-card);
    border-left: 4px solid var(--gold-primary);
    border-radius: 8px;
    padding: 20px 25px;
    margin-bottom: 30px;
}

.content-intro p {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.content-section {
    background: var(--bg-card);
    border: 2px solid var(--bronze-dark);
    border-radius: 12px;
    padding: 25px 30px;
    margin-top: 30px;
}

.content-section h2 {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    color: var(--gold-primary);
    margin-bottom: 15px;
    border-bottom: 2px solid var(--bronze-dark);
    padding-bottom: 10px;
}

.content-section h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    color: var(--bronze-light);
    margin: 20px 0 12px 0;
}

.content-section h4 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    color: var(--bronze-light);
    margin: 15px 0 10px 0;
}

.content-section p {
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.content-section ul {
    margin: 12px 0 12px 25px;
}

.content-section li {
    margin-bottom: 8px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.content-section strong {
    color: var(--gold-primary);
    font-weight: 600;
}

.content-section a {
    color: var(--gold-light);
    text-decoration: underline;
}

.content-section a:hover {
    color: var(--gold-primary);
}

/* ===== FAQ Section ===== */
.faq-section {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 2px solid var(--bg-card);
}

.faq-section h2 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: var(--gold-primary);
    margin-bottom: 25px;
    text-align: center;
}

.faq-item {
    background: var(--bg-card);
    border: 2px solid var(--bronze-dark);
    border-radius: 10px;
    padding: 20px 25px;
    margin-bottom: 15px;
    transition: all 0.3s;
}

.faq-item:hover {
    border-color: var(--bronze-primary);
    box-shadow: 0 4px 15px rgba(205, 127, 50, 0.2);
}

.faq-item h3 {
    font-family: var(--font-heading);
    color: var(--bronze-light);
    font-size: 1.15rem;
    margin-bottom: 10px;
}

.faq-item p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0;
}

/* ===== Info Note ===== */
.info-note {
    background: rgba(212, 175, 55, 0.1);
    border: 2px solid var(--gold-dark);
    border-radius: 8px;
    padding: 15px 20px;
    margin: 20px 0;
}

.info-note p {
    margin: 0;
    color: var(--text-secondary);
}

/* ===== Homepage Intro Section ===== */
.intro-section {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    border: 2px solid var(--bronze-dark);
    border-radius: 12px;
    padding: 35px;
    margin: 40px auto;
    max-width: 900px;
    text-align: center;
}

.intro-section h3 {
    font-family: var(--font-heading);
    color: var(--gold-primary);
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.intro-section p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 15px;
    font-size: 1.05rem;
}

/* ===== Error State ===== */
.error {
    background: var(--bg-card);
    border: 3px solid var(--warning);
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    color: var(--text-primary);
}

.error p {
    margin: 10px 0;
    font-size: 1.1rem;
}

.error a {
    color: var(--gold-light);
    font-weight: 600;
    text-decoration: none;
}

.error a:hover {
    text-decoration: underline;
}

/* ===== Footer ===== */
footer {
    background: var(--bg-primary);
    padding: 30px;
    text-align: center;
    border-top: 4px solid var(--bronze-dark);
    color: var(--text-muted);
}

footer p {
    margin: 8px 0;
    font-size: 0.95rem;
}

footer a {
    color: var(--bronze-light);
    text-decoration: none;
    transition: color 0.2s;
}

footer a:hover {
    color: var(--gold-light);
}

/* ===== Responsive Design ===== */
@media (max-width: 1200px) {
    .price-grid {
        grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    }

    header h1 {
        font-size: 2.5rem;
    }

    .lang-switcher {
        right: 20px;
        top: 15px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header {
        padding: 30px 20px;
    }

    header h1 {
        font-size: 2rem;
    }

    main {
        padding: 20px 15px;
    }

    .price-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    nav {
        flex-direction: column;
        gap: 10px;
    }

    nav a {
        width: 100%;
        text-align: center;
    }

    .lang-switcher {
        position: relative;
        top: 0;
        right: 0;
        margin: 15px auto 0;
        justify-content: center;
    }

    table {
        font-size: 0.9rem;
    }

    th, td {
        padding: 10px 8px;
    }

    .badge-stock {
        font-size: 0.75rem;
    }

    /* Responsive table - show scroll hint via info note */
    .table-wrapper {
        border-left: 3px solid var(--bronze-dark);
        border-right: 3px solid var(--bronze-dark);
    }

    .info-note::before {
        content: '👆 Swipe table horizontally to see all columns';
        display: block;
        font-size: 0.85rem;
        color: var(--gold-light);
        margin-bottom: 8px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.6rem;
    }

    header .subtitle {
        font-size: 0.95rem;
    }

    table {
        font-size: 0.85rem;
    }

    th, td {
        padding: 8px 5px;
    }

    td.rank {
        width: 50px;
        font-size: 0.95rem;
    }

    td.price {
        font-size: 1rem;
    }

    tr.best-price td.price {
        font-size: 1.1rem;
    }

    /* Adjust price columns but keep them visible */
    .price-table .col-price {
        width: 85px;
        font-size: 0.85rem;
    }

    .badge-gold {
        font-size: 0.8rem;
        padding: 3px 8px;
    }
}

/* ===============================================
   HISTORY PAGE - CHARTS & STATS
   =============================================== */

.history-page {
    padding: 40px 20px;
    min-height: calc(100vh - 200px);
}

.page-header {
    text-align: center;
    margin-bottom: 40px;
}

.page-header h1 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--gold-primary);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8),
                 0 0 20px rgba(212, 175, 55, 0.3);
    margin-bottom: 10px;
}

.page-header .subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-family: var(--font-body);
}

/* Chart Filters */
.chart-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: center;
    margin-bottom: 30px;
    padding: 25px;
    background: var(--bg-card);
    border-radius: 12px;
    border: 2px solid var(--bronze-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-group label {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    color: var(--gold-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-group {
    display: flex;
    gap: 5px;
}

.filter-btn {
    padding: 10px 20px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 2px solid var(--bronze-dark);
    border-radius: 6px;
    text-decoration: none;
    font-family: var(--font-ui);
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    cursor: pointer;
    white-space: nowrap;
}

.filter-btn:hover {
    background: var(--bg-hover);
    color: var(--gold-light);
    border-color: var(--gold-primary);
    transform: translateY(-1px);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--gold-dark), var(--gold-primary));
    color: var(--bg-primary);
    border-color: var(--gold-light);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.6),
                inset 0 2px 4px rgba(255, 255, 255, 0.2);
    font-weight: 700;
}

/* Chart Card */
.chart-card {
    background: var(--bg-card);
    border: 3px solid var(--gold-dark);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5),
                0 0 40px rgba(212, 175, 55, 0.1);
}

#price-chart {
    min-height: 500px;
}

.no-data-message {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-secondary);
}

.no-data-message p {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.no-data-message .text-muted {
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* Stats Card */
.stats-card {
    background: var(--bg-card);
    border: 3px solid var(--bronze-primary);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.stats-card h2 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: var(--gold-primary);
    margin-bottom: 20px;
    text-align: center;
}

.stats-table {
    overflow-x: auto;
}

.stats-table table {
    width: 100%;
    border-collapse: collapse;
}

.stats-table thead {
    background: linear-gradient(135deg, var(--bronze-dark), var(--bronze-primary));
}

.stats-table th {
    padding: 15px 10px;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    color: var(--bg-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: left;
}

.stats-table tbody tr {
    border-bottom: 1px solid var(--bg-hover);
    transition: background 0.2s ease;
}

.stats-table tbody tr:hover {
    background: var(--bg-hover);
}

.stats-table td {
    padding: 12px 10px;
    font-family: var(--font-ui);
    color: var(--text-primary);
}

.seller-cell {
    font-weight: 600;
    color: var(--gold-light);
}

.price-cell {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.price-cell.avg-price {
    color: var(--gold-primary);
    font-weight: 600;
}

.count-cell {
    font-family: var(--font-mono);
    color: var(--text-muted);
    text-align: right;
}

/* Responsive Charts */
@media (max-width: 768px) {
    .history-page {
        padding: 20px 10px;
    }

    .page-header h1 {
        font-size: 1.8rem;
    }

    .chart-filters {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
    }

    .filter-group {
        width: 100%;
    }

    .btn-group {
        flex-wrap: wrap;
        justify-content: center;
    }

    .filter-btn {
        padding: 8px 15px;
        font-size: 0.85rem;
    }

    .chart-card, .stats-card {
        padding: 15px;
    }

    #price-chart {
        min-height: 350px;
    }

    .stats-table {
        font-size: 0.85rem;
    }

    .stats-table th,
    .stats-table td {
        padding: 10px 5px;
    }
}

@media (max-width: 480px) {
    .page-header h1 {
        font-size: 1.5rem;
    }

    .filter-btn {
        font-size: 0.8rem;
        padding: 6px 12px;
    }

    #price-chart {
        min-height: 300px;
    }
}

/* ===============================================
   CALCULATOR PAGE
   =============================================== */

.calculator-page {
    padding: 40px 20px;
    min-height: calc(100vh - 200px);
}

.calculator-card {
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 3px solid var(--gold-dark);
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5),
                0 0 40px rgba(212, 175, 55, 0.1);
}

.calc-section {
    margin-bottom: 35px;
}

.calc-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--gold-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

.amount-display {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    color: var(--gold-light);
    background: var(--bg-secondary);
    padding: 5px 15px;
    border-radius: 6px;
    border: 2px solid var(--bronze-primary);
}

/* Slider */
.slider-container {
    margin-bottom: 15px;
}

.gold-slider {
    width: 100%;
    height: 8px;
    background: linear-gradient(90deg, var(--bronze-dark), var(--gold-primary));
    border-radius: 5px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.gold-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: var(--gold-primary);
    border: 3px solid var(--gold-light);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
    transition: all 0.2s ease;
}

.gold-slider::-webkit-slider-thumb:hover {
    background: var(--gold-light);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.8);
    transform: scale(1.1);
}

.gold-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: var(--gold-primary);
    border: 3px solid var(--gold-light);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
    transition: all 0.2s ease;
}

.gold-slider::-moz-range-thumb:hover {
    background: var(--gold-light);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.8);
    transform: scale(1.1);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Input Group */
.input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.gold-input {
    flex: 1;
    padding: 12px 15px;
    font-family: var(--font-mono);
    font-size: 1.2rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--bronze-primary);
    border-radius: 6px;
    outline: none;
    transition: all 0.2s ease;
}

.gold-input:focus {
    border-color: var(--gold-primary);
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.3);
}

.input-unit {
    font-family: var(--font-ui);
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Game Selector */
.game-selector {
    display: flex;
    gap: 15px;
}

.game-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 3px solid var(--bronze-dark);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-heading);
}

.game-btn:hover {
    background: var(--bg-hover);
    border-color: var(--bronze-primary);
    transform: translateY(-2px);
}

.game-btn.active {
    background: linear-gradient(135deg, var(--bronze-primary), var(--gold-dark));
    border-color: var(--gold-primary);
    color: var(--text-primary);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.4),
                inset 0 2px 4px rgba(255, 255, 255, 0.1);
}

.game-icon {
    font-size: 2.5rem;
}

.game-name {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 1px;
}

/* Type Selector */
.type-selector {
    display: flex;
    gap: 10px;
}

.type-btn {
    flex: 1;
    padding: 12px 20px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 2px solid var(--bronze-dark);
    border-radius: 6px;
    font-family: var(--font-ui);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.type-btn:hover {
    background: var(--bg-hover);
    border-color: var(--bronze-primary);
}

.type-btn.active {
    background: var(--gold-primary);
    color: var(--bg-primary);
    border-color: var(--gold-light);
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.5);
}

/* Results */
.calc-results {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid var(--bronze-primary);
}

.loading-message,
.no-results {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 1.1rem;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.result-item {
    position: relative;
    padding: 20px;
    background: var(--bg-secondary);
    border: 2px solid var(--bronze-dark);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.result-item:hover {
    background: var(--bg-hover);
    border-color: var(--bronze-primary);
    transform: translateX(5px);
}

.result-item.best-deal {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.15), rgba(205, 127, 50, 0.1));
    border: 3px solid var(--gold-primary);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.3),
                inset 0 0 30px rgba(212, 175, 55, 0.05);
}

.best-badge {
    position: absolute;
    top: -12px;
    left: 20px;
    padding: 5px 15px;
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-light));
    color: var(--bg-primary);
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    letter-spacing: 1px;
}

.result-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
}

.result-rank {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--gold-primary);
    font-weight: 700;
}

.result-seller {
    font-family: var(--font-ui);
    font-size: 1.2rem;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.result-seller:hover {
    color: var(--gold-light);
}

.result-breakdown {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    font-size: 1rem;
}

.breakdown-label {
    color: var(--gold-light);
    font-weight: 600;
}

.breakdown-multiply {
    color: var(--bronze-primary);
    font-size: 1.2rem;
}

.breakdown-amount {
    color: var(--text-primary);
    font-weight: 600;
}

.result-total {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
}

.total-label {
    font-family: var(--font-ui);
    font-size: 1rem;
    color: var(--text-secondary);
}

.total-price {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    color: var(--gold-primary);
    font-weight: 700;
}

.result-item.best-deal .total-price {
    font-size: 1.8rem;
    color: var(--gold-light);
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.result-savings {
    margin-top: 8px;
    padding: 5px 10px;
    background: rgba(139, 69, 19, 0.3);
    border-radius: 4px;
    font-family: var(--font-ui);
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
}

/* Calculator Info Box */
.calc-info-box {
    max-width: 800px;
    margin: 20px auto 0;
    padding: 15px 20px;
    background: var(--bg-card);
    border: 2px solid var(--bronze-dark);
    border-radius: 8px;
    text-align: center;
}

.calc-info-box p {
    margin: 0;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* Responsive Calculator */
@media (max-width: 768px) {
    .calculator-page {
        padding: 20px 10px;
    }

    .calculator-card {
        padding: 25px 20px;
    }

    .calc-label {
        font-size: 0.95rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .amount-display {
        font-size: 1.3rem;
    }

    .game-selector {
        flex-direction: column;
    }

    .game-btn {
        flex-direction: row;
        justify-content: center;
        padding: 15px;
    }

    .game-icon {
        font-size: 2rem;
    }

    .game-name {
        font-size: 1.1rem;
    }

    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .result-rank {
        font-size: 1.2rem;
    }

    .result-seller {
        font-size: 1.1rem;
    }

    .total-price {
        font-size: 1.3rem;
    }

    .result-item.best-deal .total-price {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .calculator-card {
        padding: 20px 15px;
    }

    .gold-input {
        font-size: 1rem;
    }

    .result-breakdown {
        flex-wrap: wrap;
        font-size: 0.9rem;
    }
}

/* ===============================================
   DASHBOARD / HOME PAGE
   =============================================== */

.dashboard-hero {
    text-align: center;
    padding: 40px 20px;
    margin-bottom: 40px;
}

.dashboard-hero h2 {
    font-size: 2.5rem;
    font-family: var(--font-heading);
    color: var(--gold-primary);
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-text {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 50px;
}

.dashboard-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    border: 3px solid var(--bronze-dark);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s ease;
    overflow: hidden;
}

.dashboard-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--gold-dark), var(--gold-primary), var(--gold-light));
    opacity: 0;
    transition: opacity 0.3s;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    border-color: var(--gold-primary);
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.3);
}

.dashboard-card:hover::before {
    opacity: 1;
}

.card-icon {
    font-size: 3.5rem;
    margin-bottom: 15px;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}

.dashboard-card h3 {
    font-size: 1.4rem;
    font-family: var(--font-heading);
    color: var(--gold-light);
    margin-bottom: 8px;
}

.dashboard-card p {
    font-size: 1rem;
    color: var(--text-secondary);
}

.card-badge {
    position: absolute;
    top: 15px;
    right: -30px;
    padding: 5px 35px;
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-light));
    color: var(--bg-primary);
    font-size: 0.75rem;
    font-weight: 700;
    transform: rotate(45deg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    letter-spacing: 1px;
}

.dashboard-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
    margin: 50px 0;
}

.feature-item {
    text-align: center;
    padding: 30px 20px;
    background: var(--bg-secondary);
    border: 2px solid var(--bronze-dark);
    border-radius: 10px;
    transition: all 0.3s;
}

.feature-item:hover {
    border-color: var(--bronze-primary);
    transform: scale(1.05);
}

.feature-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 15px;
}

.feature-item h4 {
    font-family: var(--font-heading);
    color: var(--bronze-light);
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.feature-item p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.page-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 20px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), rgba(205, 127, 50, 0.05));
    border-radius: 12px;
}

.page-header h2 {
    font-size: 2.2rem;
    font-family: var(--font-heading);
    color: var(--gold-primary);
    margin-bottom: 10px;
}

.page-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.info-note {
    margin-top: 30px;
    padding: 20px;
    background: var(--bg-secondary);
    border-left: 5px solid var(--gold-dark);
    border-radius: 8px;
}

.info-note p {
    margin: 8px 0;
    color: var(--text-secondary);
}

.last-update {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Mobile responsiveness for dashboard */
@media (max-width: 768px) {
    .dashboard-hero h2 {
        font-size: 2rem;
    }

    .hero-text {
        font-size: 1rem;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .dashboard-card {
        padding: 30px 15px;
    }

    .dashboard-features {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .page-header h2 {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .card-icon {
        font-size: 2.5rem;
    }

    .dashboard-card h3 {
        font-size: 1.2rem;
    }

    .card-badge {
        font-size: 0.65rem;
        padding: 4px 30px;
    }
}

/* ========================================
   Eldorado Price Table
   ======================================== */
.eldorado-section {
    margin-top: 2.5rem;
}

.eldorado-section h2 {
    color: var(--gold-primary);
    font-family: var(--font-heading);
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    color: var(--text-muted, #c0a880);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.eldorado-table .col-stock,
.eldorado-table .col-minqty {
    min-width: 80px;
}

.eldorado-table .col-reviews {
    min-width: 90px;
    white-space: nowrap;
}

.eldorado-table td.stock,
.eldorado-table td.minqty {
    color: var(--text-secondary, #d4c4a0);
    font-size: 0.9rem;
}

.eldorado-table td.rating {
    color: var(--gold-light, #f7c600);
    font-weight: 600;
}

.eldorado-table td.reviews {
    color: var(--text-secondary, #d4c4a0);
    font-size: 0.9rem;
}

.eldorado-btn {
    background: linear-gradient(135deg, #7C3F00, #B8860B) !important;
    border-color: #B8860B !important;
    font-size: 0.8rem !important;
}

.eldorado-btn:hover {
    background: linear-gradient(135deg, #9a4f00, #D4AF37) !important;
}

/* Source badge for unified table */
.source-badge {
    display: inline-block;
    font-size: 0.68rem;
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: 5px;
    vertical-align: middle;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.eldorado-badge {
    background: linear-gradient(135deg, #7C3F00, #B8860B);
    color: #fff;
    border: 1px solid #B8860B;
}

/* Rating + review count in unified table */
.rating-info {
    color: var(--gold-light, #f7c600);
    font-size: 0.88rem;
    white-space: nowrap;
}
