﻿.budget-planner {
    font-family: Arial, sans-serif;
    max-width: 800px;
    margin: auto;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #f9f9f9;
    position: relative;
}

.steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.step {
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    background-color: #ddd;
}

    .step.active {
        background-color: #28a745;
        color: white;
    }

.calculator-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-section {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.step-container {
    display: none;
}

    .step-container.active {
        display: block;
    }

.input-group {
    margin-bottom: 15px;
    gap: 10px;
}

    .input-group label {
        display: block;
        font-weight: bold;
        margin-bottom: 10px;
    }

.input-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

    .input-row input {
        flex: 1;
        padding: 8px;
        border: 1px solid #ccc;
        border-radius: 5px;
        text-align: right;
        font-family: monospace;
    }

    .input-row select {
        width: 80px;
        padding: 8px;
        border: 1px solid #ccc;
        border-radius: 5px;
    }

.time-period {
    margin-top: 5px;
}

/*.buttons {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
}

    .buttons button {
        padding: 10px;
        margin: 5px;
        border: none;
        border-radius: 5px;
        cursor: pointer;
    }

#prev-btn, #next-btn {
    background-color: #007bff;
    color: white;
}

#reset-btn {
    background-color: #dc3545;
    color: white;
}

#sample-btn {
    background-color: #ffc107;
}*/
.buttons {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

    .buttons > div {
        display: flex;
        flex: 2;
        gap: 10px;
    }

        .buttons > div:first-child {
            flex: 3;
        }

    .buttons button {
        padding: 10px;
        border: none;
        border-radius: 5px;
        cursor: pointer;
        flex: 1;
        text-align: center;
    }

#prev-btn, #next-btn {
    background-color: #007bff;
    color: white;
}

#reset-btn {
    background-color: #dc3545;
    color: white;
}

#sample-btn {
    background-color: #ffc107;
}


.results-section {
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

    .results-section p {
        font-size: 16px;
        margin: 5px 0;
    }

/* Tooltip styles */
/* Update the existing tooltip styles with these: */
.tooltip-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    border-radius: 50%;
    background: #007bff;
    color: white;
    font-size: 12px;
    cursor: help;
    margin-left: 5px;
    vertical-align: middle;
    position: relative;
}
.tooltip-container { 
    position: fixed;
    background: #333;
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    min-width: 200px;
    max-width: 300px;
    min-height: 40px;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateX(-50%);
    pointer-events: none;
    word-wrap: break-word;
    line-height: 1.4;
    white-space: normal;
    overflow: visible;
}

/* Arrow styling remains the same */
.tooltip-container:after {
    content: "";
    position: absolute;
    border-width: 8px;
    border-style: solid;
}

/* Top-positioned tooltip */
.tooltip-container.top {
    bottom: calc(100% + 12px);
    top: auto;
}

    .tooltip-container.top:after {
        top: 100%;
        border-color: #333 transparent transparent transparent;
    }

/* Bottom-positioned tooltip */
.tooltip-container.bottom {
    top: calc(100% + 12px);
    bottom: auto;
}

    .tooltip-container.bottom:after {
        bottom: 100%;
        border-color: transparent transparent #333 transparent;
    }

/* Tax method selector styles */
.tax-method-selector {
    margin-bottom: 15px;
}

    .tax-method-selector label {
        display: block;
        font-weight: bold;
        margin-bottom: 8px;
    }

.toggle-buttons {
    display: flex;
    gap: 10px;
}

    .toggle-buttons button {
        flex: 1;
        padding: 8px;
        border: 1px solid #007bff;
        background-color: white;
        color: #007bff;
        border-radius: 5px;
        cursor: pointer;
        transition: all 0.3s;
    }

        .toggle-buttons button.active {
            background-color: #007bff;
            color: white;
        }

/* Section total styles */
.section-total {
    margin-top: 20px;
    padding-top: 10px;
    border-top: 2px solid #eee;
    text-align: right;
    font-size: 16px;
}

