@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;800&display=swap');

:root {
    --bg-app: #ffffff;
    --text-main: #1d1d1f;
    --text-secondary: #86868b;
    --card-bg: #f5f5f7;
    --bg-card: var(--card-bg);
    --accent: #0071e3;
    --accent-alt: #af52de;
    --border: #eaeaea;
    --shadow: rgba(0, 0, 0, 0.06);
    --text-dim: #6b7280;
    --shimmer-bg: linear-gradient(90deg, #f5f5f7 25%, #e8e8ed 50%, #f5f5f7 75%);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-app: #0e1117;
        --text-main: #f5f5f7;
        --card-bg: #1c1c1e;
        --border: #38383a;
        --text-dim: #9ca3af;
        --shadow: rgba(0, 0, 0, 0.2);
        --shimmer-bg: linear-gradient(90deg, #1c1c1e 25%, #3a3a3c 50%, #1c1c1e 75%);
    }
}

html, body {
    font-family: 'Inter', sans-serif !important;
    background-color: var(--bg-app) !important;
    color: var(--text-main) !important;
    margin: 0;
    padding: 0;
}

/* ─── TÍTULO Y HEADER ─── */
.header-container {
    text-align: center;
    padding: 3rem 1rem 1rem 1rem;
}
.main-title {
    font-size: 3.8rem;
    font-weight: 800;
    background: linear-gradient(100deg, var(--text-main) 40%, var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
    line-height: 1.1;
    letter-spacing: -0.02em;
}
.sub-title {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-top: 0.5rem;
    margin-bottom: 0.3rem;
}
.sub-pills {
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    opacity: 0.85;
}

/* ─── GRID DE HERRAMIENTAS ─── */
.tools-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
    padding: 1rem 2rem;
}
@media (min-width: 768px) {
    .tools-grid { grid-template-columns: 1fr 1fr; }
}

/* ─── CONTENEDOR PRINCIPAL DE HERRAMIENTA ─── */
.st-card {
    border-radius: 22px;
    border: 1px solid var(--border);
    padding: 24px;
    background-color: var(--card-bg);
    box-shadow: 0 3px 18px var(--shadow);
    box-sizing: border-box;
}

.st-card h2 {
    margin-top: 0;
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.tool-description {
    color: var(--text-secondary);
    font-size: 0.92rem;
    margin-top: -0.4rem;
    margin-bottom: 1.2rem;
}

.tool-description.hint-text,
.hint-text {
    font-size: 0.84rem;
    color: var(--text-dim);
    margin-bottom: 0.45rem;
    line-height: 1.4;
}

/* ─── INPUTS Y SELECTS ─── */
.st-input {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background-color: var(--bg-app);
    color: var(--text-main);
    font-size: 0.95rem;
    font-family: inherit;
    margin-bottom: 15px;
    box-sizing: border-box;
}

/* ─── FILE UPLOADER ─── */
.st-uploader {
    background-color: transparent;
    border: 2px dashed var(--accent);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.2s ease;
    width: 100%;
    color: var(--text-secondary);
    font-family: inherit;
    margin-bottom: 15px;
    box-sizing: border-box;
    cursor: pointer;
}
.st-uploader:hover {
    background-color: rgba(0, 113, 227, 0.04);
}
.st-uploader::file-selector-button {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-main);
    padding: 8px 12px;
    font-weight: 600;
    cursor: pointer;
    margin-right: 15px;
}

/* ─── BOTONES PRIMARIOS DE ACCIÓN ─── */
.st-btn-primary {
    width: 100%;
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s ease;
    padding: 0.55rem 1rem;
    min-height: 46px;
    cursor: pointer;
    border: 2px solid var(--accent);
    box-shadow: 0 0 14px rgba(0, 113, 227, 0.25);
    background-color: var(--bg-app);
    color: var(--accent);
}
.st-btn-primary:hover:not(:disabled) {
    box-shadow: 0 0 22px rgba(0, 113, 227, 0.45);
}
.st-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ─── MENSAJES DE ESTADO ─── */
.status-msg {
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 15px;
}
.status-processing { color: var(--accent); }
.status-success { color: #34c759; }
.status-error { color: #ff3b30; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ─── BANNER DE DONACIÓN Y FOOTER SEO ─── */
.donation-banner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    grid-column: 1 / -1; /* Hace que el banner ocupe todo el ancho disponible */
    background: linear-gradient(135deg, var(--card-bg) 0%, rgba(243, 186, 47, 0.1) 100%);
    border: 1px solid rgba(243, 186, 47, 0.3);
    text-align: center;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .donation-banner {
        flex-direction: row;
        text-align: left;
        padding: 2rem 3rem;
    }
}

.donation-text {
    flex: 1;
}

.donation-text h2 {
    color: #F3BA2F; /* Color oficial de Binance */
}

.donation-img img {
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    background-color: white;
    padding: 8px;
    transition: transform 0.3s ease;
}

.donation-img img:hover {
    transform: scale(1.05);
}

.seo-footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 2rem;
    border-top: 1px solid var(--border);
}
/* ─── PESTAÑAS (SWAP) ESTILO STREAMLIT ─── */
.st-tabs-container {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 1rem;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.05rem;
    font-weight: 600;
    padding: 0.8rem 1rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    font-family: inherit;
}

.tab-btn:hover {
    color: var(--text-main);
}

.tab-btn.active {
    color: var(--accent);
    border-bottom: 2px solid var(--accent);
}

/* ─── FAQ FLOTANTE ─── */
#faq-wrapper {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 2000;
}

#faq-btn {
    width: 45px;
    height: 45px;
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

#faq-btn:hover {
    background: var(--accent);
    color: var(--bg-app);
    transform: scale(1.1);
}

#faq-box {
    position: absolute;
    bottom: 60px;
    right: 0;
    width: 280px; /* Un poco más estrecho para mayor seguridad */
    max-height: 70vh; /* Límite de altura */
    overflow-y: auto; /* Activa el desplazamiento vertical */
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Personalización de la barra de desplazamiento (estilo Quick) */
    scrollbar-width: thin;
    scrollbar-color: var(--accent) transparent;
}

#faq-box::-webkit-scrollbar {
    width: 6px;
}

#faq-box::-webkit-scrollbar-track {
    background: transparent;
}

#faq-box::-webkit-scrollbar-thumb {
    background-color: var(--accent);
    border-radius: 10px;
}

#faq-wrapper.active #faq-box {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#faq-box h3 {
    color: var(--accent);
    font-size: 1.1rem;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

.faq-item {
    margin-bottom: 15px;
}

.faq-item h4 {
    color: var(--text-main);
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.faq-item p {
    color: var(--text-dim);
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Ocultar tarjetas no activas */
.hidden-card {
    display: none !important;
}
/* ─── BOTÓN DE KO-FI ─── */
.donation-buttons {
    margin-top: 1.2rem;
    margin-bottom: 0.5rem;
}

.kofi-btn {
    display: inline-flex;
    align-items: center;
    background-color: #FF5E5B; /* Color rojo oficial de Ko-fi */
    color: #ffffff !important;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    padding: 10px 22px;
    border-radius: 12px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(255, 94, 91, 0.3);
}

.kofi-btn:hover {
    background-color: #f05350;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 94, 91, 0.45);
}

.kofi-icon {
    width: 22px;
    margin-right: 10px;
}
