/* ===== FX Exchange Rates Table Styles ===== */

/* Import Professional Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* Container */
.fx-rates-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 32px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Header */
.fx-rates-header {
    text-align: center;
    margin-bottom: 32px;
}

.fx-rates-title {
    font-size: 32px;
    font-weight: 700;
    color: #25387c;
    margin: 0 0 8px 0;
    letter-spacing: -0.02em;
}

.fx-rates-subtitle {
    font-size: 16px;
    color: #6b7280;
    margin: 0 0 12px 0;
}

.fx-rates-updated {
    font-size: 13px;
    color: #9ca3af;
    margin-top: 8px;
    display: none !important; /* Hidden per user request */
}

/* Loading State */
.fx-rates-loading {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.fx-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e1e4eb;
    border-top-color: #25387c;
    border-radius: 50%;
    animation: fx-spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

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

/* Error State */
.fx-rates-error {
    text-align: center;
    padding: 40px 20px;
    background: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    color: #991b1b;
}

/* Table Wrapper */
.fx-rates-table-wrapper {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    overflow: hidden;
    border: 1px solid #e1e4eb;
}

/* Table */
.fx-rates-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #ffffff;
    table-layout: auto;
}

@media (max-width: 768px) {
    .fx-rates-table {
        table-layout: fixed;
    }
}

/* Table Headers */
.fx-rates-table thead {
    background: linear-gradient(135deg, #f8f9fd 0%, #f1f3f8 100%);
}

.fx-rates-table th {
    padding: 16px 20px;
    text-align: left;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #25387c;
    border-bottom: 2px solid #e1e4eb;
    position: sticky;
    top: 0;
    z-index: 10;
}

.fx-th-code {
    width: 15%;
    padding-left: 24px;
}

.fx-th-currency {
    width: 35%;
}

.fx-th-rate {
    width: 25%;
    text-align: right;
    padding-right: 24px;
}

.fx-th-action {
    width: 25%;
    text-align: center;
    padding-right: 24px;
}

/* Table Rows */
.fx-rates-table tbody tr {
    border-bottom: 1px solid #e1e4eb;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    animation: fx-row-fade-in 0.4s ease backwards;
}

@keyframes fx-row-fade-in {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fx-rates-table tbody tr:nth-child(even) {
    background: #fafbfc;
}

.fx-rates-table tbody tr:nth-child(odd) {
    background: #ffffff;
}

.fx-rates-table tbody tr:hover {
    background: linear-gradient(90deg, #f0f4ff 0%, #eef2fb 100%);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(37, 56, 124, 0.12);
    position: relative;
    z-index: 1;
}

.fx-rates-table tbody tr:last-child {
    border-bottom: none;
}

/* Table Cells */
.fx-rates-table td {
    padding: 18px 20px;
    vertical-align: middle;
}

/* Code Column */
.fx-td-code {
    padding-left: 24px;
}

.fx-code-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.fx-flag-icon {
    width: 24px;
    height: 18px;
    border-radius: 3px;
    object-fit: cover;
    box-shadow: 0 0 0 1px rgba(0,0,0,.06) inset;
    flex-shrink: 0;
}

.fx-code-text {
    font-weight: 700;
    font-size: 15px;
    color: #111827;
}

/* Currency Column */
.fx-currency-name {
    font-size: 14px;
    color: #374151;
    font-weight: 500;
}

/* Rate Column */
.fx-td-rate {
    text-align: right;
    padding-right: 24px;
}

.fx-rate-value {
    font-size: 16px;
    font-weight: 600;
    color: #2563eb;
    font-variant-numeric: tabular-nums;
}

/* Buy Button Column */
.fx-td-action {
    text-align: center;
    padding-right: 24px;
}

.fx-buy-button {
    display: inline-block;
    padding: 10px 24px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #1a1a1a;
    font-weight: 700;
    font-size: 14px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.3);
    min-width: 100px;
    text-align: center;
    font-family: inherit;
}

.fx-buy-button:hover {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 16px rgba(251, 191, 36, 0.4);
    color: #1a1a1a;
    text-decoration: none;
}

.fx-buy-button:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.3);
}

.fx-buy-button:focus {
    outline: 2px solid #25387c;
    outline-offset: 2px;
}

/* Responsive Design */
@media (max-width: 992px) {
    .fx-rates-container {
        padding: 24px;
        margin: 20px auto;
    }
    
    .fx-rates-title {
        font-size: 28px;
    }
}

