/* FEX Currency Switcher - Frontend Styles */
:root {
    --fex-primary: #7c3aed;
    --fex-primary-dark: #6d28d9;
    --fex-bg: #ffffff;
    --fex-border: #e5e7eb;
    --fex-text: #111827;
    --fex-text-muted: #6b7280;
    --fex-hover: #f3f4f6;
    --fex-active: #ede9fe;
    --fex-shadow: 0 4px 24px rgba(0,0,0,.12);
    --fex-radius: 10px;
}

/* ===== SWITCHER ===== */
.fex-cs-switcher {
    position: relative;
    display: inline-block;
    font-family: inherit;
    font-size: 14px;
    z-index: 9999;
}

.fex-cs-current {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--fex-bg);
    border: 2px solid var(--fex-border);
    border-radius: var(--fex-radius);
    cursor: pointer;
    user-select: none;
    font-weight: 600;
    color: var(--fex-text);
    transition: border-color .2s, box-shadow .2s;
    white-space: nowrap;
}

.fex-cs-current:hover,
.fex-cs-switcher.fex-open .fex-cs-current {
    border-color: var(--fex-primary);
    box-shadow: 0 0 0 3px rgba(124,58,237,.15);
}

.fex-cs-symbol {
    color: var(--fex-text-muted);
    font-size: 12px;
}

.fex-cs-arrow {
    font-size: 10px;
    color: var(--fex-text-muted);
    transition: transform .2s;
}

.fex-cs-switcher.fex-open .fex-cs-arrow {
    transform: rotate(180deg);
}

/* Dropdown */
.fex-cs-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    left: auto;
    min-width: 240px;
    background: var(--fex-bg);
    border: 1px solid var(--fex-border);
    border-radius: var(--fex-radius);
    box-shadow: var(--fex-shadow);
    list-style: none;
    margin: 0;
    padding: 6px 0;
    max-height: 320px;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.fex-cs-dropdown::-webkit-scrollbar { width: 5px; }
.fex-cs-dropdown::-webkit-scrollbar-track { background: transparent; }
.fex-cs-dropdown::-webkit-scrollbar-thumb { background: var(--fex-border); border-radius: 3px; }

.fex-cs-switcher.fex-open .fex-cs-dropdown { display: block; animation: fexFadeIn .15s ease; }

@keyframes fexFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.fex-cs-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    cursor: pointer;
    color: var(--fex-text);
    transition: background .1s;
}

.fex-cs-option:hover    { background: var(--fex-hover); }
.fex-cs-option.fex-cs-active { background: var(--fex-active); color: var(--fex-primary); font-weight: 600; }

.fex-cs-opt-name   { flex: 1; font-size: 13px; }
.fex-cs-opt-code   { font-weight: 700; font-size: 12px; color: var(--fex-primary); }
.fex-cs-opt-symbol { font-size: 12px; color: var(--fex-text-muted); }

/* Loading overlay */
.fex-cs-loading .fex-cs-current::after {
    content: '';
    display: inline-block;
    width: 12px; height: 12px;
    border: 2px solid var(--fex-border);
    border-top-color: var(--fex-primary);
    border-radius: 50%;
    animation: fexSpin .6s linear infinite;
    margin-left: 6px;
}
@keyframes fexSpin { to { transform: rotate(360deg); } }

/* ===== CONVERTER WIDGET ===== */
.fex-cs-converter {
    background: var(--fex-bg);
    border: 1px solid var(--fex-border);
    border-radius: var(--fex-radius);
    padding: 20px;
    max-width: 420px;
    font-size: 14px;
}

.fex-cs-conv-title {
    margin: 0 0 16px;
    font-size: 16px;
    font-weight: 700;
    color: var(--fex-text);
}

.fex-cs-conv-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.fex-cs-conv-input {
    flex: 0 0 110px;
    padding: 9px 12px;
    border: 1px solid var(--fex-border);
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--fex-text);
    width: 110px;
}

.fex-cs-conv-result { background: var(--fex-hover); }

.fex-cs-conv-select {
    flex: 1;
    padding: 9px 10px;
    border: 1px solid var(--fex-border);
    border-radius: 8px;
    font-size: 13px;
    color: var(--fex-text);
    cursor: pointer;
}

.fex-cs-conv-equals {
    text-align: center;
    font-size: 22px;
    color: var(--fex-primary);
    margin: 8px 0;
    cursor: pointer;
}

.fex-cs-conv-note {
    margin: 12px 0 0;
    font-size: 11px;
    color: var(--fex-text-muted);
}
