:root {
    --card-background: white;
    --body-background: #f0f2f5;
    --text-primary: #333;
    --text-secondary: #6c757d;
    --border-color: #dee2e6;
    --accent-color: #007aff;
    --accent-text-color: white;
}

@media (prefers-color-scheme: dark) {
    :root {
        --card-background: #1c1c1e;
        --body-background: #000;
        --text-primary: #f2f2f7;
        --text-secondary: #8e8e93;
        --border-color: #3a3a3c;
        --accent-color: #0a84ff;
        --accent-text-color: white;
    }
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--body-background);
    color: var(--text-primary);
    margin: 0;
    padding: 20px 10px;
    box-sizing: border-box;
}

.main-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 100dvh; 
}

.card {
    background-color: var(--card-background);
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 420px;
    box-sizing: border-box;
}

h1 {
    text-align: center;
    font-size: 24px;
    margin: 0 0 15px 0;
}

.uf-display {
    text-align: center;
    margin-bottom: 25px;
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 500;
}

.uf-display .uf-date {
    display: block;
    font-size: 12px;
    font-style: italic;
    color: var(--text-secondary);
    margin-top: 4px;
}

.input-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 25px;
}

.amount-input-section {
    width: 100%;
}

.currency-selector-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
}

#amount-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 22px;
    font-weight: 500;
    text-align: center;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    background-color: var(--card-background);
    color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#amount-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

#amount-input::placeholder {
    color: var(--text-secondary);
    font-weight: 400;
}

/* --- ESTILOS PARA BOTONES DE MONEDA --- */
.currency-pills {
    display: flex;
    background-color: #e9ecef;
    border-radius: 10px;
    padding: 4px;
    width: fit-content;
    margin: 0 auto;
}

@media (prefers-color-scheme: dark) {
    .currency-pills {
        background-color: #2c2c2e;
    }
}

.pill {
    border: none;
    background-color: transparent;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.1s ease;
}

.pill:hover:not(.active) {
    background-color: rgba(0, 122, 255, 0.1);
    color: var(--accent-color);
}

.pill:active {
    transform: scale(0.98);
}

.pill.active {
    background-color: var(--accent-color);
    color: var(--accent-text-color);
    font-weight: 700;
}

.result-main {
    background-color: #e6f7ff;
    border: 1px solid #91d5ff;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    margin-bottom: 15px;
    cursor: pointer;
    transition: transform 0.2s ease;
}
.result-main:hover {
    transform: scale(1.02);
}
.result.shake { 
    animation: shake 0.5s ease; 
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}
.result-main h2, .result-main p {
    color: #036497;
}
.result-main h2 {
    font-size: 16px;
    margin: 0;
}
.result-main p {
    font-size: 28px;
    font-weight: 700;
    margin: 5px 0 0 0;
}

.secondary-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}

.secondary-result {
    background-color: #f7f7f7;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease;
}
.secondary-result:hover {
    transform: scale(1.03);
}

@media (prefers-color-scheme: dark) {
    .result-main {
        background-color: #003a5c;
        border-color: #005a8d;
    }
    .result-main h2, .result-main p {
        color: #e6f7ff;
    }
    .secondary-result {
        background-color: #2c2c2e;
        border-color: #3a3a3c;
    }
}

.secondary-result h2 {
    font-size: 14px;
    margin: 0 0 5px 0;
    color: var(--text-secondary);
}
.secondary-result p {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.footer {
    text-align: center;
    margin-top: 25px;
    max-width: 420px;
    width: 100%;
}

.credit {
    color: var(--text-primary); 
    font-size: 12px;
    margin: 0;
    font-weight: 700;
}

.data-source {
    color: var(--text-secondary);
    font-size: 10px;
    margin-top: 8px;
    font-style: italic;
    opacity: 0.75;
}

@keyframes shakeAnimation {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-2px); }
    40% { transform: translateX(2px); }
    60% { transform: translateX(-1px); }
    80% { transform: translateX(1px); }
}

.shake {
    animation: shakeAnimation 0.35s ease-out;
}
