/**
 * Live Exchange Rates Page Styles
 */

/* Page Layout */
.rates-main {
    padding: 40px 0 80px;
    min-height: calc(100vh - 170px - 300px);
}

.rates-main .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Page Header */
.page-header {
    text-align: center;
    margin-bottom: 48px;
}

.page-icon {
    font-size: 56px;
    display: block;
    margin-bottom: 20px;
}

.page-title {
    font-size: 2.75rem;
    font-weight: 800;
    color: var(--text);
    margin: 0 0 12px 0;
    letter-spacing: -0.02em;
}

.page-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Rates Container */
.rates-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 32px;
}

/* Filter Bar */
.rates-filter {
    display: flex;
    gap: 16px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 20px;
}

.search-input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.1);
}

.filter-select {
    padding: 14px 40px 14px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;
    cursor: pointer;
    min-width: 160px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

/* Rates Table */
.rates-table-wrapper {
    overflow-x: auto;
    margin-bottom: 24px;
}

.rates-table {
    width: 100%;
    border-collapse: collapse;
}

.rates-table th {
    text-align: left;
    padding: 16px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border);
}

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

.rates-table td {
    padding: 20px 16px;
    border-bottom: 1px solid var(--border);
}

.rates-table tbody tr {
    transition: background 0.2s;
}

.rates-table tbody tr:hover {
    background: var(--surface-hover);
}

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

/* Currency Cell */
.currency-cell {
    display: flex;
    align-items: center;
    gap: 16px;
}

.currency-flag {
    font-size: 32px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.currency-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.currency-code {
    font-weight: 700;
    color: var(--text);
    font-size: 1.125rem;
}

.currency-name {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Rate Cell */
.rate-cell {
    text-align: right;
    font-weight: 700;
    color: var(--text);
    font-size: 1.25rem;
    font-variant-numeric: tabular-nums;
}

/* Change Cell */
.change-cell {
    text-align: right;
}

.change-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.875rem;
}

.change-badge.positive {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

.change-badge.negative {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

/* Chart Cell */
.chart-cell {
    text-align: right;
}

.chart-btn {
    padding: 10px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.chart-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 212, 170, 0.3);
}

/* Last Update */
.last-update {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.pulse-dot {
    width: 10px;
    height: 10px;
    background: #22c55e;
    border-radius: 50%;
    position: relative;
}

.pulse-dot::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: #22c55e;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: pulse-ring 2s ease-out infinite;
}

@keyframes pulse-ring {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.8;
    }
    100% {
        transform: translate(-50%, -50%) scale(3);
        opacity: 0;
    }
}

/* Dark Mode */
[data-theme="dark"] .rates-container {
    background: var(--surface);
    border-color: var(--border);
}

[data-theme="dark"] .search-input,
[data-theme="dark"] .filter-select {
    background: var(--bg);
    border-color: var(--border);
    color: var(--text);
}

[data-theme="dark"] .currency-flag {
    background: var(--bg);
    border-color: var(--border);
}

/* Responsive */
@media (max-width: 768px) {
    .rates-main {
        padding: 24px 0 60px;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .rates-container {
        padding: 20px;
        border-radius: 16px;
    }
    
    .rates-filter {
        flex-direction: column;
    }
    
    .search-box {
        min-width: 100%;
    }
    
    .rates-table th,
    .rates-table td {
        padding: 12px 8px;
    }
    
    .currency-flag {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
    
    .currency-name {
        display: none;
    }
    
    .rate-cell {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 1.75rem;
    }
    
    .chart-btn {
        padding: 8px 12px;
        font-size: 0.875rem;
    }
    
    .change-badge {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
}
