/* ============================================
   Gold Price Tracker - Dark Premium Theme
   ============================================ */

/* ----- Base Container ----- */
.gpt-container.gpt-dark-theme {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', sans-serif;
    max-width: 100%;
    padding: 20px;
    box-sizing: border-box;
    background: #0f0f0f;
    color: #ffffff;
}

/* ----- Typography ----- */
.gpt-container.gpt-dark-theme .gpt-heading {
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    margin: 25px 0 15px 0;
    letter-spacing: 0.5px;
}

.gpt-container.gpt-dark-theme .gpt-section {
    margin-bottom: 30px;
}

/* ----- Dropdown ----- */
.gpt-dropdown-wrapper {
    margin: 0 0 20px 0;
    width: 100%;
}

.gpt-select {
    width: 100%;
    max-width: 320px;
    padding: 12px 16px;
    font-size: 14px;
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    background: #181818;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23bdbdbd' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

.gpt-select:hover {
    border-color: #3a3a3a;
}

.gpt-select:focus {
    outline: none;
    border-color: #f9a825;
    box-shadow: 0 0 0 3px rgba(249, 168, 37, 0.15);
}

.gpt-select option {
    background: #181818;
    color: #ffffff;
}

/* ----- Cards Grid ----- */
.gpt-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 25px;
}

/* ----- Individual Card ----- */
.gpt-card {
    background: #181818;
    border: 1px solid #2a2a2a;
    border-radius: 16px;
    padding: 20px 22px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 140px;
}

.gpt-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #f9a825;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gpt-card:hover {
    transform: translateY(-4px);
    border-color: #3a3a3a;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

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

/* Card Header */
.gpt-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.gpt-card-purity {
    font-size: 18px;
    font-weight: 700;
    color: #f9a825;
    letter-spacing: 0.5px;
}

.gpt-card-subtitle {
    font-size: 12px;
    color: #888;
    font-weight: 400;
}

/* Card Price */
.gpt-card-price {
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
    margin: 8px 0 10px 0;
    letter-spacing: 0.5px;
}

.gpt-card-price span {
    font-size: 28px;
}

