/* General styling */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Arial', sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
    background-color: #0078d7;
    color: white;
    border-radius: 6px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

header h1 {
    margin-bottom: 10px;
    font-size: 2rem;
}

/* Calculator Container */
.calculator-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 40px;
}

.input-section, .results-section {
    background-color: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.input-section:hover, .results-section:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.input-section {
    flex: 1;
    min-width: 300px;
}

.results-section {
    flex: 2;
    min-width: 500px;
}

h2 {
    color: #0078d7;
    margin-bottom: 20px;
    font-size: 1.6rem;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

/* Form Styling */
.form-group {
    margin-bottom: 15px;
    position: relative;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

input:focus {
    border-color: #0078d7;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 120, 215, 0.2);
}

button {
    background-color: #0078d7;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    margin-top: 15px;
    transition: background-color 0.3s, transform 0.1s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

button:hover {
    background-color: #005a9e;
}

button:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Export buttons */
.export-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 0.9rem;
    background-color: #4CAF50;
}

.export-btn:hover {
    background-color: #388E3C;
}

.export-btn svg {
    width: 16px;
    height: 16px;
}

/* Tooltip styling */
.tooltip {
    display: inline-block;
    position: relative;
    margin-left: 5px;
    width: 18px;
    height: 18px;
    background-color: #0078d7;
    color: white;
    text-align: center;
    border-radius: 50%;
    font-size: 12px;
    cursor: help;
}

.tooltiptext {
    visibility: hidden;
    width: 250px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Results section styling */
.key-results {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.result-item {
    flex: 1;
    padding: 20px;
    background-color: #f8f8f8;
    border-radius: 6px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
}

.result-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.result-item h3 {
    color: #0078d7;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.result-item p {
    font-size: 1.5rem;
    font-weight: bold;
}

.positive {
    color: #4CAF50;
}

.negative {
    color: #F44336;
}

/* Chart styling */
.chart-container {
    position: relative;
    margin: auto;
    height: 350px;
    margin-bottom: 30px;
    background-color: #fff;
    padding: 15px;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.chart-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
}

/* Table styling */
.table-container {
    overflow-x: auto;
    background-color: #fff;
    padding: 15px;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.table-header h3 {
    margin: 0;
    color: #0078d7;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

th, td {
    padding: 12px 15px;
    text-align: right;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #f2f2f2;
    font-weight: bold;
    text-align: center;
}

th:first-child, td:first-child {
    text-align: left;
}

tr:hover {
    background-color: #f5f5f5;
}

/* Highlight row for breakeven point */
.breakeven-row {
    background-color: rgba(75, 192, 192, 0.1);
    font-weight: bold;
}

.breakeven-row:hover {
    background-color: rgba(75, 192, 192, 0.2);
}

/* Footer styling */
footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #ddd;
    margin-top: 30px;
    color: #666;
    font-size: 0.9rem;
}

footer p {
    margin-bottom: 10px;
}

/* Responsive design */
@media (max-width: 768px) {
    .calculator-container {
        flex-direction: column;
    }
    
    .input-section, .results-section {
        width: 100%;
    }
    
    .key-results {
        flex-direction: column;
    }
    
    .chart-container {
        height: 300px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.3rem;
    }
    
    /* Improve table display on mobile */
    table {
        font-size: 0.9rem;
    }
    
    th, td {
        padding: 8px 10px;
    }
}

/* Print styling for better printing */
@media print {
    body {
        background-color: white;
    }
    
    .container {
        width: 100%;
        max-width: 100%;
        padding: 0;
    }
    
    header {
        background-color: white;
        color: black;
        box-shadow: none;
        padding: 0;
        margin-bottom: 20px;
    }
    
    .input-section, .results-section {
        box-shadow: none;
        width: 100%;
    }
    
    .input-section {
        page-break-after: always;
    }
    
    button, .export-btn, .chart-controls {
        display: none;
    }
}