/**
 * Currency Rates Grid Styles
 * Table-like layout with rows and columns
 */

/* ==========================================================================
   Grid Wrapper
   ========================================================================== */

.currency-rates-grid-wrapper {
    width: 100%;
    max-width: var(--pls-container-width);
    margin: 0 auto;
    padding: 0;
    direction: rtl;
}

/* ==========================================================================
   Main Container - 70/30 Split
   ========================================================================== */

.rates-main-container {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.rates-table-section {
    flex: 0 0 60%;
}

.currency-converter-section {
    flex: 0 0 calc(40% - 30px);
    position: sticky;
    top: 20px;
}

/* ==========================================================================
   Header Section
   ========================================================================== */

.rates-grid-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 0 20px;
    padding-bottom: 0;
    border-bottom: none;
}

.update-time {
    font-size: 14px;
    color: #666666;
    font-weight: 500;
}

.rates-refresh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 30px;
    background: white;
    font-size: 14px;
    font-weight: 700;
    color: #000000;
    border: 2px solid #1a1a1a;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.rates-refresh-btn:hover:not(:disabled) {
    background: #d5d5d5;
}

.rates-refresh-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f5f5f5;
    color: #999999;
}

.rates-refresh-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.refresh-icon {
    display: none;
}

/* ==========================================================================
   Table Layout
   ========================================================================== */

.currency-rates-table {
    background: #f8f7f7;
    border-radius: 0;
    overflow: hidden;
}

/* Table Header */
.rates-table-header {
    display: grid;
    grid-template-columns: 1.5fr 100px 200px 160px 120px;
    gap: 20px;
    padding: 16px 20px;
    background: #f8f7f7;
    border-bottom: 1px solid #e0e0e0;
    font-size: 14px;
    font-weight: 700;
    color: #000000;
    text-align: center;
}

.rates-section-title {
    margin: 24px 0 12px;
    font-size: 18px;
    font-weight: 700;
    color: #000000;
}

.metals-table .rates-table-header,
.metals-table .rates-table-row {
    grid-template-columns: 1.5fr 80px 160px 160px 120px 100px;
}

/* Metals table rate columns - header styling */
.rates-table-header .col-rate-usd,
.rates-table-header .col-rate-ils {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
}

/* Hide mobile unit label on desktop */
.mobile-unit-label {
    display: none;
}

/* Mobile metals section header - hide on desktop */
.metals-section-header {
    display: none;
}

/* Desktop metals title - show on desktop */
.metals-title-desktop {
    display: block;
}

/* Metals unit selector dropdown */
.metals-unit-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8L2 4h8z'/%3E%3C/svg%3E") no-repeat left 8px center;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 6px 12px 6px 28px;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    min-width: 120px;
    text-align: right;
    direction: rtl;
}

.metals-unit-select:hover {
    border-color: #999;
}

.metals-unit-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
    color: #000000;
}

/* Metals table rate columns - row styling */
.rates-table-row .col-rate-usd,
.rates-table-row .col-rate-ils {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 400;
    color: #000000;
}

.rates-table-header > div {
    display: flex;
    align-items: center;
    justify-content: center;
}

.rates-table-header .col-currency-name {
    justify-content: flex-start;
}

/* Table Row */
.rates-table-row {
    display: grid;
    grid-template-columns: 1.5fr 100px 200px 160px 120px;
    gap: 20px;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    align-items: center;
    transition: background 0.2s ease;
    background: white;
}

.rates-table-row:hover {
    background: #fafafa;
}


.rates-table-row:last-child {
    border-bottom: none;
}

.rates-table-row.rate-error {
    opacity: 0.6;
}

/* Column: Currency Name (Flag + Label) - Table Rows */
.rates-table-row .col-currency-name {
    display: flex;
    align-items: center;
    gap: 12px;
}

.currency-flag {
    width: 40px !important;
    height: 28px !important;
    object-fit: contain;
    border-radius: 4px;
    flex-shrink: 0;
}

.currency-label {
    font-size: 16px;
    font-weight: 400;
    color: #000000;
}

