/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2B9B9B;
    --primary-dark: #218080;
    --primary-light: #E8F5F5;
    --text-color: #333333;
    --text-light: #666666;
    --border-color: #DDDDDD;
    --background: #FFFFFF;
    --background-light: #F8F8F8;
    --error-color: #D32F2F;
    --success-color: #2E7D32;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    color: var(--text-color);
    background-color: var(--background-light);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* Header */
header {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

header h1 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
}

/* Tabs */
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.tab-button {
    background: var(--background);
    border: 1px solid var(--border-color);
    padding: 12px 20px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-color);
    border-radius: 8px 8px 0 0;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.tab-button:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
}

.tab-button.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 -2px 8px rgba(43, 155, 155, 0.3);
}

/* Tab Content */
.tab-content {
    display: none;
    background: var(--background);
    padding: 40px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    min-height: 500px;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab-content h2 {
    color: var(--primary-color);
    margin-bottom: 30px;
    font-size: 2rem;
    font-weight: 600;
}

.tab-content h3 {
    color: var(--text-color);
    margin-bottom: 15px;
    font-size: 1.3rem;
    font-weight: 500;
}

/* Instructions */
.instructions-content ol {
    margin-left: 20px;
    margin-bottom: 30px;
}

.instructions-content li {
    margin-bottom: 15px;
    padding-left: 10px;
}

.instructions-content strong {
    color: var(--primary-color);
}

/* Info Box */
.info-box {
    background: var(--primary-light);
    border-left: 4px solid var(--primary-color);
    padding: 20px;
    margin: 20px 0;
    border-radius: 4px;
}

.info-box h3 {
    margin-top: 0;
}

.info-box ul {
    margin-left: 20px;
}

.info-box li {
    margin-bottom: 8px;
}

/* Form Styles */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(43, 155, 155, 0.1);
}

.form-group input:invalid {
    border-color: var(--error-color);
}

.form-divider {
    text-align: center;
    margin: 30px 0;
    font-weight: 600;
    color: var(--text-light);
    position: relative;
}

.form-divider::before,
.form-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: var(--border-color);
}

.form-divider::before {
    left: 0;
}

.form-divider::after {
    right: 0;
}

.info-text {
    display: block;
    margin-top: 5px;
    font-size: 0.9rem;
    color: var(--text-light);
}

.error-message {
    display: block;
    color: var(--error-color);
    font-size: 0.9rem;
    margin-top: 5px;
    min-height: 20px;
}

/* Tooltip */
.tooltip {
    display: inline-block;
    cursor: help;
    color: var(--primary-color);
    font-weight: bold;
    margin-left: 5px;
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-color);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: normal;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.tooltip:hover::after {
    opacity: 1;
}

/* Assumptions Grid */
.assumptions-intro {
    margin-bottom: 25px;
    color: var(--text-light);
    font-size: 1rem;
    line-height: 1.6;
}

.assumptions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.assumption-card {
    background: var(--background-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
}

.assumption-card.editable {
    border-color: var(--primary-color);
    border-width: 2px;
}

.assumption-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.assumption-card h3 {
    font-size: 1rem;
    margin-bottom: 10px;
    color: var(--text-color);
}

.assumption-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.assumption-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.assumption-input {
    flex: 1;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: white;
    transition: all 0.3s ease;
}

.assumption-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(43, 155, 155, 0.1);
}

.input-suffix {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-color);
    min-width: 50px;
}

.assumption-card p {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 10px;
}

.source {
    display: block;
    font-size: 0.8rem;
    color: var(--text-light);
    font-style: italic;
}

/* Methodology */
.methodology-section {
    margin-bottom: 40px;
}

.formula-box {
    background: var(--background-light);
    border-left: 4px solid var(--primary-color);
    padding: 20px;
    margin: 15px 0;
    border-radius: 4px;
}

.formula-box p {
    margin-bottom: 10px;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
}

.formula-box p:last-child {
    margin-bottom: 0;
}

/* ROI Cards */
.roi-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.roi-card {
    background: var(--background-light);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
}

.roi-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.roi-card.highlight {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-color: var(--primary-color);
}

.roi-card h3 {
    font-size: 1rem;
    margin-bottom: 15px;
    font-weight: 500;
}

.roi-card.highlight h3 {
    color: white;
}

.roi-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.roi-card.highlight .roi-value {
    color: white;
}

.roi-card p {
    font-size: 0.9rem;
    color: var(--text-light);
}

.roi-card.highlight p {
    color: rgba(255, 255, 255, 0.9);
}

/* Charts */
.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.chart-box {
    background: var(--background-light);
    padding: 25px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.chart-box h3 {
    margin-bottom: 8px;
    text-align: center;
}

.chart-description {
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.chart-box canvas {
    max-height: 300px;
}

/* Breakdown Table */
.breakdown-section {
    margin-bottom: 40px;
}

.breakdown-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.breakdown-table tr {
    border-bottom: 1px solid var(--border-color);
}

.breakdown-table tr.spacer {
    height: 20px;
    border: none;
}

.breakdown-table td {
    padding: 12px 15px;
}

.breakdown-table .text-right {
    text-align: right;
    font-weight: 500;
}

.breakdown-table .text-green {
    color: var(--success-color);
}

.breakdown-table .total-row {
    background: var(--background-light);
    font-size: 1.1rem;
}

.breakdown-table .highlight-row {
    background: var(--primary-light);
    font-size: 1.2rem;
}

.breakdown-table .highlight-row td {
    padding: 15px;
}

/* Buttons */
.button-group {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

button {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    background: var(--background-light);
    color: var(--text-color);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

/* Hidden */
.hidden {
    display: none !important;
}

/* Footer */
footer {
    text-align: center;
    padding: 30px 20px;
    margin-top: 40px;
    color: var(--text-light);
    font-size: 0.9rem;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    header {
        padding: 30px 15px;
    }

    header h1 {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .tabs {
        gap: 5px;
    }

    .tab-button {
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    .tab-content {
        padding: 25px 20px;
    }

    .tab-content h2 {
        font-size: 1.5rem;
    }

    .assumptions-grid {
        grid-template-columns: 1fr;
    }

    .charts-container {
        grid-template-columns: 1fr;
    }

    .roi-cards {
        grid-template-columns: 1fr;
    }

    .button-group {
        flex-direction: column;
    }

    .button-group button {
        width: 100%;
    }

    .formula-box p {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem;
    }

    .tab-button {
        padding: 8px 10px;
        font-size: 0.8rem;
    }

    .roi-value {
        font-size: 2rem;
    }

    .assumption-value {
        font-size: 1.5rem;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
    }

    .container {
        max-width: 100%;
    }

    .tabs,
    .button-group,
    footer {
        display: none;
    }

    .tab-content {
        display: block !important;
        page-break-after: always;
        box-shadow: none;
        border: 1px solid #000;
    }

    .tab-content h2 {
        color: #000;
    }

    .chart-box {
        page-break-inside: avoid;
    }
}
