/* Currency Converter Styles */
:root {
    --bg: #090912;
    --surface: rgba(255, 255, 255, 0.04);
    --border: rgba(255, 255, 255, 0.07);
    --text: #f1f5f9;
    --text-muted: #64748b;
    --accent: #6366f1;
    --accent-glow: rgba(99, 102, 241, 0.25);
    --gold: #f59e0b;
    --radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    background-image: radial-gradient(ellipse at 25% 25%, rgba(99, 102, 241, 0.1) 0%, transparent 50%);
}

.tool-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
}

.back-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--text);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    color: var(--accent);
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.tool-header {
    text-align: center;
    margin-bottom: 2rem;
}

.header-badge {
    display: inline-block;
    padding: 0.35rem 1rem;
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, #f1f5f9, var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tool-header p {
    color: var(--text-muted);
    font-size: 1rem;
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.65;
}

/* Quick Row */
.quick-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.quick-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.quick-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.quick-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s;
}

.quick-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Converter Card */
.converter-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 1.25rem;
    position: relative;
}

.row-from,
.row-to {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.amount-input-group {
    flex: 1;
}

.amount-input-group label,
.currency-select-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.amount-input-group input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    padding: 1rem 1.25rem;
    font-size: 1.5rem;
    font-weight: 700;
    outline: none;
    transition: border-color 0.2s;
}

.amount-input-group input:focus {
    border-color: var(--accent);
}

.currency-select-group {
    width: 180px;
}

.currency-select-group select {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    padding: 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.2s;
}

.currency-select-group select:focus {
    border-color: var(--accent);
}

.swap-btn {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 50%;
    margin-top: -18px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent);
    border: 3px solid var(--bg);
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 4px 12px var(--accent-glow);
    z-index: 2;
}

.swap-btn:hover {
    transform: translateX(-50%) rotate(180deg);
    box-shadow: 0 8px 20px var(--accent-glow);
}

.result-display {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--accent);
    padding: 1rem 1.25rem;
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 10px;
    min-height: 60px;
    display: flex;
    align-items: center;
}

.row-from {
    margin-bottom: 2.5rem;
}

/* Rate Info */
.rate-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
}

.rate-detail {
    font-weight: 600;
    color: var(--text);
}

.rate-timestamp {
    color: var(--text-muted);
}

/* Multi Table */
.multi-table-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.table-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.table-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.table-title span {
    color: var(--accent);
}

.currency-table-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}

.currency-table-row {
    display: flex;
    flex-direction: column;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    border-right: 1px solid rgba(255, 255, 255, 0.03);
}

.ct-flag {
    font-size: 1.2rem;
    margin-bottom: 0.2rem;
}

.ct-code {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
}

.ct-name {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ct-rate {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    font-family: 'Outfit', sans-serif;
}

/* Loading & Error */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    padding: 4rem;
    color: var(--text-muted);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(99, 102, 241, 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.error-state {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 3rem;
    color: var(--text-muted);
    text-align: center;
}

.error-state i {
    font-size: 2.5rem;
    color: #ef4444;
}

.retry-btn {
    padding: 0.6rem 1.25rem;
    background: var(--accent);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

@media (max-width:600px) {

    .row-from,
    .row-to {
        flex-direction: column;
    }

    .currency-select-group {
        width: 100%;
    }

    .currency-table-grid {
        grid-template-columns: 1fr 1fr;
    }

    h1 {
        font-size: 2rem;
    }
}