/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* Header Styles */
header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 20px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

/* Section Styles */
section {
    padding: 40px 50px;
    border-bottom: 2px solid #f0f0f0;
}

section:last-of-type {
    border-bottom: none;
}

h2 {
    color: #1e3c72;
    font-size: 1.8em;
    margin-bottom: 25px;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
}

h3 {
    color: #2a5298;
    font-size: 1.4em;
    margin: 25px 0 15px 0;
    padding: 10px;
    background: linear-gradient(to right, #f0f4ff, transparent);
    border-left: 4px solid #667eea;
}

h4 {
    color: #555;
    font-size: 1.1em;
    margin: 25px 0 10px 0;
    font-weight: 400;
}

/* Form Styles */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

label {
    font-weight: 400;
    color: #333;
    margin-bottom: 8px;
    font-size: 0.95em;
}

input, select {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s ease;
    background: white;
}

input:focus, select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

input[readonly] {
    background: #f5f5f5;
    cursor: not-allowed;
}

input::placeholder {
    color: #999;
}

small {
    display: block;
    color: #666;
    font-size: 0.85em;
    margin-top: 5px;
}

/* Income Head Styles */
.income-head {
    background: #fafbff;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid #e8ecf7;
}

/* Info Box */
.info-box {
    background: linear-gradient(135deg, #fff5e6 0%, #ffe8cc 100%);
    border-left: 5px solid #ff9800;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.info-box h4 {
    color: #e65100;
    margin-top: 0;
}

.info-box ul {
    margin: 15px 0 0 20px;
}

.info-box li {
    margin: 8px 0;
    color: #555;
}

/* Button Styles */
.button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    padding: 30px;
    flex-wrap: wrap;
}

.btn {
    padding: 15px 40px;
    font-size: 1.1em;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-calculate {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(56, 239, 125, 0.4);
}

.btn-calculate:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(56, 239, 125, 0.6);
}

.btn-reset {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.4);
}

.btn-reset:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.6);
}

.btn-print {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.4);
}

.btn-print:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 172, 254, 0.6);
}

/* Results Section */
.results-section {
    background: linear-gradient(to bottom, #f8f9ff, white);
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Table Styles */
.summary-table {
    margin: 25px 0;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9em;
}

td {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
}

tbody tr:hover {
    background: #f8f9ff;
}

tbody tr:last-child td {
    border-bottom: none;
}

/* Final Summary */
.final-summary {
    background: white;
    padding: 25px;
    border-radius: 12px;
    margin-top: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 1.05em;
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-item.highlight {
    font-weight: 600;
    color: #1e3c72;
    background: #f0f4ff;
    padding: 12px 15px;
    margin: 5px -15px;
    border-radius: 8px;
}

.summary-item.total {
    font-size: 1.3em;
    color: #11998e;
    background: linear-gradient(135deg, #e8f5f3, #d4ede8);
    margin-top: 15px;
}

/* Footer */
footer {
    background: #2c3e50;
    color: white;
    padding: 30px;
    text-align: center;
}

footer p {
    margin: 5px 0;
}

.disclaimer {
    font-size: 0.85em;
    opacity: 0.8;
    font-style: italic;
}

/* Print Styles */
@media print {
    body {
        background: white;
        padding: 0;
    }

    .container {
        box-shadow: none;
        max-width: 100%;
    }

    .button-group, .btn {
        display: none !important;
    }

    section {
        page-break-inside: avoid;
    }

    header {
        background: #1e3c72 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        border-radius: 10px;
    }

    header {
        padding: 25px 20px;
    }

    header h1 {
        font-size: 1.8em;
    }

    section {
        padding: 20px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .button-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    table {
        font-size: 0.9em;
    }

    th, td {
        padding: 10px 8px;
    }
}