@media (max-width: 768px) {
    .fx-rates-container {
        padding: 16px;
        margin: 16px auto;
    }
    
    .fx-rates-table-wrapper {
        overflow: visible;
        -webkit-overflow-scrolling: touch;
        background: transparent;
        border: none;
        box-shadow: none;
        border-radius: 0;
    }
    
    /* Hide table headers on mobile */
    .fx-rates-table thead {
        display: none;
    }
    
    /* Convert table to card layout */
    .fx-rates-table {
        display: block;
        width: 100%;
        background: transparent;
        border: none;
    }
    
    .fx-rates-table tbody {
        display: block;
        width: 100%;
    }
    
    .fx-rates-table tbody tr {
        display: block;
        width: 100%;
        background: #ffffff;
        border: 1px solid #e1e4eb;
        border-radius: 12px;
        margin-bottom: 12px;
        padding: 16px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.06);
        transition: all 0.3s ease;
    }
    
    .fx-rates-table tbody tr:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        background: #ffffff;
    }
    
    .fx-rates-table tbody tr:last-child {
        margin-bottom: 0;
    }
    
    /* Make all cells block-level */
    .fx-rates-table tbody td {
        display: block;
        padding: 0;
        border: none;
        width: 100%;
        text-align: left;
    }
    
    /* Currency info section (flag + code + name) */
    .fx-td-code {
        margin-bottom: 12px;
    }
    
    .fx-code-wrapper {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-bottom: 8px;
    }
    
    .fx-flag-icon {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        object-fit: cover;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        flex-shrink: 0;
    }
    
    .fx-code-text {
        font-size: 16px;
        font-weight: 700;
        color: #0d9488; /* Teal color */
        margin: 0;
    }
    
    /* Currency name below code */
    .fx-td-currency {
        margin-left: 44px; /* Align with code (32px flag + 12px gap) */
        margin-bottom: 12px;
    }
    
    .fx-currency-name {
        font-size: 14px;
        color: #111827;
        font-weight: 400;
        margin: 0;
    }
    
    /* Rate section - right aligned */
    .fx-td-rate {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 12px;
        padding-top: 12px;
        border-top: 1px solid #e1e4eb;
    }
    
    .fx-td-rate::before {
        content: 'RATE';
        font-size: 12px;
        font-weight: 600;
        color: #6b7280;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }
    
    .fx-rate-value {
        font-size: 18px;
        font-weight: 700;
        color: #0d9488; /* Teal color */
        font-variant-numeric: tabular-nums;
    }
    
    /* Buy button section */
    .fx-td-action {
        margin-top: 8px;
        text-align: center;
    }
    
    .fx-buy-button {
        width: 100%;
        padding: 12px 24px;
        font-size: 14px;
        font-weight: 700;
        background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
        color: #0d9488; /* Teal text on yellow */
        border: none;
        border-radius: 8px;
        cursor: pointer;
        transition: all 0.3s ease;
        box-shadow: 0 2px 8px rgba(251, 191, 36, 0.3);
        min-width: auto;
    }
    
    .fx-buy-button:hover {
        background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
        transform: translateY(-2px);
        box-shadow: 0 4px 16px rgba(251, 191, 36, 0.4);
        color: #0d9488;
    }
    
    .fx-rates-title {
        font-size: 24px;
    }
    
    .fx-rates-subtitle {
        font-size: 14px;
    }
    
    /* Prevent horizontal scroll */
    .fx-rates-container {
        overflow-x: hidden;
        width: 100%;
        max-width: 100%;
    }
    
    .fx-rates-table-wrapper {
        max-width: 100%;
        overflow-x: hidden;
    }
}

@media (max-width: 480px) {
    .fx-rates-container {
        padding: 12px 8px;
        margin: 8px auto;
    }
    
    .fx-rates-table-wrapper {
        overflow: visible;
        background: transparent;
        border: none;
        box-shadow: none;
    }
    
    .fx-rates-title {
        font-size: 20px;
    }
    
    .fx-rates-subtitle {
        font-size: 13px;
    }
    
    .fx-rates-table tbody tr {
        padding: 14px;
        margin-bottom: 10px;
    }
    
    .fx-code-wrapper {
        gap: 10px;
    }
    
    .fx-flag-icon {
        width: 28px;
        height: 28px;
    }
    
    .fx-code-text {
        font-size: 15px;
    }
    
    .fx-td-currency {
        margin-left: 38px; /* Adjust for smaller flag */
    }
    
    .fx-currency-name {
        font-size: 13px;
    }
    
    .fx-rate-value {
        font-size: 16px;
    }
    
    .fx-buy-button {
        padding: 10px 20px;
        font-size: 13px;
    }
}