/* New Chart Styles */
.charts-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 30px;
}

.chart-container {
    flex: 1;
    min-width: 300px;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow:  inset 0 0 10px rgba(0,0,0,0.1); /* inner shadow */
}

    .chart-container h3 {
        margin-top: 0;
        text-align: center;
        color: #333;
    }

/* New Savings Goals Styles */
.savings-goals-container {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.savings-goal-card {
    flex: 1;
    min-width: 250px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

    .savings-goal-card h4 {
        margin-top: 0;
        color: #2c3e50;
        border-bottom: 1px solid #eee;
        padding-bottom: 10px;
    }

.progress-container {
    margin-top: 15px;
    position: relative;
}

.progress-bar {
    height: 20px;
    background: #28a745; /*#e9ecef */
    
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

    .progress-bar::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        height: 100%;
        width: 0;
        background: #28a745
        /*        background: #28a745;*/ 
        transition: width 0.5s ease;
    }

.progress-text {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #fff;
    text-shadow: 0 0 2px rgba(0,0,0,0.5);
    z-index: 1;
}

.savings-summary {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #dee2e6;
    margin-top: 20px;
    box-shadow: inset 0 0 10px rgb(0, 38, 255); /* inner shadow */
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

    .summary-item.highlight {
        background: #f8f9fa;
        margin: 10px -15px -15px;
        padding: 15px;
        border-bottom: none;
        border-top: 1px solid #dee2e6;
        font-size: 1.1em;
    }

        .summary-item.highlight strong {
            color: #28a745;
            font-size: 1.1em;
        }

/* Status colors */
.savings-status-good {
    color: #28a745 !important;
}

.savings-status-warning {
    color: #ffc107 !important;
}

.savings-status-danger {
    color: #dc3545 !important;
}
/* Export buttons styling */
.export-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.export-btn {
    padding: 10px 15px;
    background: #4a6fa5;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
    flex: 1;
}

    .export-btn:hover {
        background: #3a5a8a;
    }

/* Print-specific styles */
@media print {
    .buttons, .steps, .tooltip-icon, .export-buttons {
        display: none !important;
    }

    .budget-planner {
        box-shadow: none;
        border: none;
        padding: 0;
    }

    .results-section {
        page-break-before: always;
    }

    .chart-container {
        page-break-inside: avoid;
        width: 100% !important;
        box-shadow: none;
    }

    canvas {
        max-width: 100% !important;
        height: auto !important;
    }
    .savings-summary {
        box-shadow: none;
    }
}


/* Mobile layout */
@media screen and (max-width: 768px) {
    .steps {
        flex-wrap: wrap;
        gap: 5px;
    }

    .step {
        flex: 1 0 calc(50% - 10px);
        text-align: center;
    }

    .input-group label {
        margin-bottom: 5px;
    }

    .input-row {
        /*        flex-direction: column;*/
        flex: 1 0;
        gap: 5px;
        align-items: flex-start;
    }

        .input-row input {
            width: 50%;
        }

        .input-row select {
            width: 30%;
        }

    .buttons {
        flex-wrap: wrap;
    }

        .buttons button {
            flex: 1 0 calc(50% - 10px);
        }

    .toggle-buttons {
        /*        flex-direction: column;*/
        flex: 1 0 calc(50% - 10px);
    }
    .charts-container {
        flex-direction: column;
    }
    .chart-container {
        flex: 1;
        min-width: 250px;
        margin-left; -25px;
        background: white;
        padding: 5px;
        border-radius: 8px;
        box-shadow: 0 0 10px rgba(0,0,0,0.1);
    }
    .savings-goals-container {
        flex-direction: column;
    }

    .savings-goal-card {
        min-width: 100%;
    }

    .tooltip-container {
        max-width: 250px;
        font-size: 13px;
        padding: 10px 14px;
    }
}