/* Column: Symbol - Table Rows */
.rates-table-row .col-symbol {
    text-align: center;
    font-size: 16px;
    font-weight: 400;
    color: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Column: Rate Value - Table Rows */
.rates-table-row .col-rate {
    text-align: center;
    font-size: 16px;
    font-weight: 400;
    color: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rates-table-row .col-rate .rate-value {
    font-weight: 400;
}

.rates-table-row .col-rate .rate-per-gram {
    font-size: 12px;
    color: #666666;
    font-weight: 400;
    margin-right: 4px;
}

/* Column: Daily Change (Percentage) - Table Rows */
.rates-table-row .col-daily {
    text-align: center;
    font-size: 16px;
    font-weight: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.rates-table-row .col-daily.negative {
    color: #d32f2f;
}

.rates-table-row .col-daily.positive {
    color: #388e3c;
}

.rates-table-row .col-daily.neutral {
    color: #757575;
}

.rates-table-row .col-daily .change-arrow {
    font-size: 16px;
    margin-left: 4px;
}

.rates-table-row .col-daily .change-absolute {
    margin-left: 4px;
}

.rates-table-row .col-daily .change-percent {
    margin-left: 4px;
    font-size: 14px;
    opacity: 0.85;
}


/* ==========================================================================
   Currency Converter Section
   ========================================================================== */

.converter-container {
    background: #f8f7f7;
    padding: 24px;
    border-radius: 8פס;
}

.converter-title {
    font-size: 18px;
    font-weight: 700;
    color: #000000;
    margin: 0 0 24px 0;
    text-align: right;
}

.converter-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.converter-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 12px;
    align-items: end;
}

.converter-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.converter-field label {
    font-size: 14px;
    font-weight: 700;
    color: #000000;
    text-align: right;
}

.converter-swap-btn {
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #666666;
    transition: all 0.3s ease;
    padding: 0;
    margin-bottom: 0;
}

.converter-swap-btn:hover {
    background: #f5f5f5;
    border-color: #000000;
    color: #000000;
    transform: rotate(180deg);
}

.converter-swap-btn:active {
    transform: rotate(180deg) scale(0.95);
}

.converter-swap-btn svg {
    width: 20px;
    height: 20px;
}

.amount-currency-symbol {
    font-weight: 500;
    color: #666;
    font-size: 13px;
}

.converter-select,
.converter-input {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: white;
    color: #000000;
    font-family: inherit;
    direction: rtl;
}

.converter-select:focus,
.converter-input:focus {
    outline: none;
    border-color: #000000;
}

.converter-submit-btn {
    width: 100%;
    padding: 14px 24px;
    background: #000000;
    color: white;
    font-size: 16px;
    font-weight: 700;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s ease;
    margin-top: 4px;
}


.converter-result {
    margin-top: 20px;
    background: #f8f7f7;
    border-radius: 4px;
    text-align: center;
}

.result-label {
    font-size: 14px;
    font-weight: 600;
    color: #666666;
    margin-bottom: 8px;
}

.result-value {
    font-size: 28px;
    font-weight: 700;
    color: #000000;
}

/* Converter Chart Widget */
.converter-chart-container {
    margin-top: 24px;
    background: #ffffff;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

#converter-investing-chart {
    height: 550px;
    border-radius: 4px;
    overflow: hidden;
}

/* ==========================================================================
   Chart Modal
   ========================================================================== */

.col-chart {
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-open-btn {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #666666;
    transition: color 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.chart-open-btn:hover {
    color: #000000;
    transform: scale(1.1);
    background: #f0f0f0;
}

.chart-open-btn svg {
    width: 20px;
    height: 20px;
}

.chart-btn-text {
    display: none; /* Hidden on desktop */
}

.chart-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    cursor: pointer;
}

.chart-modal-content {
    position: relative;
    background: white;
    width: 90%;
    max-width: 1100px;
    max-height: 90vh;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    direction: rtl;
}

.chart-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f7f7;
}

.chart-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #000000;
    margin: 0;
}

.chart-modal-close {
    background: none;
    border: none;
    font-size: 32px;
    line-height: 1;
    color: #666666;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.chart-modal-close:hover {
    color: #000000;
}

.chart-modal-body {
    padding: 0;
    height: 600px;
    direction: ltr;
}

#modal-investing-chart {
    width: 100%;
    height: 600px;
    border: none;
}

#tradingview_chart {
    width: 100%;
    height: 100%;
}

/* ==========================================================================
   Message Area
   ========================================================================== */

.rates-grid-message {
    padding: 16px;
    border-radius: 8px;
    margin-top: 20px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
}

