* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #fff3e0 0%, #f3e5f5 50%, #e3f2fd 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 600px;
    margin: 30px auto;
    padding: 30px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
    position: relative;
}

h1 {
    text-align: center;
    color: #2c3e50;
    font-size: 40px;
    font-weight: 700;
}

.input-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
    align-items: center;
}

.input-section label {
    font-weight: bold;
    color: #555;
    font-size: 18px;
}

.input-section input {
    padding: 18px;
    border: 2px solid #ddd;
    border-radius: 14px;
    font-size: 20px;
    width: 100%;
    max-width: 320px;
    transition: border-color 0.3s, box-shadow 0.3s;
    text-align: center;
    font-weight: 600;
}

.input-section input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.15);
}

.input-section button {
    padding: 18px 40px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 20px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 10px 25px rgba(52, 152, 219, 0.4);
    position: relative;
    overflow: hidden;
}

.input-section button:hover {
    background: linear-gradient(135deg, #2980b9, #1f6391);
    box-shadow: 0 15px 30px rgba(52, 152, 219, 0.5);
    transform: translateY(-2px);
}

.input-section button:active {
    transform: translateY(1px) scale(0.98);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.results-section {
    display: flex;
    flex-direction: column;
    gap: 35px;
    margin-bottom: 30px;
}

.card {
    background: white;
    border-radius: 18px;
    padding: 30px;
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
}

.card h2 {
    margin-bottom: 20px;
    font-size: 22px;
    color: #333;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
    font-weight: 700;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 0;
    border-bottom: 1px solid #eee;
}

.result-item:last-child {
    border-bottom: none;
}

.label {
    font-weight: 700;
    color: #555;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.tooltip {
    position: relative;
}

.value {
    font-weight: bold;
    font-size: 32px;
    color: #2c3e50;
    text-align: right;
}

.deduction-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 0;
    border-bottom: 1px solid #eee;
}

.deduction-row:last-child {
    border-bottom: none;
}

.deduction-value {
    font-weight: bold;
    font-size: 32px;
    color: #2c3e50;
    text-align: right;
}

.deduction-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 0;
    margin-top: 15px;
    border-top: 2px solid #3498db;
    font-weight: 800;
    font-size: 26px;
}

.tooltip-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: #999;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    font-weight: bold;
    vertical-align: middle;
    position: relative;
}

.tooltip-btn:hover {
    background-color: rgba(0, 0, 0, 0.1);
    color: #333;
    transform: scale(1.1);
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

.tooltiptext {
    visibility: hidden;
    max-width: 90vw;
    background-color: #333;
    color: white;
    text-align: left;
    border-radius: 6px;
    padding: 7px 11px;
    position: absolute;
    z-index: 50;
    top: 100%;
    left: 90%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
    font-size: 13px;
    white-space: nowrap;
    word-break: normal;
    overflow-wrap: normal;
    line-height: 1.4;
    display: block !important;
}

.tooltiptext::after {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent #333 transparent;
}

@media (max-width: 480px) {
    .container {
        margin: 20px 15px;
        padding: 20px;
    }
    
    h1 {
        font-size: 22px;
    }
    
    .input-section input {
        font-size: 18px;
        padding: 16px;
        max-width: 100%;
    }
    
    .input-section button {
        font-size: 18px;
        padding: 16px 32px;
    }
    
    .card {
        padding: 20px;
    }
    
    .card h2 {
        font-size: 20px;
    }
    
    .label, .deduction-label {
        font-size: 16px;
    }
    
    .value, .deduction-value {
        font-size: 24px;
    }
    
    .deduction-total {
        font-size: 22px;
    }
    
    .share-section button {
        font-size: 16px;
        padding: 12px 24px;
    }
    
    .tooltiptext {
        max-width: none;
        left: 90%;
        transform: translateX(-50%);
        white-space: nowrap;
        word-break: normal;
        overflow-wrap: normal;
        z-index: 99999;
    }
}

.chart-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 50px;
    margin-bottom: 10px;
}

.share-section {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.share-section button {
    padding: 14px 28px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 22px;
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s, box-shadow 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 8px 20px rgba(52, 152, 219, 0.3);
}

.share-section button:hover {
    background-color: #2980b9;
    box-shadow: 0 12px 25px rgba(52, 152, 219, 0.4);
}

.share-section button:active {
    transform: scale(0.98);
}

@media (max-width: 480px) {
    .container {
        margin: 20px 15px;
        padding: 20px;
    }
    
    h1 {
        font-size: 22px;
    }
    
    .input-section input {
        font-size: 18px;
        padding: 16px;
        max-width: 100%;
    }
    
    .input-section button {
        font-size: 16px;
        padding: 16px 32px;
    }
    
    .card {
        padding: 20px;
    }
    
    .card h2 {
        font-size: 20px;
    }
    
    .label, .deduction-label {
        font-size: 16px;
    }
    
    .value, .deduction-value {
        font-size: 24px;
    }
    
    .deduction-total {
        font-size: 22px;
    }
    
    .share-section button {
        font-size: 16px;
        padding: 12px 24px;
    }
}
