/**
 * SmartCMS FX & Gold Rates - Frontend Styles
 * Modern, clean, minimal design
 * Version: 2.3.0
 */

/* Reset and Base */
.smartcms-fx-table-wrapper,
.smartcms-gold-table-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    margin: 0 auto 20px;
    max-width: 500px;
    padding: 0 15px;
}

/* Table Title */
.smartcms-table-title {
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    color: #fb0304;
    margin: 0 0 12px;
    padding: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Table Styles */
.smartcms-fx-table,
.smartcms-gold-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.smartcms-fx-table thead,
.smartcms-gold-table thead {
    background: linear-gradient(135deg, #1e3a5f 0%, #2c5282 100%);
}

.smartcms-fx-table th,
.smartcms-gold-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
}

.smartcms-fx-table th:last-child,
.smartcms-gold-table th:last-child {
    text-align: right;
}

.smartcms-fx-table th:nth-child(2),
.smartcms-gold-table th:nth-child(2) {
    text-align: right;
}

.smartcms-fx-table tbody tr,
.smartcms-gold-table tbody tr {
    border-bottom: 1px solid #edf2f7;
    transition: background-color 0.15s ease;
}

.smartcms-fx-table tbody tr:last-child,
.smartcms-gold-table tbody tr:last-child {
    border-bottom: none;
}

.smartcms-fx-table tbody tr:hover,
.smartcms-gold-table tbody tr:hover {
    background-color: #f7fafc;
}

.smartcms-fx-table td,
.smartcms-gold-table td {
    padding: 12px 16px;
    border: none;
    vertical-align: middle;
}

/* Currency/Gold Code */
.smartcms-fx-table .currency-code,
.smartcms-gold-table .gold-name {
    font-weight: 600;
    color: #2d3748;
}

/* Price columns - align right */
.smartcms-fx-table .rate-buy,
.smartcms-fx-table .rate-sell,
.smartcms-gold-table .gold-buy,
.smartcms-gold-table .gold-sell {
    text-align: right;
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    font-size: 14px;
    font-weight: 500;
    color: #1a202c;
}

/* Footer */
.smartcms-fx-table-footer,
.smartcms-gold-table-footer {
    padding: 10px 16px;
    background: #f8fafc;
    border-top: 1px solid #edf2f7;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #718096;
    border-radius: 0 0 8px 8px;
}

.smartcms-fx-updated,
.smartcms-gold-updated {
    color: #4a5568;
}

.smartcms-fx-source,
.smartcms-gold-source {
    font-style: italic;
    color: #a0aec0;
}

/* No Data Message */
.smartcms-fx-no-data,
.smartcms-gold-no-data {
    padding: 20px;
    text-align: center;
    color: #718096;
    background: #f7fafc;
    border-radius: 8px;
    border: 1px dashed #cbd5e0;
}

/* Animation */
.smartcms-fx-table,
.smartcms-gold-table {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.smartcms-fx-table.animated,
.smartcms-gold-table.animated,
.smartcms-fx-table-wrapper .smartcms-fx-table,
.smartcms-gold-table-wrapper .smartcms-gold-table {
    opacity: 1;
    transform: translateY(0);
}

/* Ticker Styles */
.smartcms-fx-ticker {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #1e3a5f 0%, #2c5282 100%);
    border-radius: 8px;
    font-size: 13px;
}

.smartcms-fx-ticker .ticker-item {
    color: #fff;
    white-space: nowrap;
}

.smartcms-fx-ticker .ticker-item strong {
    margin-right: 4px;
}

.smartcms-fx-ticker .ticker-item .change {
    font-size: 11px;
    opacity: 0.8;
}

.smartcms-fx-ticker .ticker-item.positive .change {
    color: #68d391;
}

.smartcms-fx-ticker .ticker-item.negative .change {
    color: #fc8181;
}

/* Widget Styles */
.smartcms-fx-gold-widget {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.smartcms-fx-widget-list,
.smartcms-gold-widget-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.smartcms-fx-widget-item,
.smartcms-gold-widget-item {
    display: flex;
    flex-direction: column;
    padding: 10px 12px;
    background: #f8fafc;
    border-radius: 6px;
    border-left: 3px solid #cbd5e0;
    transition: border-color 0.2s ease;
}

.smartcms-fx-widget-item.positive {
    border-left-color: #48bb78;
}

.smartcms-fx-widget-item.negative {
    border-left-color: #f56565;
}

.smartcms-fx-widget-item .widget-item-header,
.smartcms-gold-widget-item .widget-item-name {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.smartcms-fx-widget-item .currency-code {
    font-weight: 600;
    color: #2d3748;
}

.smartcms-fx-widget-item .currency-rate {
    font-family: 'SF Mono', Monaco, monospace;
    font-weight: 500;
    color: #1a202c;
}

.smartcms-fx-widget-item .widget-item-change {
    font-size: 11px;
    margin-top: 4px;
}

.smartcms-fx-widget-item .widget-item-change.positive {
    color: #38a169;
}

.smartcms-fx-widget-item .widget-item-change.negative {
    color: #e53e3e;
}

.smartcms-gold-widget-item .widget-item-name strong {
    color: #2d3748;
    font-size: 13px;
}

.smartcms-gold-widget-item .widget-item-prices {
    display: flex;
    gap: 12px;
    margin-top: 6px;
    font-size: 12px;
}

.smartcms-gold-widget-item .gold-buy,
.smartcms-gold-widget-item .gold-sell {
    color: #4a5568;
}

.smartcms-widget-footer {
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid #e2e8f0;
}

.smartcms-widget-footer small {
    font-size: 10px;
    color: #a0aec0;
}

.smartcms-widget-section {
    margin-bottom: 16px;
}

.smartcms-widget-section-title {
    font-size: 13px;
    font-weight: 600;
    color: #2d3748;
    margin: 0 0 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid #3182ce;
}

/* Responsive */
@media (max-width: 600px) {
    .smartcms-fx-table th,
    .smartcms-fx-table td,
    .smartcms-gold-table th,
    .smartcms-gold-table td {
        padding: 10px 12px;
        font-size: 13px;
    }

    .smartcms-fx-table-footer,
    .smartcms-gold-table-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .smartcms-fx-ticker {
        flex-direction: column;
        gap: 8px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .smartcms-fx-table,
    .smartcms-gold-table {
        background: #1a202c;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    }

    .smartcms-fx-table tbody tr,
    .smartcms-gold-table tbody tr {
        border-bottom-color: #2d3748;
    }

    .smartcms-fx-table tbody tr:hover,
    .smartcms-gold-table tbody tr:hover {
        background-color: #2d3748;
    }

    .smartcms-fx-table td,
    .smartcms-gold-table td,
    .smartcms-fx-table .currency-code,
    .smartcms-gold-table .gold-name,
    .smartcms-fx-table .rate-buy,
    .smartcms-fx-table .rate-sell,
    .smartcms-gold-table .gold-buy,
    .smartcms-gold-table .gold-sell {
        color: #e2e8f0;
    }

    .smartcms-fx-table-footer,
    .smartcms-gold-table-footer {
        background: #2d3748;
        border-top-color: #4a5568;
    }

    .smartcms-fx-updated,
    .smartcms-gold-updated {
        color: #a0aec0;
    }
}

/* Print styles */
@media print {
    .smartcms-fx-table-wrapper,
    .smartcms-gold-table-wrapper {
        box-shadow: none;
    }

    .smartcms-fx-table,
    .smartcms-gold-table {
        box-shadow: none;
    }

    .smartcms-fx-table thead,
    .smartcms-gold-table thead {
        background: #333 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
