/**
 * NRB Currency Rates - Public Stylesheet
 * Author: ProTech Nepal (https://protechnepal.com.np)
 */

.nrb-currency-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    margin: 10px 0;
    max-width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.nrb-currency-title {
    color: #0f172a;
    font-size: 0.96em;
    font-weight: 600;
    margin: 0;
    padding: 8px 12px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nrb-currency-title .nrb-icon {
    font-size: 1em;
}

.nrb-currency-content {
    position: relative;
}

.nrb-currency-table-wrapper {
    overflow-x: auto;
    margin: 0;
    -webkit-overflow-scrolling: touch;
}

.nrb-currency-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    background: #ffffff;
    font-size: 0.8em;
}

.nrb-currency-table thead {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.nrb-currency-table th {
    padding: 6px 8px;
    text-align: left;
    font-weight: 600;
    font-size: 0.74em;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s ease;
    white-space: nowrap;
}

.nrb-currency-table th:hover {
    background: #f1f5f9;
}

.nrb-currency-table th:nth-child(2),
.nrb-currency-table th:nth-child(3),
.nrb-currency-table th:nth-child(4) {
    text-align: right;
}

.nrb-currency-table th.sortable::after {
    content: " ↕";
    font-size: 0.75em;
    margin-left: 2px;
    opacity: 0.35;
}

.nrb-currency-table th.sort-asc::after {
    content: " ▲";
    color: #2563eb;
    opacity: 1;
}

.nrb-currency-table th.sort-desc::after {
    content: " ▼";
    color: #2563eb;
    opacity: 1;
}

.nrb-currency-table td {
    padding: 6px 8px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    transition: background-color 0.15s ease;
}

.nrb-currency-table tbody tr:hover {
    background-color: #f8fafc;
}

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

.nrb-currency-name {
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.2;
}

.currency-flag {
    width: 17px;
    height: 12px;
    border-radius: 1px;
    display: inline-block;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    box-shadow: 0 0 1px rgba(0, 0, 0, 0.3);
}

.nrb-curr-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.15;
}

.nrb-curr-code {
    font-size: 0.85em;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: 0.01em;
}