/* Card Change */
.gpt-card-change {
    font-size: 14px;
    font-weight: 500;
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gpt-card-change .gpt-up-arrow {
    color: #00c853;
}

.gpt-card-change .gpt-down-arrow {
    color: #ff1744;
}

.gpt-card-change .gpt-percent-change {
    font-size: 13px;
    opacity: 0.8;
}

/* Card Color Variants */
.gpt-card.gpt-up {
    border-left: 3px solid #00c853;
}

.gpt-card.gpt-down {
    border-left: 3px solid #ff1744;
}

/* ----- Calculator Section ----- */
.gpt-calculator-wrapper {
    background: #181818;
    border: 1px solid #2a2a2a;
    border-radius: 16px;
    padding: 24px 28px;
    margin-bottom: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.gpt-calculator-title {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 20px 0;
    letter-spacing: 0.5px;
}

.gpt-calculator-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.gpt-calc-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gpt-calc-label {
    font-size: 13px;
    font-weight: 500;
    color: #bdbdbd;
    letter-spacing: 0.3px;
}

.gpt-calc-group .gpt-select,
.gpt-input {
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    background: #0f0f0f;
    color: #ffffff;
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

.gpt-input {
    -moz-appearance: textfield;
}

.gpt-input::-webkit-outer-spin-button,
.gpt-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.gpt-calc-group .gpt-select:focus,
.gpt-input:focus {
    outline: none;
    border-color: #f9a825;
    box-shadow: 0 0 0 3px rgba(249, 168, 37, 0.12);
}

/* Calculator Results */
.gpt-calc-results {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding-top: 20px;
    border-top: 1px solid #2a2a2a;
}

.gpt-calc-result-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gpt-calc-result-label {
    font-size: 12px;
    color: #888;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gpt-calc-result-value {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
}

.gpt-calc-total .gpt-calc-result-value {
    color: #f9a825;
    font-size: 24px;
}

.gpt-calc-total {
    border-left: 2px solid #f9a825;
    padding-left: 16px;
}

/* ----- Trend Description ----- */
.gpt-trend-description {
    margin: 0 0 25px 0;
    padding: 16px 20px;
    background: #181818;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.gpt-trend-text,
.gpt-trend-text-full {
    font-size: 15px;
    font-weight: 400;
    line-height: 1.7;
    color: #e0e0e0;
    margin: 0;
}

.gpt-read-more {
    font-size: 14px;
    color: #f9a825;
    text-decoration: none;
    cursor: pointer;
    display: inline-block;
    margin-top: 6px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.gpt-read-more:hover {
    color: #ffc107;
    text-decoration: underline;
}

/* ----- Tables ----- */
.gpt-table-wrapper {
    overflow-x: auto;
    margin-bottom: 20px;
    border-radius: 12px;
    border: 1px solid #2a2a2a;
    background: #181818;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.gpt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 500px;
}

.gpt-table thead th {
    background: #0f0f0f;
    color: #bdbdbd;
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #2a2a2a;
    position: sticky;
    top: 0;
    z-index: 10;
}

.gpt-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid #222;
    color: #e0e0e0;
    font-weight: 400;
}

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

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

/* Purity Badge in Table */
.gpt-purity-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(249, 168, 37, 0.15);
    color: #f9a825;
}

/* Change Indicators */
.gpt-up-arrow {
    color: #00c853;
    font-weight: 600;
}

.gpt-down-arrow {
    color: #ff1744;
    font-weight: 600;
}

.gpt-change-cell .gpt-up-arrow,
.gpt-change-cell .gpt-down-arrow {
    font-weight: 600;
}

.gpt-percent-change-cell .gpt-up-arrow,
.gpt-percent-change-cell .gpt-down-arrow {
    font-weight: 600;
}

/* ----- Show More Button ----- */
.gpt-show-more-btn {
    display: block;
    margin: 16px auto 8px auto;
    padding: 10px 32px;
    background: transparent;
    color: #f9a825;
    border: 1px solid #f9a825;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    font-family: inherit;
}

.gpt-show-more-btn:hover {
    background: #f9a825;
    color: #0f0f0f;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(249, 168, 37, 0.3);
}

/* ----- City Links in Table ----- */
.gpt-table a {
    color: #f9a825;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.gpt-table a:hover {
    color: #ffc107;
    text-decoration: underline;
}

/* ----- Cities Table (Single Column) ----- */
.gpt-cities-table thead th {
    background: #0f0f0f;
    color: #f9a825;
    font-size: 15px;
    text-align: center;
}

.gpt-cities-table tbody td {
    text-align: center;
    padding: 14px 16px;
}

.gpt-cities-table .city-link {
    color: #f9a825;
    text-decoration: none;
    font-weight: 500;
    display: inline-block;
    padding: 6px 0;
    transition: all 0.3s ease;
}

.gpt-cities-table .city-link:hover {
    color: #ffc107;
    transform: translateX(4px);
}

/* ----- Responsive Design ----- */

/* Tablet */
@media (max-width: 992px) {
    .gpt-cards-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

    .gpt-calculator-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gpt-calc-results {
        grid-template-columns: repeat(2, 1fr);
    }

    .gpt-calc-total {
        border-left: none;
        padding-left: 0;
        grid-column: span 2;
        border-top: 1px solid #2a2a2a;
        padding-top: 12px;
    }
}

/* Mobile */
@media (max-width: 640px) {
    .gpt-container.gpt-dark-theme {
        padding: 12px 0;
    }

    .gpt-cards-grid {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 8px;
        overflow-x: auto;
        padding: 4px 0 12px 0;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }

    .gpt-card {
        min-width: 140px;
        min-height: 120px;
        padding: 14px 16px;
        scroll-snap-align: start;
        flex-shrink: 0;
    }

    .gpt-card-purity {
        font-size: 15px;
    }

    .gpt-card-price {
        font-size: 20px;
    }

    .gpt-card-price span {
        font-size: 20px;
    }

    .gpt-card-change {
        font-size: 12px;
    }

    .gpt-card-subtitle {
        font-size: 10px;
    }

    .gpt-select {
        max-width: 100%;
        border-radius: 8px;
        padding: 10px 14px;
    }

    .gpt-calculator-wrapper {
        padding: 16px 14px;
        border-radius: 12px;
        margin: 0 0 16px 0;
    }

    .gpt-calculator-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .gpt-calc-results {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding-top: 14px;
    }

    .gpt-calc-result-value {
        font-size: 16px;
    }

    .gpt-calc-total .gpt-calc-result-value {
        font-size: 18px;
    }

    .gpt-calc-total {
        grid-column: span 2;
        border-left: none;
        padding-left: 0;
        border-top: 1px solid #2a2a2a;
        padding-top: 10px;
    }

    .gpt-calc-group .gpt-select,
    .gpt-input {
        padding: 8px 12px;
        font-size: 13px;
    }

    .gpt-trend-description {
        padding: 12px 14px;
        border-radius: 10px;
        margin: 0 0 16px 0;
    }

    .gpt-trend-text,
    .gpt-trend-text-full {
        font-size: 13px;
        line-height: 1.6;
    }

    .gpt-table-wrapper {
        border-radius: 10px;
        margin: 0 0 16px 0;
        border-left: none;
        border-right: none;
    }

    .gpt-table {
        font-size: 12px;
        min-width: 400px;
    }

    .gpt-table thead th {
        padding: 10px 12px;
        font-size: 11px;
    }

    .gpt-table tbody td {
        padding: 10px 12px;
    }

    .gpt-purity-badge {
        font-size: 10px;
        padding: 2px 10px;
    }

    .gpt-container.gpt-dark-theme .gpt-heading {
        font-size: 15px;
        margin: 18px 0 12px 0;
        padding: 0 4px;
    }

    .gpt-show-more-btn {
        padding: 8px 24px;
        font-size: 13px;
        width: 100%;
        max-width: 200px;
    }

    .gpt-dropdown-wrapper {
        padding: 0 4px;
    }

    .gpt-calculator-title {
        font-size: 16px;
    }

    .gpt-calc-label {
        font-size: 11px;
    }

    .gpt-calc-result-label {
        font-size: 10px;
    }

    /* Single Column Cities Table on Mobile */
    .gpt-cities-table thead th {
        font-size: 13px;
        padding: 12px;
    }

    .gpt-cities-table tbody td {
        padding: 12px;
    }
}

/* Small Mobile */
@media (max-width: 400px) {
    .gpt-cards-grid {
        gap: 6px;
    }

    .gpt-card {
        min-width: 120px;
        min-height: 100px;
        padding: 10px 12px;
    }

    .gpt-card-purity {
        font-size: 13px;
    }

    .gpt-card-price {
        font-size: 17px;
    }

    .gpt-card-price span {
        font-size: 17px;
    }

    .gpt-calculator-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .gpt-calc-results {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
}

/* ----- Scrollbar Styling ----- */
.gpt-table-wrapper::-webkit-scrollbar {
    height: 6px;
}

.gpt-table-wrapper::-webkit-scrollbar-track {
    background: #0f0f0f;
    border-radius: 3px;
}

.gpt-table-wrapper::-webkit-scrollbar-thumb {
    background: #2a2a2a;
    border-radius: 3px;
}

.gpt-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: #3a3a3a;
}

/* ----- Animation for Price Updates ----- */
@keyframes gpt-price-flash {
    0% { opacity: 1; }
    50% { opacity: 0.5; background: rgba(249, 168, 37, 0.1); }
    100% { opacity: 1; }
}

.gpt-price-updating {
    animation: gpt-price-flash 0.5s ease;
}

/* ----- Loading State for Cards ----- */
.gpt-card-loading {
    opacity: 0.6;
    pointer-events: none;
}

.gpt-card-loading .gpt-card-price {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gpt-card-loading .gpt-card-price::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #2a2a2a;
    border-top-color: #f9a825;
    border-radius: 50%;
    animation: gpt-spin 0.8s linear infinite;
}

@keyframes gpt-spin {
    to { transform: rotate(360deg); }
}

/* ----- Print Styles ----- */
@media print {
    .gpt-container.gpt-dark-theme {
        background: #ffffff;
        color: #000000;
        padding: 10px;
    }

    .gpt-card {
        background: #f5f5f5;
        border-color: #ddd;
        box-shadow: none;
    }

    .gpt-card-purity {
        color: #b8860b;
    }

    .gpt-card-price {
        color: #000000;
    }

    .gpt-table-wrapper {
        border-color: #ddd;
        background: #f5f5f5;
    }

    .gpt-table thead th {
        background: #e0e0e0;
        color: #000000;
        border-bottom-color: #ccc;
    }

    .gpt-table tbody td {
        color: #000000;
        border-bottom-color: #ddd;
    }

    .gpt-calculator-wrapper {
        background: #f5f5f5;
        border-color: #ddd;
    }

    .gpt-calculator-title {
        color: #000000;
    }

    .gpt-calc-label {
        color: #555;
    }

    .gpt-calc-group .gpt-select,
    .gpt-input {
        background: #ffffff;
        color: #000000;
        border-color: #ccc;
    }

    .gpt-calc-result-value {
        color: #000000;
    }

    .gpt-calc-total .gpt-calc-result-value {
        color: #b8860b;
    }

    .gpt-show-more-btn {
        display: none;
    }

    .gpt-trend-description {
        background: #f5f5f5;
        border-color: #ddd;
    }

    .gpt-trend-text,
    .gpt-trend-text-full {
        color: #000000;
    }

    .gpt-read-more {
        color: #b8860b;
    }

    .gpt-up-arrow {
        color: #2e7d32;
    }

    .gpt-down-arrow {
        color: #c62828;
    }

    .gpt-purity-badge {
        background: #e0e0e0;
        color: #b8860b;
    }

    .gpt-table a {
        color: #b8860b;
    }
}