.rates-grid-message.success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.rates-grid-message.error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.rates-grid-message.warning {
    background: #fff3e0;
    color: #ef6c00;
    border: 1px solid #ffb74d;
}

.rates-grid-message.info {
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid #90caf9;
}

/* ==========================================================================
   Error State
   ========================================================================== */

.rates-grid-error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    margin-top: 16px;
}

/* ==========================================================================
   Responsive Design - Large Tablets
   ========================================================================== */


@media screen and (max-width: 1200px) {
    .rates-main-container {
        flex-direction: column-reverse;
        gap: 24px;
    }
    
    .rates-table-section,
    .currency-converter-section {
        flex: 1 1 100%;
        width: 100%;
    }
    
    .currency-converter-section {
        position: relative;
        top: 0;
    }
    
    .converter-row {
        grid-template-columns: 1fr auto 1fr;
        gap: 12px;
    }
    
    .rates-table-header,
    .rates-table-row {
        grid-template-columns: 2fr 120px 180px 140px;
        gap: 16px;
        padding: 16px;
    }
    
    .rates-table-row .col-rate {
        font-size: 16px;
        font-weight: 400;
    }
    
    .rates-table-row .col-symbol {
        font-size: 16px;
        font-weight: 400;
    }
    
    .currency-label {
        font-size: 15px;
        font-weight: 400;
    }
    
    .currency-flag {
        width: 36px !important;
        height: 25px !important;
    }
}

/* ==========================================================================
   Responsive Design - Tablets
   ========================================================================== */

@media screen and (max-width: 992px) {
    /* Stack table and converter vertically on tablets */
    .rates-main-container {
        flex-direction: column-reverse;
        gap: 24px;
    }
    
    .rates-table-section,
    .currency-converter-section {
        flex: 1 1 100%;
        width: 100%;
    }
    
    .currency-converter-section {
        position: relative;
        top: 0;
    }
    
    .converter-row {
        grid-template-columns: 1fr auto 1fr;
        gap: 12px;
    }
    
    .rates-table-header,
    .rates-table-row {
        grid-template-columns: 1.2fr 80px 160px 120px 80px;
        gap: 12px;
        padding: 14px;
    }

    .metals-table .rates-table-header,
    .metals-table .rates-table-row {
        grid-template-columns: 1.2fr 60px 120px 120px 90px 70px;
    }
    
    .rates-table-header {
        font-size: 12px;
        font-weight: 700;
    }
    
    .rates-table-row .col-rate {
        font-size: 15px;
        font-weight: 400;
    }
    
    .rates-table-row .col-daily {
        font-size: 15px;
        font-weight: 400;
    }
    
    .rates-table-row .col-symbol {
        font-size: 15px;
        font-weight: 400;
    }
    
    .currency-label {
        font-size: 14px;
        font-weight: 400;
    }
    
    .currency-flag {
        width: 32px !important;
        height: 22px !important;
    }
}

/* ==========================================================================
   Responsive Design - Mobile
   ========================================================================== */

