/* MonteCarlo Calculator */

/* MonteCarloView styles */
.MonteCarlo-main {
    display: flex;
    flex-direction: column;
}

.MonteCarloView {
    display: flex;
    flex-direction: row;
    font-size: 16px;
    line-height: 1.5;
    height: calc(100vh - 5rem);
}

    .MonteCarloView .h-resizer {
        height: 8px;
        font-size: 16px;
        border-bottom: none;
        border-top: none;
    }

    .MonteCarloView .resizer {
        width: 8px;
        min-width: 8px;
        max-width: 8px;
        writing-mode: vertical-lr;
        font-size: 16px;
        border-left: 1px solid #a9a9a9;
        border-right: none;
        background: none;
    }

    .MonteCarloView .MonteCarlo-side-panel {
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow: auto;
        width: 340px;
        padding: 3px 5px;
        margin: 10px;
        border: 1px solid #F0F0F0;
        box-shadow: 0px 2px 16px #F4FAFD;
        border-radius: 20px;
    }

        .MonteCarloView .MonteCarlo-side-panel tbody tr td:first-child {
            max-width: 12em;
        }

        .MonteCarloView .MonteCarlo-side-panel.fullscreen {
            width: 100vw !important;
            padding: 1vh 20vw;
            margin-right: 5%;
            margin-left: 5%;
        }

    .MonteCarloView .MonteCarlo-results-wrapper {
        display: flex;
        flex-direction: column;
        width: 100%;
        overflow: auto;
        margin-left: 5px;
        margin-right: 5px;
        border: 1px solid #F4F4F4;
        border-radius: 20px;
    }

    .MonteCarloView .MonteCarlo-results {
        display: flex;
        flex-direction: column;
        overflow: auto;
        margin-left: 6px;
        height: 100%;
    }

    .MonteCarloView .MonteCarloDetailsView {
        padding-left: 0px;
        padding-right: 0px;
        position: absolute;
        width: unset;
    }

    .MonteCarloView .MonteCarlo-details-tables ul li:not(:last-child) {
        margin-bottom: 0.75rem;
    }

    .MonteCarloView .MonteCarloDetailsView table thead tr th {
        border-top: 0px;
        text-align: center;
        background-color: #E8F3F9;
    }

    .MonteCarloView .MonteCarloDetailsView table thead tr:first-child th:first-child {
        border-top-left-radius: 20px;
    }

    .MonteCarloView .MonteCarloDetailsView table thead tr:first-child th:last-child {
        border-top-right-radius: 20px;
    }

    .MonteCarloView .MonteCarloDetailsView table tbody tr td {
        border-top: 0px;
        text-align: center;
        padding: 0px 6px;
        white-space: nowrap;
    }

    .MonteCarloView .MonteCarlo-details-tables {
        display: flex;
        flex-direction: column;
        flex: 1;
        z-index: 2;
        background-color: white;
    }

    .MonteCarloView .MonteCarlo-details-header {
        cursor: pointer;
        background-color: #007BFF;
        color: white;
        padding: 8px 12px;
        font-weight: bold;
        font-size: 16px;
        border-radius: 4px;
    }

        .MonteCarloView .MonteCarlo-details-header:hover {
            background-color: #0056B3;
            text-decoration: none;
            color: black;
        }

    .MonteCarloView .details-tab-content {
        display: flex;
        position: relative;
        overflow: auto;
        flex-direction: column;
        scrollbar-width: thin;
        scrollbar-color: #29ABE2 #B7E5FC;
        scrollbar-arrow-color: #B7E5FC;
        flex-grow: 1;
    }

    .MonteCarloView .MonteCarlo-summaries-table-parent {
        display: flex;
        position: relative;
        overflow: auto;
        scrollbar-width: thin;
        scrollbar-color: #29ABE2 #B7E5FC;
        scrollbar-arrow-color: #B7E5FC;
    }

    .MonteCarloView .MonteCarlo-summaries-tables {
        display: flex;
        flex-direction: column;
    }

        .MonteCarloView .MonteCarlo-summaries-tables table thead tr th {
            text-align: center;
            background-color: #E8F3F9;
        }

        .MonteCarloView .MonteCarlo-summaries-tables table thead tr:first-child th:first-child {
            border-top-left-radius: 20px;
        }

        .MonteCarloView .MonteCarlo-summaries-tables table thead tr:first-child th:last-child {
            border-top-right-radius: 20px;
        }

        .MonteCarloView .MonteCarlo-summaries-tables table tbody tr td {
            text-align: center;
            padding: 0px 6px;
            white-space: nowrap;
        }

    .MonteCarloView .summary-options {
        justify-content: space-between;
        margin-bottom: 2px;
    }

    .MonteCarloView .MonteCarlo-options-header {
        cursor: pointer;
        background-color: #F4F4F4;
        color: #000000;
        font-weight: bold;
        font-size: 16px;
        border-radius: 10px;
        position: sticky;
        top: 0;
        z-index: 1;
    }

    .MonteCarloView .customized-input-number .input {
        text-align: center;
    }

    .MonteCarloView .customized-input-number .spinner.decrement {
        padding: 0px 0px 0px 0px;
        margin: 0px 2px 0px 2px;
        height: auto;
        background-color: #4AAEE1;
        border: none;
    }

    .MonteCarloView .customized-input-number .spinner.increment {
        padding: 0px 0px 0px 0px;
        margin: 0px 2px 0px 2px;
        height: auto;
        background-color: #4AAEE1;
        border: none;
    }

    .MonteCarloView .option-input-group {
        border-bottom: 2px solid #F4F4F4;
        padding-bottom: 3px;
        margin-top: 3px;
        border-radius: 10px;
        border-bottom-left-radius: 0px;
        border-bottom-right-radius: 0px;
        padding-left: 5px;
        padding-right: 5px;
    }

        .MonteCarloView .option-input-group div:not(.option-input-title) {
            padding: 3px;
        }

        .MonteCarloView .option-input-group div {
            border-radius: 10px;
        }

        .MonteCarloView .option-input-group > div:first-child {
            border-radius: 10px 10px 0px 0px;
        }

        .MonteCarloView .option-input-group > div:nth-child(2) {
            border-radius: 0px 0px 10px 10px;
        }

    .MonteCarloView .option-input-title {
        font-weight: 500;
        padding-bottom: 3px;
        padding-left: 2px;
    }

    .MonteCarloView .no-hover {
        position: relative;
        top: -10px;
        border: 1px solid #F4F4F4;
        border-top: none;
        padding: 10px 0px;
        border-radius: 0px 0px 10px 10px;
    }

    .MonteCarloView .collapse {
        display: none;
    }

    /* Button styles */
    .MonteCarloView button {
        background-color: #4AAEE1;
        border: none;
        color: white;
        text-align: center;
        text-decoration: none;
        display: inline-block;
        font-size: 14px;
        margin: 4px 2px;
        cursor: pointer;
        padding: 10px 24px;
        border-radius: 4px;
        transition: background-color 0.3s;
    }

        .MonteCarloView button:hover {
            background-color: #0056B3;
            text-decoration: none;
            color: white;
        }

    .MonteCarloView button.alter-summary-columns-button {
        all: unset;
        cursor: pointer;
        color: #007bff;
        text-decoration: underline;
        font-size: inherit;
    }

        .MonteCarloView button.alter-summary-columns-button:hover {
            color: #0056b3;
            background-color: transparent;
        }

    .MonteCarloView .customized-input-number button {
        width: 24px;
        height: 100%;
        margin: 2px
    }

    .MonteCarloView .advanced-option .customized-input-number button {
        background-color: purple !important;
    }

    .MonteCarloView td button {
        padding: 0px;
        width: 25px;
        height: 100%;
    }

    /* Table styles */
    .MonteCarloView table {
        width: 100%;
        border-collapse: collapse;
        font-size: 14px;
    }

    .MonteCarloView th, .MonteCarloView td {
        text-align: left;
        border-bottom: 1px solid #ddd;
        padding: 4px;
    }

    .MonteCarloView th {
        background-color: #f2f2f2;
        font-weight: bold;
    }

    .MonteCarloView tr:not(.no-hover):hover {
        background-color: #f5f5f5;
    }

    /* Input styles */
    .MonteCarloView input[type="date"],
    .MonteCarloView input[type="text"],
    .MonteCarloView select,
    .MonteCarloView .form-control,
    .MonteCarloView .customized-input-number input {
        width: 100%;
        padding: 0px 6px;
        border: 1px solid #ccc;
        border-radius: 4px;
        font-size: 14px;
    }

    .MonteCarloView .arrow {
        display: inline-block;
        width: 0;
        height: 0;
        border-style: solid;
        margin-left: 5px;
    }

        .MonteCarloView .arrow.right {
            border-width: 5px 0 5px 5px;
            border-color: transparent transparent transparent #000;
        }

        .MonteCarloView .arrow.down {
            border-width: 5px 5px 0px 5px;
            border-color: #000 transparent transparent transparent;
        }

    /* Toggle Switch */
    .MonteCarloView .options-toggle {
        display: flex;
        flex-direction: row;
        justify-content: flex-end;
    }

    .MonteCarloView .toggle-switch {
        position: relative;
        display: inline-block;
        width: 40px;
        height: 20px;
    }

        .MonteCarloView .toggle-switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }

    .MonteCarloView .toggle-slider {
        position: absolute;
        cursor: pointer;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: #ccc;
        transition: 0.4s;
        border-radius: 34px;
    }

        .MonteCarloView .toggle-slider:before {
            position: absolute;
            content: "";
            height: 16px;
            width: 16px;
            left: 4px;
            bottom: 2px;
            background-color: white;
            transition: 0.4s;
            border-radius: 50%;
        }

    .MonteCarloView input:checked + .toggle-slider {
        background-color: #007BFF;
    }

    .MonteCarloView input:focus + .toggle-slider {
        box-shadow: 0 0 1px #007BFF;
    }

    .MonteCarloView input:checked + .toggle-slider:before {
        transform: translateX(16px);
    }

    /* Multi-Option Switch with Timeline */
    .MonteCarloView .multi-option-switch {
        display: flex;
        position: relative;
        justify-content: space-between;
        padding: 5px 7px;
        background-color: #f0f0f0;
        border-radius: 6px;
        margin-left: 4px;
        margin-right: 4px;
    }

        .MonteCarloView .multi-option-switch input[type="radio"] {
            display: none;
        }

        .MonteCarloView .multi-option-switch label {
            display: flex;
            flex: 1;
            justify-content: center;
            white-space: nowrap;
            cursor: pointer;
            text-align: center;
            color: #999;
            transition: background-color 0.4s, transform 0.4s;
            position: relative;
            z-index: 1;
            font-weight: 600;
            border-radius: 6px;
            padding: 2px 8px;
            transform: scale(0.9);
        }

        .MonteCarloView .multi-option-switch input[type="radio"]:checked + label {
            color: #fff;
            transform: scale(1);
            font-weight: 600;
            background: linear-gradient(99.02deg, rgb(0, 113, 188) 95.38%, rgb(0, 113, 188) 95.38%);
            padding: 2px 8px;
        }

        .MonteCarloView .multi-option-switch input[type="radio"]:first-child:checked + label {
            background: linear-gradient(99.02deg, rgb(41, 171, 226) -19.8%, rgb(0, 113, 188) 95.38%);
        }

        .MonteCarloView .multi-option-switch input[type="radio"]:last-child:checked + label {
            background: linear-gradient(99.02deg, #0071BC -19.8%, #29ABE2 95.38%);
        }

    .MonteCarloView .tabs-container {
        margin-top: 7px;
        margin-bottom: 7px;
        margin-right: 5px;
        display: flex;
        flex-direction: column;
        flex-grow: 100;
    }

    .MonteCarloView .nav-item button {
        padding-top: 6px;
        padding-bottom: 6px;
        font-size: 12pt;
    }

    .MonteCarloView .nav.nav-tabs {
        border-bottom: none;
    }

    .MonteCarloView .nav-tabs .nav-link {
        color: #087DC4;
        font-weight: 600;
        background: linear-gradient(99.02deg, #E8F3F9 95.38%, #E8F3F9 95.38%);
        margin: 0px;
        border-radius: 0px;
    }

    .MonteCarloView .nav-tabs .nav-item:first-child .nav-link {
        border-top-left-radius: 10px;
        border-bottom-left-radius: 10px;
    }

    .MonteCarloView .nav-tabs .nav-item:last-child .nav-link {
        border-top-right-radius: 10px;
        border-bottom-right-radius: 10px;
    }

    .MonteCarloView .nav-tabs .nav-link.active {
        background: linear-gradient(99.02deg, #0071BC 95.38%, #0071BC 95.38%);
        color: #FFFFFF;
    }

    .MonteCarloView .nav-tabs .nav-item:first-child .nav-link.active {
        background: linear-gradient(99.02deg, #29ABE2 -19.8%, #0071BC 95.38%);
        color: #FFFFFF;
    }

    .MonteCarloView .nav-tabs .nav-item:last-child .nav-link.active {
        background: linear-gradient(99.02deg, #0071BC -19.8%, #29ABE2 95.38%);
        color: #FFFFFF;
    }

    .MonteCarloView .tab-content {
        border-top: none;
        padding: 6px 0px 0px 0px;
        background-color: #fff;
        display: flex;
        flex-grow: 100;
        justify-content: center;
        align-items: center;
        flex-direction: column;
    }

    .MonteCarloView .tab-pane {
        height: 100%;
        width: 100%;
    }

    .MonteCarloView .tab-content > .active {
        display: flex;
        flex-direction: column;
    }

    /* Scroll to Top Button */
    .MonteCarloView .scroll-to-top-btn {
        display: none;
        position: fixed;
        bottom: 20px;
        right: 40px;
        z-index: 99;
        font-size: 14px;
        width: 40px;
        height: 40px;
        color: white;
        background-color: #007BFF;
        border: none;
        cursor: pointer;
        border-radius: 50%;
        transition: background-color 0.3s;
        text-align: center;
        padding: 0px;
        margin: 2px;
    }

        .MonteCarloView.scroll-to-top-btn:hover {
            background-color: #0056B3;
        }

    .MonteCarloView .progress-circle {
        position: absolute;
        top: 0;
        left: 0;
    }

    .MonteCarloView .progress-bg {
        stroke: #ccc;
    }

    .MonteCarloView .progress-bar {
        stroke: white;
        stroke-linecap: round;
        transform-origin: center;
        transform: rotate(-90deg);
    }

    /* More Details Below indicator */
    .MonteCarloView .scroll-indicator {
        display: none;
        position: sticky;
        width: 200px;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        background-color: rgba(0, 0, 0, 0.4);
        border-radius: 4px;
        padding: 6px 12px;
        text-align: center;
        color: rgb(255, 255, 255, 1);
        font-weight: bold;
        animation: pulsate 2s infinite;
        cursor: pointer;
    }

@keyframes pulsate {
    0% {
        transform: translateX(-50%) scale(1);
        opacity: 1;
    }

    50% {
        transform: translateX(-50%) scale(1.1);
        opacity: 0.5;
    }

    100% {
        transform: translateX(-50%) scale(1);
        opacity: 1;
    }
}

.MonteCarloView .zoom-control-toolbar {
    position: sticky;
    bottom: 0px;
    left: 0px;
    right: 0px;
    background: #F5F5F5;
    width: 100%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding-top: 5px;
    padding-bottom: 5px;
    padding-right: 10px;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
}

    .MonteCarloView .zoom-control-toolbar .btn {
        font-size: 14px;
        border-radius: 6px;
        padding: 3px 5px;
        margin-right: 5px;
        background: #4AAEE1;
        color: white;
        font-weight: 500;
    }

    .MonteCarloView .zoom-control-toolbar .slider {
        margin-left: 5px;
        margin-right: 10px;
    }

    .MonteCarloView .zoom-control-toolbar .percent-label {
        margin-bottom: 0px;
        margin-right: 10px;
        font-size: 14px;
    }

    .MonteCarloView .zoom-control-toolbar input {
        accent-color: #4AAEE1;
    }

@keyframes slideDown {
    0% {
        transform: translateY(-100%);
    }

    100% {
        transform: translateY(0%);
    }
}

.MonteCarlo-letter-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
}

    .MonteCarlo-letter-wrapper .MonteCarlo-letter-popout {
        background-color: white;
        padding: 2rem;
        border-radius: 4px;
        width: 90%;
        max-width: 600px;
        max-height: 90%;
        overflow-y: auto;
    }

    .MonteCarlo-letter-wrapper .MonteCarlo-letter-button {
        min-width: 100px;
        margin: 0 10px;
    }

    .MonteCarlo-letter-wrapper .button-wrapper {
        display: flex;
        justify-content: center;
        margin-top: 15px;
    }

    .MonteCarlo-letter-wrapper .form-group {
        margin-bottom: 1rem;
    }

    .MonteCarlo-letter-wrapper .form-check {
        margin-bottom: 0.5rem;
    }

.MonteCarlo-results.calculating {
    opacity: 0.7;
    transition: opacity 0.15s ease;
    pointer-events: none;
}

.MonteCarlo-calculating-text {
    font-size: 12px;
    color: #888;
    margin-left: 10px;
    display: inline-block;
}

.MonteCarloView .btn.btn-sm.btn-secondary,
.MonteCarloView .btn.btn-sm.btn-outline-danger {
    padding: 4px 12px;
    white-space: nowrap;
    width: auto;
    min-width: fit-content;
}
