/* ═══════════════════════════════════════════
   DólarCTD — Divisas Globales CSS
   Adaptado para la estética de DolarCTD
   ═══════════════════════════════════════════ */

/* ── Banner de Advertencia ── */
.warning-banner {
    background: var(--negative-bg);
    border: 1px solid var(--negative);
    color: var(--text);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    animation: fadeInCard 0.4s ease-out;
}
.warning-banner i {
    color: var(--negative);
    font-size: 1.1rem;
}

/* ── Contenedor de Tabs ── */
.tabs-container {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-input);
    padding: 0.4rem;
    border-radius: 50px;
    margin-bottom: 2rem;
    border: 1px solid var(--border-card);
}
.tab {
    flex: 1;
    text-align: center;
    padding: 0.6rem 1rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: var(--transition);
}
.tab:hover {
    color: var(--text);
    background: rgba(255,255,255,0.05);
}
.tab.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 0 16px var(--primary-glow);
}

.tab-content {
    display: none;
    animation: fadeInCard 0.3s ease-out;
}
.tab-content.active {
    display: block;
}

/* ── Grid del Input Principal ── */
.base-amount-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}
@media (max-width: 600px) {
    .base-amount-row {
        grid-template-columns: 1fr;
    }
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.amount-input {
    width: 100%;
    padding: 0.8rem 1rem;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 600;
    transition: var(--transition);
    outline: none;
}
.amount-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: var(--bg-card);
}

/* ── Custom Select (Dropdowns) ── */
.custom-select {
    position: relative;
    user-select: none;
}
.select-selected {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1rem;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
    transition: var(--transition);
}
.select-selected:hover {
    background: var(--bg-card);
    border-color: var(--primary-light);
}
.select-selected.open {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.select-items {
    position: absolute;
    background: var(--bg-elevated);
    top: 100%;
    left: 0;
    right: 0;
    z-index: 99;
    border: 1.5px solid var(--primary);
    border-top: none;
    border-bottom-left-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
    max-height: 250px;
    overflow-y: auto;
    display: none;
    box-shadow: var(--shadow-lg);
}
.select-items.show {
    display: block;
    animation: menuFadeIn 0.2s ease-out;
}
.select-items div {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: var(--transition-fast);
    border-bottom: 1px solid var(--border-card);
}
.select-items div:last-child {
    border-bottom: none;
}
.select-items div:hover {
    background: var(--primary-dim);
}

.currency-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.currency-info img {
    width: 24px;
    height: 16px;
    border-radius: 3px;
    object-fit: cover;
}

/* ── Grid Múltiple ── */
.label-muted {
    display: block;
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 1rem;
    font-weight: 500;
}
.currency-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}
.currency-card-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.8rem;
    background: var(--bg-input);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
    user-select: none;
}
.currency-card-btn img {
    width: 18px;
    height: 12px;
    border-radius: 2px;
    object-fit: cover;
}
.currency-card-btn .code {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}
.currency-card-btn:hover {
    background: var(--primary-dim);
    border-color: var(--primary);
    transform: translateY(-2px);
}
.currency-card-btn.selected {
    background: var(--primary-dim);
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}
.currency-card-btn.selected .code {
    color: var(--primary-light);
}

/* ── Resultados ── */
.result-simple {
    margin-top: 2rem;
    padding: 2rem;
    background: rgba(255,255,255,0.02);
    border-radius: var(--radius-md);
    text-align: center;
    border: 1px solid var(--border-card);
}
.result-simple .amount {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 0.5rem;
    text-shadow: 0 0 20px var(--accent-glow);
}
.result-simple .rate {
    font-size: 0.9rem;
    color: var(--text-dim);
}

.result-multiple {
    margin-top: 2rem;
}
.result-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}
.result-item {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    transition: var(--transition);
}
.result-item:hover {
    border-color: var(--primary-strong);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}
.result-item .header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
}
.result-item .header img {
    width: 20px;
    height: 14px;
    border-radius: 2px;
}
.result-item .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
}

/* ── Loader ── */
.loader {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Gráfico ── */
.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.chart-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
}
.range-buttons {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-input);
    padding: 0.25rem;
    border-radius: var(--radius-sm);
}
.range-buttons button {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}
.range-buttons button:hover {
    color: var(--text);
}
.range-buttons button.active {
    background: var(--primary-dim);
    color: var(--primary-light);
}

.chart-container {
    position: relative;
    height: 350px;
    width: 100%;
}

/* ── Sección de API Docs ── */
.api-docs-section {
    margin-top: 4rem;
}
.api-docs-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    padding: 2rem;
}
.api-docs-card code {
    background: var(--bg-input);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    color: var(--accent);
    font-size: 0.85rem;
    font-family: monospace;
}
.code-block {
    background: var(--bg);
    padding: 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-card);
    overflow-x: auto;
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--primary-light);
    margin: 1rem 0;
}
