:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --accent-color: #4895ef;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --success-color: #4cc9f0;
    --warning-color: #f72585;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: var(--dark-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

h1 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1rem;
    opacity: 0.9;
}

.calculator-container {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .calculator-container {
        grid-template-columns: 1fr;
    }
}

.input-section, .result-section {
    background-color: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.input-section h2, .result-section h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
    border-bottom: 2px solid var(--light-color);
    padding-bottom: 0.5rem;
}

.form-group {
    margin-bottom: 1.2rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark-color);
}

input, select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

input:focus, select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.2);
}

button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

button:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}

.result-card {
    background-color: var(--light-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    text-align: center;
}

.result-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0.5rem 0;
}

.result-label {
    font-size: 1rem;
    color: var(--dark-color);
    opacity: 0.8;
}

.cashflow-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.cashflow-table th, .cashflow-table td {
    padding: 0.8rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.cashflow-table th {
    background-color: var(--light-color);
    font-weight: 600;
}

.cashflow-table tr:hover {
    background-color: rgba(67, 97, 238, 0.05);
}

.visualization {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.visualization h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
    border-bottom: 2px solid var(--light-color);
    padding-bottom: 0.5rem;
}

.chart-container {
    height: 300px;
    position: relative;
    margin-top: 1rem;
}

.info-section {
    margin-top: 2rem;
    background-color: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.info-section h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
    border-bottom: 2px solid var(--light-color);
    padding-bottom: 0.5rem;
}

.info-section p {
    margin-bottom: 1rem;
}

.info-section ul {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.info-section li {
    margin-bottom: 0.5rem;
}

.tabs {
    display: flex;
    margin-bottom: 1rem;
    border-bottom: 1px solid #ddd;
}

.tab {
    padding: 0.8rem 1.5rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--dark-color);
    transition: var(--transition);
    border-bottom: 3px solid transparent;
}

.tab.active {
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.add-year-btn, .remove-year-btn {
    background-color: transparent;
    color: var(--primary-color);
    padding: 0.5rem;
    border: 1px solid var(--primary-color);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.5rem;
    font-size: 0.9rem;
}

.remove-year-btn {
    color: var(--warning-color);
    border-color: var(--warning-color);
}

.add-year-btn:hover {
    background-color: rgba(67, 97, 238, 0.1);
}

.remove-year-btn:hover {
    background-color: rgba(247, 37, 133, 0.1);
}

.action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.secondary-btn {
    background-color: white;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.secondary-btn:hover {
    background-color: rgba(67, 97, 238, 0.1);
}

.tooltip {
    position: relative;
    display: inline-block;
    margin-left: 0.5rem;
    cursor: pointer;
}

.tooltip .tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: var(--dark-color);
    color: white;
    text-align: center;
    border-radius: var(--border-radius);
    padding: 0.5rem;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.9rem;
    font-weight: normal;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

footer {
    text-align: center;
    margin-top: 3rem;
    padding: 1rem;
    color: var(--dark-color);
    opacity: 0.7;
    font-size: 0.9rem;
}

.error-message {
    color: var(--warning-color);
    font-size: 0.9rem;
    margin-top: 0.5rem;
    display: none;
}

.has-error input {
    border-color: var(--warning-color);
}