/* Estilos específicos para el kalkulator skumulowanej inflacji */
.calculator-section {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Calculadora */
.calculator {
    background: white;
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    transition: transform 0.3s ease;
}

.calculator:hover {
    transform: translateY(-5px);
}

/* Grupos de input */
.input-group {
    margin-bottom: 2rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.8rem;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.1rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input {
    width: 100%;
    padding: 1.2rem;
    padding-right: 3.5rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.input-wrapper input:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.1);
    outline: none;
    background: white;
}

.input-wrapper .currency,
.input-wrapper .percentage {
    position: absolute;
    right: 1.2rem;
    color: #666;
    font-weight: 500;
    font-size: 1.1rem;
    pointer-events: none;
}

/* Botón de calcular */
.calculate-button {
    width: 100%;
    padding: 1.2rem;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    margin-top: 2rem;
}

.calculate-button:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.calculate-button:active {
    transform: translateY(0);
}

.button-icon {
    font-size: 1.4rem;
}

/* Resultados */
.results {
    background: white;
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.result-box {
    margin-bottom: 2.5rem;
}

.result-box h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    text-align: center;
    position: relative;
}

.result-box h3::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background: var(--secondary-color);
    margin: 0.8rem auto 0;
    border-radius: 2px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.result-item:hover {
    transform: translateX(5px);
}

.result-item.nominal {
    background: linear-gradient(135deg, #e8f4fd 0%, #d6eaf8 100%);
}

.result-item.real {
    background: linear-gradient(135deg, #eafaf1 0%, #d5f5e3 100%);
}

.result-item.loss {
    background: linear-gradient(135deg, #fdedec 0%, #f5b7b1 100%);
}

.result-item.power {
    background: linear-gradient(135deg, #ebf5fb 0%, #aed6f1 100%);
}

.result-label {
    font-weight: 500;
    color: #2c3e50;
}

.result-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Gráfico */
.chart-container {
    height: 400px;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

/* Responsive */
@media screen and (max-width: 768px) {
    .calculator,
    .results {
        padding: 1.5rem;
    }

    .input-wrapper input {
        padding: 1rem;
        font-size: 1.1rem;
    }

    .result-item {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
        padding: 1rem;
    }

    .result-value {
        font-size: 1.2rem;
    }

    .chart-container {
        height: 300px;
    }
}

@media screen and (max-width: 480px) {
    .calculator-section {
        margin: 1rem auto;
    }

    .calculator,
    .results {
        margin: 0 -1rem;
        border-radius: 0;
        padding: 1.2rem;
    }

    .input-wrapper input {
        font-size: 1rem;
    }

    .calculate-button {
        padding: 1rem;
        font-size: 1.1rem;
    }

    .result-item {
        margin: 0.5rem 0;
        padding: 0.8rem;
    }

    .chart-container {
        height: 250px;
        margin: 1rem -1rem;
        border-radius: 0;
    }
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-item {
    animation: fadeIn 0.3s ease forwards;
}

/* Mejoras de accesibilidad */
input:focus-visible {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

.calculate-button:focus-visible {
    outline: 2px solid white;
    outline-offset: 2px;
}

/* Secciones informativas */
.info-section {
    margin-top: 3rem;
}

.formula {
    font-family: monospace;
    font-size: 1.1rem;
    line-height: 1.8;
}

.formula sub {
    font-size: 0.8em;
}

/* Tips grid */
.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.tip-box {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
}

.tip-box:hover {
    transform: translateY(-5px);
}

/* Añadir estos estilos */
.preset-section {
    margin: 1.5rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
}

.preset-section select {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    margin-top: 0.5rem;
    cursor: pointer;
}

/* Mejorar tooltips */
[title] {
    position: relative;
    cursor: help;
}

[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem;
    background: rgba(0,0,0,0.8);
    color: white;
    border-radius: 4px;
    font-size: 0.9rem;
    white-space: nowrap;
    z-index: 1000;
}

/* Añadir al archivo CSS existente */
.input-wrapper input.error {
    border-color: #e74c3c;
    background-color: #fdf0ed;
}

.error-message {
    background: #fdf0ed;
    color: #e74c3c;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    font-size: 0.95rem;
    display: none;
    animation: fadeIn 0.3s ease;
}

.input-wrapper input.error:focus {
    border-color: #e74c3c;
    box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.1);
}

/* Tooltip de error */
.input-wrapper input.error + .error-tooltip {
    position: absolute;
    bottom: calc(100% + 5px);
    left: 50%;
    transform: translateX(-50%);
    background: #e74c3c;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.input-wrapper input.error:hover + .error-tooltip {
    opacity: 1;
}

/* Añadir estos estilos para las nuevas secciones */
.key-points,
.impact-section,
.protection-section {
    margin: 3rem 0;
}

.points-grid,
.impact-grid,
.protection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.point-box,
.impact-box,
.protection-box {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
}

.point-box:hover,
.impact-box:hover,
.protection-box:hover {
    transform: translateY(-5px);
}

.impact-box ul,
.protection-box ul {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.impact-box li,
.protection-box li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.impact-box li::before,
.protection-box li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--secondary-color);
}

.example-box {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 12px;
    margin: 1.5rem 0;
}

.example-box h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.example-box ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.example-box li {
    margin: 0.5rem 0;
} 