/**
 * Simulation over time - Charts and tables
 */

/* Controls bar */
.sim-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

/* View toggle buttons */
.sim-view-toggle {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex: 1;
}

.sim-toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #f3f4f6;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #6b7280;
}

.sim-toggle-btn span {
    font-size: 18px;
}

.sim-toggle-btn:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

.sim-toggle-btn.active {
    background: linear-gradient(135deg, var(--uk-primary) 0%, #07a06d 100%);
    border-color: var(--uk-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(9, 184, 125, 0.3);
}

/* Action buttons container */
.sim-action-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Add years button */
.sim-add-years-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: white;
    border: 2px solid var(--uk-primary);
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--uk-primary);
}

.sim-add-years-btn span {
    font-size: 16px;
}

.sim-add-years-btn:hover {
    background: var(--uk-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(9, 184, 125, 0.3);
}

.sim-add-years-btn:active {
    transform: translateY(0);
}

/* Reset button */
.sim-reset-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #6b7280;
}

.sim-reset-btn:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: white;
    transform: rotate(180deg) scale(1.1);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.sim-reset-btn:active {
    transform: rotate(180deg) scale(1);
}

/* View containers */
.sim-view {
    display: none;
}

.sim-view.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* Charts grid */
.sim-charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

@media (max-width: 900px) {
    .sim-charts-grid {
        grid-template-columns: 1fr;
    }

    .sim-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .sim-view-toggle {
        width: 100%;
    }

    .sim-action-buttons {
        width: 100%;
    }

    .sim-add-years-btn {
        flex: 1;
        justify-content: center;
    }

    .sim-reset-btn {
        flex-shrink: 0;
    }
}

.sim-chart-container {
    background: white;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
}

.sim-chart-title {
    font-size: 16px;
    font-weight: 800;
    margin: 0 0 16px 0;
    color: #111827;
}

/* Table */
.sim-table-wrapper {
    overflow-x: auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    margin-bottom: 32px;
}

.sim-table {
    width: 100%;
    border-collapse: collapse;
}

.sim-table th {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    padding: 16px 12px;
    text-align: left;
    font-weight: 800;
    font-size: 13px;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
    white-space: nowrap;
}

.sim-table td {
    padding: 14px 12px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 14px;
    color: #1f2937;
}

.sim-table tbody tr:hover {
    background: #fafbfc;
}

.sim-table tbody tr:last-child td {
    border-bottom: none;
}

.sim-table .year-cell {
    font-weight: 700;
    color: var(--uk-primary);
}

.sim-table .editable-cell {
    padding: 8px 12px;
}

.sim-table .sim-rate-input {
    width: 70px;
    padding: 6px 8px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
    text-align: center;
    font-weight: 600;
    background: #f9fafb;
    transition: all 0.2s ease;
}

.sim-table .sim-rate-input:hover {
    background: #fff;
    border-color: #d1d5db;
}

.sim-table .sim-rate-input:focus {
    outline: none;
    border-color: var(--uk-primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(9, 184, 125, 0.1);
}

/* Positive/negative value colors */
.sim-table .positive {
    color: var(--uk-green);
}

.sim-table .negative {
    color: var(--uk-red);
}
