/* ===========================================
    Cash Flow (NPV/IRR) Calculator - Tool Specific Styles
    =========================================== */

/* Box Styling */
.cf-box {
    max-width: 700px; /* Slightly wider to accommodate cash flow list */
    margin: 0 auto;
    padding: 0; 
}

/* Form Container */
.cf-form {
    padding: 25px; 
    border: 1px solid #212121; /* Dark Gray/Black Border */
    border-radius: 8px;
    background-color: #F5F5F5; /* Very Light Gray Background */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.cf-section-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #4CAF50; /* Green */
    border-bottom: 2px solid #E0E0E0;
    padding-bottom: 5px; 
    margin-top: 5px; 
    margin-bottom: 20px; 
}

/* --- Core Inputs (Initial Investment & Rate) --- */
.cf-core-inputs {
    display: flex;
    flex-wrap: wrap; 
    justify-content: space-between;
    gap: 15px 2%;
    margin-bottom: 20px; 
}

.cf-input-group {
    flex-basis: 48%; /* Allows two inputs per row */
    min-width: 250px;
    display: flex;
    flex-direction: column;
}

.cf-input-group label {
    font-weight: 600;
    color: #495057;
    font-size: 0.95rem; 
    margin-bottom: 8px;
}

.cf-input-group input {
    padding: 12px;
    border: 1px solid #9E9E9E;
    border-radius: 6px;
    font-size: 1rem;
    flex-grow: 1;
    text-align: right;
}

/* --- Cash Flow List Styling --- */
#cashFlowList {
    list-style: none;
    padding: 0;
    margin: 10px 0 20px 0;
}

.cash-flow-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed #BDBDBD;
}

.cash-flow-item:last-child {
    border-bottom: none;
}

.cash-flow-label {
    font-weight: 500;
    color: #616161;
    min-width: 100px;
}

.cash-flow-input {
    width: 60%;
    padding: 8px;
    border: 1px solid #BDBDBD;
    border-radius: 4px;
    text-align: right;
    font-size: 0.95rem;
}

.add-remove-btn {
    padding: 8px 12px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-left: 10px;
}
.add-remove-btn.remove {
    background-color: #F44336;
    margin-left: 5px;
}
.add-remove-btn:hover {
    opacity: 0.9;
}


/* Button Styles */
.cf-calculate-btn {
    display: block;
    width: 100%;
    padding: 16px; 
    margin-top: 30px; 
    background-color: #4CAF50; /* Primary Green */
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s;
}
.cf-calculate-btn:hover {
    background-color: #388E3C;
}

/* --- Results Display --- */
.cf-results {
    margin-top: 20px; 
    padding: 25px;
    border: 2px solid #4CAF50; 
    border-radius: 8px;
    background-color: #E8F5E9; /* Light Green */
    text-align: center;
}

.cf-results-title {
    color: #388E3C;
    font-size: 1.6rem;
    margin-bottom: 15px;
    border-bottom: 2px solid #A5D6A7;
    padding-bottom: 5px;
}

/* Results Table */
.cf-results-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}
.cf-results-table th, .cf-results-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #A5D6A7;
    text-align: left;
}
.cf-results-table th {
    background-color: #F5F5F5; 
    color: #388E3C;
    font-weight: 600;
    width: 55%;
}

/* Key Value Styling */
.cf-results-table td {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2196F3; /* Blue for money values */
}

/* Final Balance Highlight */
.cf-results-table tr.final-metric td {
    font-size: 1.6rem;
    color: #C62828; /* Deep Red for key result */
}

/* Recalculate Button (Global Style Reuse) */
.bc-recalculate-btn {
    display: block;
    width: 100%;
    padding: 10px;
    margin-top: 20px;
    background-color: #9E9E9E;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}
.bc-recalculate-btn:hover {
    background-color: #616161;
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    .cf-input-group {
        flex-basis: 100%;
    }
}
@media (max-width: 550px) {
    .cash-flow-item {
        flex-direction: column;
        align-items: flex-start;
    }
    .cash-flow-label {
        margin-bottom: 5px;
    }
    .cash-flow-input {
        width: 100%;
    }
    .add-remove-btn {
        margin-top: 10px;
        width: 100%;
    }
    .add-remove-btn.remove {
        margin-left: 0;
    }
}