/**
 * Premium Currency Converter Styling
 */
:root {
    --cb-primary: #4361ee;
    --cb-secondary: #3f37c9;
    --cb-glass: rgba(255, 255, 255, 0.75);
    --cb-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
}

.currency-builder {
    background: #fff;
    border-radius: 32px;
    padding: 40px;
    box-shadow: var(--cb-shadow);
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .currency-builder {
    background: #1a1c23;
}

.cb-container {
    position: relative;
    z-index: 2;
}

/* Main Card */
.cb-card.main-converter {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    padding: 32px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}

[data-theme="dark"] .cb-card.main-converter {
    background: rgba(255, 255, 255, 0.02);
    border-color: #333;
}

@media (max-width: 900px) {
    .cb-card.main-converter {
        flex-direction: column;
    }

    .cb-swap-container {
        transform: rotate(90deg);
        margin: 10px 0;
    }
}

.cb-input-group {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 140px;
    gap: 12px;
    width: 100%;
}

.cb-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--gray-500);
    margin-bottom: 8px;
}

.cb-amount-input {
    width: 100%;
    background: #fff;
    border: 2px solid transparent;
    padding: 16px;
    border-radius: 16px;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--cb-primary);
    transition: all 0.3s;
}

[data-theme="dark"] .cb-amount-input {
    background: #222;
}

.cb-amount-input:focus {
    border-color: var(--cb-primary);
    outline: none;
}

.cb-amount-input.result {
    background: transparent;
    border: none;
    cursor: default;
}

/* Custom Select */
.cb-custom-select {
    background: #fff;
    border: 2px solid var(--gray-200);
    padding: 14px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

[data-theme="dark"] .cb-custom-select {
    background: #222;
    border-color: #444;
}

.cb-custom-select:hover {
    border-color: var(--cb-primary);
    background: #f8f9ff;
}

.cb-custom-select .flag {
    font-size: 1.4rem;
}

.cb-custom-select .code {
    font-weight: 800;
    flex: 1;
}

.cb-swap-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid var(--gray-200);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cb-primary);
    transition: all 0.4s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.cb-swap-btn:hover {
    background: var(--cb-primary);
    color: #fff;
    transform: rotate(180deg);
}

.cb-rate-info {
    text-align: center;
    font-weight: 800;
    color: var(--gray-600);
    font-size: 1rem;
    margin-bottom: 48px;
}

/* Popular Grid */
.cb-subtitle {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--gray-800);
}

[data-theme="dark"] .cb-subtitle {
    color: #fff;
}

.cb-popular-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.cb-pair-card {
    background: var(--gray-50);
    padding: 16px;
    border-radius: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
}

[data-theme="dark"] .cb-pair-card {
    background: rgba(255, 255, 255, 0.03);
}

.cb-pair-card:hover {
    transform: translateY(-3px);
    background: #fff;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.03);
}

.cb-pair-name {
    font-weight: 800;
    font-size: 0.85rem;
    color: var(--gray-500);
}

.cb-pair-val {
    font-weight: 800;
    color: var(--cb-primary);
    font-size: 1rem;
}

/* Modal */
.cb-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(8px);
}

.cb-modal.active {
    display: flex;
}

.cb-modal-content {
    background: #fff;
    width: 90%;
    max-width: 500px;
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 20px 100px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .cb-modal-content {
    background: #1a1c23;
    border: 1px solid #333;
}

.cb-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.cb-close-modal {
    font-size: 2rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-400);
}

.cb-modal-search {
    background: var(--gray-50);
    border-radius: 12px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.cb-modal-search input {
    border: none;
    background: none;
    padding: 14px 0;
    width: 100%;
    outline: none;
    font-weight: 600;
}

.cb-currency-list {
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cb-currency-item {
    padding: 14px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.cb-currency-item:hover {
    background: var(--gray-100);
}

[data-theme="dark"] .cb-currency-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.cb-currency-item.active {
    background: var(--cb-primary);
    color: #fff;
}

.cb-currency-item .f {
    font-size: 1.6rem;
}

.cb-currency-item .n {
    font-weight: 700;
    flex: 1;
}

.cb-currency-item .c {
    font-weight: 800;
    opacity: 0.6;
}