.nrb-curr-fullname {
    font-size: 0.7em;
    font-weight: 400;
    color: #64748b;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Flag CSS definitions */
.flag-usd {
    background: linear-gradient(to bottom, #002868 33%, #fff 33%, #fff 66%, #bf0a30 66%);
    position: relative;
}

.flag-usd::after {
    content: "★";
    color: #fff;
    font-size: 6px;
    position: absolute;
    top: 15%;
    left: 15%;
    line-height: 1;
}

.flag-eur {
    background: #003399;
    position: relative;
}

.flag-eur::after {
    content: "★★★★";
    color: #ffcc00;
    font-size: 3px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    letter-spacing: 1px;
}

.flag-gbp {
    background: linear-gradient(45deg, #012169 25%, #fff 25%, #fff 50%, #ce1126 50%, #ce1126 75%, #fff 75%);
}

.flag-jpy {
    background: #fff;
    position: relative;
    border: 1px solid #ddd;
}

.flag-jpy::after {
    content: "●";
    color: #bc002d;
    font-size: 8px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    line-height: 1;
}

.flag-cny {
    background: #de2910;
    position: relative;
}

.flag-cny::after {
    content: "★";
    color: #ffde00;
    font-size: 6px;
    position: absolute;
    top: 15%;
    left: 15%;
    line-height: 1;
}

.flag-inr {
    background: linear-gradient(to bottom, #ff9933 33%, #fff 33%, #fff 66%, #138808 66%);
    position: relative;
}

.flag-inr::after {
    content: "☸";
    color: #000080;
    font-size: 7px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    line-height: 1;
}

.flag-chf {
    background: #ff0000;
    position: relative;
}

.flag-chf::after {
    content: "+";
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    line-height: 1;
}

.flag-aud {
    background: linear-gradient(45deg, #012169 50%, #fff 25%, #ff0000 25%);
    position: relative;
}

.flag-aud::after {
    content: "★";
    color: #fff;
    font-size: 4px;
    position: absolute;
    top: 20%;
    right: 20%;
}

.flag-cad {
    background: linear-gradient(to right, #ff0000 25%, #fff 25%, #fff 75%, #ff0000 75%);
    position: relative;
}

.flag-cad::after {
    content: "🍁";
    font-size: 8px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    line-height: 1;
}

.flag-sgd {
    background: linear-gradient(to bottom, #fff 50%, #ed2939 50%);
    position: relative;
}

.flag-sgd::after {
    content: "☪";
    color: #fff;
    font-size: 6px;
    position: absolute;
    top: 15%;
    left: 15%;
}

.flag-sar {
    background: #006c35;
    position: relative;
}

.flag-sar::after {
    content: "⚔";
    color: #fff;
    font-size: 8px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    line-height: 1;
}

.flag-qar {
    background: #8d1b3d;
    position: relative;
}

.flag-qar::after {
    content: "◆◆◆";
    color: #fff;
    font-size: 3px;
    position: absolute;
    top: 50%;
    left: 20%;
    transform: translateY(-50%);
}

.flag-aed {
    background: linear-gradient(to bottom, #00732f 33%, #fff 33%, #fff 66%, #000 66%);
    position: relative;
}

.flag-aed::after {
    content: "▮";
    color: #ff0000;
    font-size: 12px;
    position: absolute;
    top: 50%;
    left: 10%;
    transform: translateY(-50%);
    line-height: 1;
}

.flag-thb {
    background: linear-gradient(to bottom, #ed1c24 20%, #fff 20%, #fff 40%, #241d4f 40%, #241d4f 60%, #fff 60%, #fff 80%, #ed1c24 80%);
}

.flag-myr {
    background: linear-gradient(to bottom, #cc0001 50%, #fff 50%);
    position: relative;
}

.flag-myr::after {
    content: "☪";
    color: #ffd100;
    font-size: 5px;
    position: absolute;
    top: 15%;
    left: 15%;
}

.flag-krw {
    background: #ffffff;
    border: 1px solid #ddd;
    position: relative;
}

.flag-krw::after {
    content: "☯";
    color: #cd2e3a;
    font-size: 8px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    line-height: 1;
}

.flag-sek {
    background: linear-gradient(to right, #006aa7 40%, #fecc00 20%, #006aa7 40%);
    position: relative;
}

.flag-sek::after {
    content: "+";
    color: #fecc00;
    font-size: 9px;
    font-weight: bold;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    line-height: 1;
}

.flag-dkk {
    background: #c8102e;
    position: relative;
}

.flag-dkk::after {
    content: "+";
    color: #fff;
    font-size: 9px;
    font-weight: bold;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    line-height: 1;
}

.flag-hkd {
    background: #de2910;
    position: relative;
}

.flag-hkd::after {
    content: "✿";
    color: #fff;
    font-size: 8px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    line-height: 1;
}

.flag-kwd {
    background: linear-gradient(to bottom, #007a3d 33%, #fff 33%, #fff 66%, #ce1126 66%);
    position: relative;
}

.flag-bhd {
    background: linear-gradient(to right, #ce1126 30%, #fff 30%);
    position: relative;
}

.flag-omr {
    background: linear-gradient(to bottom, #fff 33%, #ff0000 33%, #ff0000 66%, #00ff00 66%);
    position: relative;
}

.flag-nok {
    background: #ef2b2d;
    position: relative;
}

.flag-nok::after {
    content: "+";
    color: #fff;
    font-size: 9px;
    font-weight: bold;
    position: absolute;
    top: 50%;
    left: 40%;
    transform: translateY(-50%);
    line-height: 1;
}

.flag-nzd {
    background: #012169;
    position: relative;
}

.flag-nzd::after {
    content: "★★";
    color: #fff;
    font-size: 3px;
    position: absolute;
    top: 40%;
    right: 20%;
}

.flag-default {
    background: #e2e8f0;
    position: relative;
}

.flag-default::after {
    content: "🏳";
    font-size: 7px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    line-height: 1;
}

.nrb-currency-unit {
    color: #64748b;
    text-align: right;
    font-weight: 500;
    font-size: 0.8em;
    padding-right: 4px;
}

.nrb-currency-buy,
.nrb-currency-sell {
    font-weight: 600;
    text-align: right;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, monospace;
    font-size: 0.82em;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.nrb-currency-buy {
    color: #15803d;
}

.nrb-currency-sell {
    color: #b91c1c;
}

.nrb-currency-source {
    text-align: center;
    font-size: 0.72em;
    color: #64748b;
    padding: 6px 10px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.nrb-currency-source a {
    color: #2563eb;
    text-decoration: none;
}

.nrb-currency-source a:hover {
    text-decoration: underline;
}

.nrb-currency-notice {
    background: #fefce8;
    color: #854d0e;
    border-bottom: 1px solid #fef08a;
    padding: 5px 10px;
    font-size: 0.72em;
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.25;
}

.nrb-currency-error {
    text-align: center;
    padding: 12px;
    background: #fff1f2;
    color: #9f1239;
    font-size: 0.82em;
    border: 1px solid #fecdd3;
    border-radius: 6px;
    margin: 8px 0;
}

/* Responsive tweaks for mobile & narrow sidebars */
@media (max-width: 768px) {

    .nrb-currency-table th,
    .nrb-currency-table td {
        padding: 5px 6px;
        font-size: 0.78em;
    }

    .nrb-currency-title {
        font-size: 0.9em;
        padding: 7px 10px;
    }

    .currency-flag {
        width: 16px;
        height: 11px;
    }

    .nrb-curr-fullname {
        max-width: 75px;
    }
}

@media (max-width: 480px) {

    .nrb-currency-table th,
    .nrb-currency-table td {
        padding: 4px 5px;
        font-size: 0.75em;
    }

    .currency-flag {
        width: 14px;
        height: 10px;
    }

    .nrb-curr-fullname {
        max-width: 60px;
        font-size: 0.68em;
    }
}