@media screen and (max-width: 768px) {

    .rates-section-title{
        padding: 12px;
    }
    .currency-rates-grid-wrapper {
        padding: 0;
    }
    
    /* Stack table and converter vertically on mobile */
    .rates-main-container {
        flex-direction: column;
        gap: 24px;
    }
    
    .rates-table-section,
    .currency-converter-section {
        flex: 1 1 100%;
        width: 100%;
    }
    
    .currency-converter-section {
        position: relative;
        top: 0;
    }
    
    .converter-container {
        padding: 20px;
    }
    
    .converter-title {
        font-size: 16px;
        margin-bottom: 20px;
    }
    
    .converter-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .converter-swap-btn {
        width: 40px;
        height: 40px;
        margin: 0 auto;
    }
    
    .converter-swap-btn svg {
        transform: rotate(90deg);
    }
    
    .converter-swap-btn:hover svg {
        transform: rotate(-90deg);
    }
    
    .converter-chart-container {
        margin-top: 20px;
        padding: 12px;
    }
    
    #converter-investing-chart {
        height: 450px;
    }
    
    .rates-grid-header {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
        margin-bottom: 16px;
        padding: 16px;
    }
    
    .update-time {
        text-align: right;
        font-size: 13px;
    }
    
    .rates-refresh-btn {
        width: 100%;
        justify-content: center;
        padding: 12px 16px;
    }
    
    /* Hide headers on mobile */
    .rates-table-header {
        display: none;
    }
    .metals-table-header {
        display: none !important;
    }

    /* ── Mobile layout ───────────────────────────────────────────────────────
       METALS  Row 1: [name+icon | symbol | usd/oz | ils/gram | daily%]
               Row 2: [         צפייה בגרף — centered                    ]
       FOREX   Row 1: [name+icon | symbol | rate | daily%]
               Row 2: [         צפייה בגרף — centered                    ]

       minmax(0, Xfr) forces columns to shrink below content size so the
       grid never overflows the screen.
    ──────────────────────────────────────────────────────────────────────── */

    /* ── METALS ROW ─────────────────────────────────────────────────────── */
    /* !important needed: desktop rule .metals-table .rates-table-row
       (specificity 0-2-0) beats .metals-row (0-1-0) without it */
    .metals-row {
        display: grid !important;
        /* name | symbol | usd/oz | ils/gram | daily */
        grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.5fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 0.7fr) !important;
        grid-template-rows: auto auto !important;
        gap: 6px 6px !important;
        padding: 12px !important;
        position: static;
        align-items: center;
    }

    .metals-row .col-currency-name {
        grid-column: 1;
        grid-row: 1;
        overflow: hidden;
    }

    .metals-row .col-symbol {
        grid-column: 2;
        grid-row: 1;
        font-size: 12px;
        font-weight: 700;
        color: #666;
        text-align: center;
        overflow: hidden;
    }

    .metals-row .col-rate-usd {
        grid-column: 3;
        grid-row: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        font-size: 12px;
        font-weight: 400;
        overflow: hidden;
    }

    .metals-row .col-rate-usd::before {
        content: 'דולר/אונקיה';
        color: #999;
        font-size: 9px;
        font-weight: 600;
        display: block;
        margin-bottom: 2px;
    }

    .metals-row .col-rate-ils {
        grid-column: 4;
        grid-row: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        overflow: hidden;
    }

    /* Mobile unit label = mini column header */
    .mobile-unit-label {
        display: block;
        color: #999;
        font-size: 9px;
        font-weight: 600;
        margin-bottom: 2px;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

    .metals-row .col-rate-ils .rate-value {
        font-size: 12px;
    }

    .metals-row .col-daily {
        grid-column: 5;
        grid-row: 1;
        font-size: 12px;
        font-weight: 400;
        text-align: center;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        flex-wrap: wrap;
        gap: 1px;
        overflow: hidden;
    }

    /* Chart button row — full width, centered */
    .metals-row .col-chart {
        grid-column: 1 / -1;
        grid-row: 2;
        position: static !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center;
        border-top: 1px solid #eee;
        margin-top: 10px;
        padding-top: 8px;
    }

    /* ── FOREX ROW ───────────────────────────────────────────────────────── */
    .rates-table-row:not(.metals-row) {
        display: grid !important;
        /* name | symbol | rate | daily */
        grid-template-columns: minmax(0, 1.6fr) minmax(0, 0.5fr) minmax(0, 1.1fr) minmax(0, 0.9fr) !important;
        grid-template-rows: auto auto !important;
        gap: 6px 6px !important;
        padding: 12px !important;
        position: static;
        align-items: center;
    }

    .rates-table-row:not(.metals-row) .col-currency-name {
        grid-column: 1;
        grid-row: 1;
        overflow: hidden;
    }

    .rates-table-row:not(.metals-row) .col-symbol {
        grid-column: 2;
        grid-row: 1;
        font-size: 12px;
        font-weight: 700;
        color: #666;
        text-align: center;
        justify-content: center;
        overflow: hidden;
    }

    .rates-table-row:not(.metals-row) .col-rate {
        grid-column: 3;
        grid-row: 1;
        font-size: 14px;
        font-weight: 600;
        text-align: center;
        justify-content: center;
        overflow: hidden;
    }

    .rates-table-row:not(.metals-row) .col-daily {
        grid-column: 4;
        grid-row: 1;
        font-size: 12px;
        font-weight: 400;
        text-align: center;
        justify-content: center;
        overflow: hidden;
    }

    /* Hide absolute change on forex mobile — only show % */
    .rates-table-row:not(.metals-row) .col-daily .change-absolute {
        display: none;
    }

    /* Chart button row — full width, centered */
    .rates-table-row:not(.metals-row) .col-chart {
        grid-column: 1 / -1;
        grid-row: 2;
        position: static !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center;
        border-top: 1px solid #eee;
        margin-top: 10px;
        padding-top: 8px;
    }

    /* Remove absolute positioning globally on mobile */
    .col-chart {
        position: static !important;
    }
    
    .chart-open-btn {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 4px 0;
        color: #555;
    }
    
    .chart-open-btn svg {
        width: 15px;
        height: 15px;
    }
    
    .chart-btn-text {
        display: inline;
        font-size: 13px;
        font-weight: 500;
    }

    .currency-label {
        font-size: 14px;
        font-weight: 600;
        line-height: 1.3;
        overflow: hidden;
    }

    .currency-flag {
        flex-shrink: 0;
        width: 24px !important;
        height: 16px !important;
    }
    
    .currency-flag {
        width: 32px !important;
        height: 22px !important;
    }
    
    .currency-label {
        font-size: 14px;
    }
    
    /* Chart Modal Mobile */
    .chart-modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .chart-modal-header {
        padding: 16px;
    }
    
    .chart-modal-title {
        font-size: 16px;
    }
    
    .chart-modal-body {
        height: 600px;
    }

    /* gap is now handled by grid row-gap */

    
    /* Section title styling on mobile */
    .rates-section-title {
        padding: 21px 16px;
        background: #f5f5f5;
    }
    
    /* Hide desktop metals title on mobile */
    .metals-title-desktop {
        display: none;
    }
    
    /* Metals section: title and dropdown in same row (mobile only) */
    .metals-section-header {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        padding: 16px;
        background: #f5f5f5;
        margin-bottom: 0;
    }
    
    .metals-section-header .rates-section-title {
        margin: 0;
        padding: 0;
        background: transparent;
        font-size: 16px;
    }
    
    .metals-section-header .metals-unit-select {
        font-size: 13px;
        padding: 6px 10px 6px 28px;
    }
}



