/* VERSION F: Light Indigo */

:root {
    --primary-color: #5c6bc0;
    --primary-dark: #3f51b5;
    --primary-light: #7986cb;
    --bg-color: #aaaaaa;
    --card-bg: #dddddd;
    --text-dark: #3f51b5;
    --text-muted: #6c757d;
    --border-color: #5c6bc0;
    --success: #1e7e34;
    --danger: #c62828;
    --info: #4a7bc8;
}

* {
    font-family: Arial, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 300;
}

body {
    background-color: var(--bg-color);
    color: var(--text-dark);
}

h1 {
    color: var(--primary-color);
    font-weight: 400;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* Description under title */
.description {
    max-width: 900px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Language buttons */
#langPL, #langEN {
    min-width: 50px;
    color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    background-color: transparent !important;
}

#langPL:hover, #langEN:hover {
    background-color: var(--primary-light) !important;
    color: white !important;
    border-color: var(--primary-color) !important;
}

#langPL:focus, #langEN:focus,
#langPL:active, #langEN:active {
    background-color: var(--primary-color) !important;
    color: white !important;
    border-color: var(--primary-color) !important;
    box-shadow: none !important;
}

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

/* Action buttons */
.action-buttons-top,
.action-buttons-bottom {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.action-buttons-top {
    padding-bottom: 0.5rem;
}

.action-buttons-bottom {
    padding-top: 0.5rem;
}

/* Cards */
.card {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 0;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.2);
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.2);
}

.card-header {
    background: var(--primary-color);
    color: white;
    border-bottom: 2px solid var(--primary-dark);
    padding: 1rem 1.25rem;
    border-radius: 0;
    font-weight: 400;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h5 {
    color: white;
    font-size: 1.1rem;
    font-weight: 400;
}

.card-body {
    padding: 1.5rem;
    border-radius: 0 !important;
}

/* Override Bootstrap border-radius */
.card,
.card-header,
.card-body,
.card-footer,
.modal-content,
.modal-header,
.modal-body,
.modal-footer,
.btn,
.form-control,
.form-select,
.table,
.badge {
    border-radius: 0 !important;
}

/* Additional override for nested elements */
* {
    border-radius: 0 !important;
}

/* Forms */
.form-label {
    font-weight: 400;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-control, .form-select {
    border: 2px solid var(--border-color);
    border-radius: 0;
    padding: 0.6rem 0.75rem;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-dark);
    box-shadow: 0 0 0 3px rgba(143, 96, 191, 0.15);
}

/* Buttons */
.btn {
    border-radius: 0;
    font-weight: 400;
    padding: 0.6rem 1.25rem;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.2);
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.3);
}

.btn-lg {
    font-size: 1.1rem;
    padding: 0.75rem 2rem;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.2);
}

.btn-lg:hover {
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.3);
}

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

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.3);
}

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

.btn-light:hover {
    background: #f8f9fa;
    color: var(--primary-dark);
    border-color: #f8f9fa;
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.3);
}

.btn-success {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.btn-success:hover {
    background: #218838;
    border-color: #1e7e34;
    color: white;
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.3);
}

.btn-info {
    background: #17a2b8;
    color: white;
    border-color: #17a2b8;
}

.btn-info:hover {
    background: #138496;
    border-color: #117a8b;
    color: white;
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.3);
}

.btn-warning {
    background: #ffc107;
    color: #212529;
    border-color: #ffc107;
}

.btn-warning:hover {
    background: #e0a800;
    border-color: #d39e00;
    color: #212529;
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.3);
}

.btn-danger {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

.btn-danger:hover {
    background: #c82333;
    border-color: #bd2130;
    color: white;
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border-color: #6c757d;
}

.btn-secondary:hover {
    background: #5a6268;
    border-color: #545b62;
    color: white;
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.3);
}

.btn-sm {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.2);
}

.btn-sm:hover {
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.3);
}

/* Events table */
#eventsTable {
    margin-bottom: 0;
    border-collapse: collapse;
    border: none;
}

#eventsTable thead {
    background-color: var(--primary-color);
    color: white;
}

#eventsTable thead th {
    font-weight: 400;
    padding: 0.75rem;
    border-right: 1px solid #000;
    border-bottom: 1px solid #000;
    font-size: 0.9rem;
}

