:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --background-color: #f1f5f9;
    --section-background: #ffffff;
    --container-background: #e2e8f0;
    --text-color: #1e293b;
    --border-color: #cbd5e1;
    --error-color: #ef4444;
    --success-color: #22c55e;
    --tooltip-bg: #334155;
    --modal-overlay: rgba(0, 0, 0, 0.5);
    --secondary-color: #64748b;
    --secondary-hover: #475569;
}

.calculadora-container {
    max-width: 850px;
    margin: 0 auto;
    padding: 2rem;
}

.calculadora-widget {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    padding: 2rem;
    transition: all 0.3s ease;
}

.calculadora-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.calculadora-header h1 {
    color: var(--primary-color);
    font-size: 2.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.calculadora-header p {
    color: var(--secondary-color);
    font-size: 1.1rem;
}

.moneda-section {
    background: var(--container-background);
    padding: 1.5rem;
    border-radius: 0.75rem;
    margin-bottom: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.tipo-moneda {
    flex: 1;
    min-width: 250px;
}

.moneda-toggle {
    display: flex;
    gap: 0.5rem;
    background: white;
    padding: 0.25rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
}

.moneda-toggle input[type="radio"] {
    display: none;
}

.moneda-toggle label {
    flex: 1;
    padding: 0.75rem 1.5rem;
    text-align: center;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.moneda-toggle input[type="radio"]:checked + label {
    background: var(--primary-color);
    color: white;
}

.tipo-cambio-info {
    flex: 1;
    min-width: 250px;
    background: white;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    position: relative;
}

.cambio-grupo {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.tipo-calculo {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.tipo-calculo input[type="radio"] {
    display: none;
}

.tipo-calculo label {
    display: block;
    padding: 0.75rem 1.25rem;
    background: var(--container-background);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tipo-calculo input[type="radio"]:checked + label {
    background: var(--primary-color);
    color: white;
}

.input-grupo {
    margin-bottom: 1.5rem;
    opacity: 1;
    max-height: 200px;
    transition: all 0.3s ease;
}

.input-grupo.oculto {
    opacity: 0;
    max-height: 0;
    margin: 0;
    pointer-events: none;
}

.input-grupo label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.input-grupo input,
.input-grupo select {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
}

.input-grupo input:focus,
.input-grupo select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input-grupo input.error {
    border-color: var(--error-color);
    background-color: #fef2f2;
}

.mensaje-error {
    display: none;
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.resultados-container {
    background: var(--container-background);
    padding: 1.5rem;
    border-radius: 0.75rem;
    margin: 2rem 0;
}

.resultado-grupo {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: white;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
}

.resultado-valor {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-copiar {
    background: transparent;
    border: none;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s ease;
    padding: 0.25rem;
}

.btn-copiar:hover {
    opacity: 1;
}

.detracciones-section {
    background: white;
    padding: 1.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    margin-top: 2rem;
}

.detracciones-section h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    text-align: center;
}

.tooltip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    font-size: 0.875rem;
    cursor: help;
    margin-left: 0.5rem;
}

.tooltip:hover::before {
    content: attr(title);
    position: absolute;
    background: var(--tooltip-bg);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    max-width: 200px;
    z-index: 10;
}

.acciones {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    justify-content: flex-end;
}

.btn-primary,
.btn-secondary {
    padding: 0.875rem 1.75rem;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--container-background);
    color: var(--secondary-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--modal-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.historial-lista {
    margin: 1.5rem 0;
}

.historial-item {
    background: var(--container-background);
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.suscripcion-container {
    margin-top: 4rem;
    padding: 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    border-radius: 1rem;
    color: white;
}

.suscripcion-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.input-suscripcion {
    display: flex;
    gap: 1rem;
    margin: 1.5rem 0;
}

.input-suscripcion input {
    flex: 1;
    padding: 1rem;
    border: none;
    border-radius: 0.5rem;
}

/* Estilos para tipo de cambio editable */
.tipo-cambio-venta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.venta-editable {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
}

.btn-editar-tc {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--secondary-color);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1rem;
    opacity: 0.7;
    transition: all 0.2s ease;
    width: 24px;
    height: 24px;
}

.btn-editar-tc:hover {
    opacity: 1;
    color: var(--primary-color);
    transform: scale(1.1);
}

.input-tc-venta {
    width: 80px;
    padding: 0.25rem 0.5rem;
    border: 2px solid var(--primary-color);
    border-radius: 0.25rem;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.875rem;
    text-align: right;
    background: white;
}

.input-tc-venta:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.acciones-tc-edit {
    display: flex;
    gap: 0.5rem;
    margin-left: 0.5rem;
}

.btn-tc-small {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    min-width: auto;
    border-radius: 0.25rem;
}

/* Tooltip temporal */
.tooltip-temporal {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    animation: fadeInOut 3s ease;
    white-space: nowrap;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tooltip-temporal.error {
    background: var(--error-color);
}

.tooltip-temporal::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid var(--primary-color);
}

.tooltip-temporal.error::after {
    border-top-color: var(--error-color);
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translate(-50%, 10px); }
    10% { opacity: 1; transform: translate(-50%, 0); }
    90% { opacity: 1; transform: translate(-50%, 0); }
    100% { opacity: 0; transform: translate(-50%, -10px); }
}

/* Ajustes responsive */
@media (max-width: 640px) {
    .calculadora-container {
        padding: 1rem;
    }

    .calculadora-widget {
        padding: 1.5rem;
    }

    .moneda-section {
        flex-direction: column;
    }

    .tipo-calculo {
        flex-direction: column;
    }

    .acciones {
        flex-direction: column;
    }

    .input-suscripcion {
        flex-direction: column;
    }

    .tipo-cambio-venta {
        width: 100%;
        justify-content: space-between;
    }
} 