/* ==========================================================================
   Loading State Animation
   ========================================================================== */

.currency-rates-table {
    transition: opacity 0.3s ease;
}

/* Flash Update Animation */
@keyframes flashUpdate {
    0% {
        background: rgba(76, 175, 80, 0.3);
        transform: scale(1.01);
    }
    50% {
        background: rgba(76, 175, 80, 0.15);
    }
    100% {
        background: transparent;
        transform: scale(1);
    }
}

.rates-table-row.flash-update {
    animation: flashUpdate 0.8s ease-out;
}

/* Rate value pulse animation */
@keyframes valuePulse {
    0% {
        color: #4CAF50;
        transform: scale(1.1);
    }
    100% {
        color: inherit;
        transform: scale(1);
    }
}

.rates-table-row.flash-update .rate-value {
    animation: valuePulse 0.6s ease-out;
}

/* Timestamp update animation */
@keyframes timestampPulse {
    0% {
        background: rgba(76, 175, 80, 0.3);
        padding: 4px 12px;
        border-radius: 4px;
    }
    100% {
        background: transparent;
    }
}

.update-time.updated {
    animation: timestampPulse 1.5s ease-out;
}

/* ==========================================================================
   RTL Support
   ========================================================================== */

[dir="ltr"] .currency-rates-grid-wrapper {
    direction: ltr;
}

[dir="ltr"] .rates-grid-header {
    flex-direction: row-reverse;
}

[dir="ltr"] .rates-table-header,
[dir="ltr"] .rates-table-row {
    grid-template-columns: 160px 200px 140px 2fr;
}

[dir="ltr"] .col-currency-name {
    flex-direction: row-reverse;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .rates-refresh-btn {
        display: none;
    }
    
    .rates-grid-message,
    .rates-grid-limit-notice,
    .rates-grid-error {
        display: none;
    }
    
    .rates-table-row {
        break-inside: avoid;
    }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

.rates-refresh-btn:focus {
    outline: 3px solid #1565c0;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .rates-table-row,
    .rates-refresh-btn,
    .refresh-icon {
        transition: none;
        animation: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .rates-table-row {
        border: 2px solid #000000;
    }
    
    .rates-refresh-btn {
        border: 2px solid #000000;
    }
}
