/* Simulation styles */
.simulation-container {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    animation: slideIn 0.7s ease forwards;
    opacity: 0;
}

/* Simulation Table Styles */
.simulation-table-container {
    background: #f8f9ff;
    border-radius: 12px;
    padding: 25px;
    border: 2px solid #e5e7eb;
    margin-bottom: 30px;
}

.simulation-table-container h3 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.2em;
}

.sim-table-wrapper {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.simulation-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.simulation-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.simulation-table th {
    color: white;
    padding: 12px 8px;
    text-align: center;
    font-weight: 600;
    font-size: 0.85em;
}

.simulation-table td {
    padding: 8px;
    text-align: center;
    border-bottom: 1px solid #f0f2ff;
    vertical-align: middle;
}

.simulation-table tr:hover {
    background: #f9fafb;
}

.sim-table-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    font-size: 0.85em;
    text-align: center;
}

.sim-table-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.sim-table-select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    font-size: 0.85em;
    background: white;
    text-align-last: center;
}

.sim-table-select:focus {
    outline: none;
    border-color: #667eea;
}

.sim-remove-row-btn {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 0.8em;
    transition: all 0.2s ease;
}

.sim-remove-row-btn:hover {
    background: #dc2626;
    transform: scale(1.05);
}

.sim-table-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    justify-content: center;
}

.sim-add-row-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.sim-add-row-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(102, 126, 234, 0.3);
}

.simulation-panel {
    margin-bottom: 30px;
}

.simulation-form {
    background: #f8f9ff;
    border-radius: 12px;
    padding: 25px;
    border: 2px solid #e5e7eb;
}

.simulation-form h3 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.2em;
}

.sim-form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.sim-form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.sim-form-group label {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
    font-weight: 500;
}

.sim-input {
    padding: 10px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.95em;
    transition: all 0.3s ease;
    background: white;
}

.sim-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.sim-add-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.05em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sim-add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.active-simulations {
    background: #f8f9ff;
    border-radius: 12px;
    padding: 25px;
    border: 2px solid #e5e7eb;
}

.active-simulations h3 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.2em;
}

.simulations-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.no-simulations {
    text-align: center;
    color: #999;
    padding: 40px 20px;
    font-style: italic;
}

.simulation-item {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.simulation-item:hover {
    transform: translateX(-5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.sim-item-info {
    flex: 1;
}

.sim-item-type {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 600;
    margin-right: 10px;
}

.sim-type-income {
    background: #d1fae5;
    color: #065f46;
}

.sim-type-expense {
    background: #fee2e2;
    color: #991b1b;
}

.sim-item-amount {
    font-weight: 600;
    font-size: 1.1em;
    margin-left: 10px;
}

.sim-remove-btn {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sim-remove-btn:hover {
    background: #dc2626;
    transform: scale(1.05);
}

.sim-actions {
    display: flex;
    gap: 10px;
}

.sim-clear-btn, .sim-apply-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sim-clear-btn {
    background: #f3f4f6;
    color: #666;
}

.sim-clear-btn:hover {
    background: #e5e7eb;
}

.sim-apply-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.sim-apply-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.3);
}

.simulation-results {
    animation: fadeIn 0.5s ease;
}

.sim-summary {
    margin-bottom: 30px;
}

.sim-summary-card {
    background: linear-gradient(135deg, #f8f9ff 0%, #eef1ff 100%);
    border-radius: 12px;
    padding: 25px;
    border: 2px solid #667eea;
}

.sim-summary-card h4 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.2em;
}

.sim-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e5e7eb;
}

.sim-stat.highlight {
    background: white;
    margin: 10px -10px 0;
    padding: 15px 10px;
    border-radius: 8px;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.sim-value {
    font-size: 1.3em;
    font-weight: 700;
}

.sim-value.positive {
    color: #10b981;
}

.sim-value.negative {
    color: #ef4444;
}

#simulationTable td:nth-child(2),
#simulationTable td:nth-child(4) {
    font-weight: 600;
}

#simulationTable td:nth-child(3) {
    font-style: italic;
    color: #667eea;
}

#simulationTable td:nth-child(5) {
    font-weight: 700;
}

/* Final simulation summary styles */
.sim-final-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.sim-final-stat {
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
}

.sim-final-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.sim-stat-icon {
    font-size: 2em;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
}

.sim-stat-info {
    flex: 1;
}

.sim-stat-label {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.sim-stat-value {
    font-size: 1.4em;
    font-weight: 700;
}

.sim-stat-value.positive {
    color: #10b981;
}

.sim-stat-value.negative {
    color: #ef4444;
}

/* Empty row placeholder */
.sim-empty-row {
    background: #f8f9ff !important;
    opacity: 0.7;
}

.sim-empty-row td {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

@media (max-width: 768px) {
    .sim-final-stats {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
    
    .sim-final-stat {
        padding: 15px;
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .sim-stat-icon {
        font-size: 1.5em;
        min-width: auto;
    }
    
    .sim-stat-value {
        font-size: 1.2em;
    }
    
    .simulation-table {
        font-size: 0.75em;
    }
    
    .simulation-table th,
    .simulation-table td {
        padding: 6px 4px;
    }
    
    .sim-table-input,
    .sim-table-select {
        font-size: 0.75em;
        padding: 4px 6px;
    }
    
    .sim-table-actions {
        flex-direction: column;
    }
}