#eventsTable thead th:last-child {
    border-right: none;
}

#eventsTable tbody td {
    padding: 0.75rem;
    vertical-align: middle;
    border-right: 1px solid #000;
    border-bottom: 1px solid #000;
    font-size: 0.9rem;
    background: var(--card-bg);
}

#eventsTable tbody td:last-child {
    border-right: none;
}

#eventsTable tbody tr:last-child td {
    border-bottom: none;
}

#eventsTable tbody tr:hover {
    background-color: rgba(143, 96, 191, 0.08);
}

.event-type-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 0;
    font-size: 0.8rem;
    font-weight: 400;
    background: var(--primary-light);
    color: white;
}

/* Summary */
.summary-item {
    text-align: center;
    padding: 1rem;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 0;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.2);
}

.summary-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-bottom: 0.5rem;
}

.summary-value {
    font-size: 1.5rem;
    font-weight: 400;
    font-variant-numeric: tabular-nums;
    line-height: 1.4;
}

.text-primary {
    color: var(--primary-color) !important;
}

.text-danger {
    color: var(--danger) !important;
}

.text-success {
    color: var(--success) !important;
}

/* Results table */
.table {
    font-size: 0.9rem;
    border-collapse: collapse;
    border: none;
}

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

.table thead th {
    font-weight: 400;
    padding: 0.875rem;
    border-right: 1px solid #000;
    border-bottom: 1px solid #000;
    text-align: left;
}

.table thead th:last-child {
    border-right: none;
}

.table tbody td {
    padding: 0.75rem;
    vertical-align: middle;
    border-right: 1px solid #000;
    border-bottom: 1px solid #000;
    background: var(--card-bg);
}

.table tbody td:last-child {
    border-right: none;
}

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

.table tbody tr:hover {
    background-color: rgba(143, 96, 191, 0.08);
}

/* Colored backgrounds for columns */
.bg-payment {
    background-color: #c9d9ed !important;
}

.bg-principal {
    background-color: #c9edc9 !important;
}

.bg-interest {
    background-color: #edc9d9 !important;
}

/* Lighter shades for headers */
.table thead th.bg-payment {
    background-color: #e0ebf7 !important;
}

.table thead th.bg-principal {
    background-color: #e0f7e0 !important;
}

.table thead th.bg-interest {
    background-color: #f7e0eb !important;
}

.table td {
    text-align: left;
    font-variant-numeric: tabular-nums;
}

.table td small {
    font-size: 0.75rem;
    font-weight: 300;
}

.text-end {
    text-align: right !important;
}

.event-highlight {
    background-color: rgba(143, 96, 191, 0.15) !important;
    font-weight: 400;
}

/* Modal */
.modal-content {
    border: 2px solid var(--border-color);
    background: var(--card-bg);
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.2);
}

.modal-header {
    background: var(--primary-color);
    color: white;
    border-bottom: 2px solid var(--primary-dark);
}

.modal-body {
    background: var(--card-bg);
    color: var(--text-dark);
}

.modal-footer {
    background: var(--card-bg);
}

.modal-title {
    color: white;
}

.btn-close {
    filter: brightness(0) invert(1);
}

/* Simulations list */
.simulation-card {
    border: 2px solid var(--border-color);
    border-radius: 0;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
    cursor: pointer;
    background: white;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.2);
}

.simulation-card:hover {
    border-color: var(--primary-dark);
    background: #f0f0f0;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.3);
}

.simulation-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.simulation-name {
    font-weight: 400;
    font-size: 1.05rem;
    color: var(--primary-dark);
}

.simulation-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.simulation-info {
    font-size: 0.85rem;
    color: var(--text-dark);
}

/* Responsiveness */
@media (max-width: 991px) {
    .action-buttons-top,
    .action-buttons-bottom {
        flex-direction: column;
        width: 100%;
    }

    .action-buttons-top .btn,
    .action-buttons-bottom .btn {
        width: 100%;
    }
}

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

    .table {
        font-size: 0.8rem;
    }

    .summary-value {
        font-size: 1.25rem;
    }

    #eventsTable {
        font-size: 0.8rem;
    }

    #eventsTable thead th,
    #eventsTable tbody td {
        padding: 0.5rem;
    }
}
