/* Calculator Styles - Shared styles for all calculator pages */

/* Assumption Banner */
.assumption-banner {
    background-color: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 15px;
    margin: 20px auto;
    max-width: 1600px;
    text-align: center;
    box-sizing: border-box;
}

.assumption-banner p {
    color: #ffffff;
    margin: 0;
    font-size: 16px;
}

/* Configuration Form */
.loan-calc-config,
.back-test-config {
    background-color: #1a1a1a;
    padding: 30px;
    margin: 20px auto;
    border-radius: 8px;
    max-width: 1600px;
    font-size: 18px;
    box-sizing: border-box;
}

.config-row {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
    box-sizing: border-box;
}

.config-item {
    flex: 1;
}

.config-item label {
    display: block;
    margin-bottom: 8px;
    color: #ffffff;
    font-weight: bold;
    font-size: 20px;
}

.config-item input,
.config-item select {
    width: 100%;
    padding: 12px;
    background-color: #2a2a2a;
    border: 1px solid #444;
    border-radius: 4px;
    color: #ffffff;
    font-size: 18px;
}

.readonly-field {
    background-color: #333 !important;
    color: #888 !important;
    cursor: not-allowed;
}

.price-input-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

.price-input-container input {
    flex: 1;
}

.current-price-btn {
    background-color: #007BFF;
    color: white;
    padding: 12px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    white-space: nowrap;
}

.current-price-btn:hover {
    background-color: #0056b3;
}

/* Advanced Options */
.advanced-section {
    margin-top: 30px;
    border-top: 1px solid #444;
    padding-top: 20px;
}

.advanced-toggle {
    background: none;
    border: none;
    color: #007BFF;
    cursor: pointer;
    font-size: 16px;
    padding: 10px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.advanced-toggle:hover {
    color: #0056b3;
}

.toggle-icon {
    transition: transform 0.3s ease;
}

.advanced-toggle.expanded .toggle-icon {
    transform: rotate(180deg);
}

.advanced-options {
    margin-top: 20px;
    padding: 20px;
    background-color: #2a2a2a;
    border-radius: 8px;
}

.advanced-row {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
}

.advanced-item {
    flex: 1;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: #ffffff;
    font-size: 16px;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #444;
    border-radius: 4px;
    position: relative;
    background-color: #2a2a2a;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background-color: #007BFF;
    border-color: #007BFF;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
}

/* Configuration Buttons */
.config-buttons {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.config-button {
    background-color: #007BFF;
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 18px;
}

.config-button:hover {
    background-color: #0056b3;
}

.config-button.active {
    background-color: #0056b3;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 4px solid #007BFF;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#loading {
    font-size: 20px;
    color: #ffffff;
}

/* Summary Section */
.summary-section {
    margin: 30px auto;
    max-width: 1600px;
}

.summary-cards {
    display: flex;
    gap: 30px;
}

.summary-card {
    flex: 1;
    background-color: #1a1a1a;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 25px;
}

.summary-header {
    margin-bottom: 20px;
    border-bottom: 1px solid #444;
    padding-bottom: 15px;
}

.summary-header h3 {
    margin: 0;
    font-size: 22px;
    font-weight: bold;
}

.summary-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary-total {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #444;
}

.summary-total .summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary-label {
    color: #ffffff;
    font-size: 16px;
}

.summary-value {
    color: #ffffff;
    font-size: 16px;
    font-weight: bold;
}

/* Modal Styles */
.subscription-modulepopup {
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 0;
    max-width: 400px;
}

.modal-content {
    padding: 30px;
    position: relative;
}

.close-x {
    position: absolute;
    right: 15px;
    top: 15px;
    cursor: pointer;
}

.x-text {
    color: #fff;
    font-size: 24px;
    font-weight: bold;
}

.modal_alert_text {
    text-align: center;
    color: #fff;
}

.modal_alert_text h3 {
    font-size: 24px;
    margin-bottom: 15px;
}

.modal_alert_text p {
    font-size: 16px;
    margin-bottom: 25px;
    line-height: 1.5;
}

.upgrade-button {
    display: inline-block;
    background-color: #f2a900;
    color: #000;
    padding: 12px 30px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    font-size: 16px;
    transition: background-color 0.2s;
}

.upgrade-button:hover {
    background-color: #d99a00;
}

/* Switch and Toggle Styles */
.switch-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin-top: 20px;
}

.switch-text {
    color: #ffffff;
    font-weight: bold;
    font-size: 20px;
}

#capitalGainsInput {
    transition: all 0.3s ease;
}

#capitalGainsInput input {
    width: 100%;
    padding: 12px;
    background-color: #2a2a2a;
    border: 1px solid #444;
    border-radius: 4px;
    color: #ffffff;
    font-size: 18px;
}

/* Back Test Calculator Specific Styles */
#indicatorsContainer {
    max-height: 400px;
    overflow-y: auto;
    box-sizing: border-box;
    margin-bottom: 20px;
}

#indicatorsContainer::-webkit-scrollbar {
    width: 8px;
}

#indicatorsContainer::-webkit-scrollbar-track {
    background: #2a2a2a;
    border-radius: 4px;
}

#indicatorsContainer::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

#indicatorsContainer::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.indicator-row {
    display: flex;
    gap: 30px;
    align-items: flex-end;
    margin-bottom: 20px;
    padding: 20px;
    background-color: #2a2a2a;
    border-radius: 8px;
    border: 1px solid #444;
}

.remove-indicator {
    background-color: #dc3545 !important;
    padding: 12px 20px !important;
    font-size: 16px !important;
    align-self: flex-end;
}

.remove-indicator:hover {
    background-color: #c82333 !important;
}

/* Mobile Styles */
@media screen and (max-width: 768px) {
    .loan-calc-config,
    .back-test-config {
        padding: 15px;
        margin: 10px;
        font-size: 16px;
    }

    .config-row {
        flex-direction: column;
        gap: 15px;
    }

    .config-item {
        width: 100%;
    }

    .config-item label {
        font-size: 16px;
        margin-bottom: 5px;
    }

    .config-item input,
    .config-item select {
        padding: 10px;
        font-size: 16px;
    }

    .config-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .config-button {
        width: 100%;
        padding: 12px 20px;
        font-size: 16px;
    }

    .advanced-row {
        flex-direction: column;
        gap: 15px;
    }

    .price-input-container {
        flex-direction: column;
        gap: 10px;
    }

    .current-price-btn {
        width: 100%;
        padding: 10px;
        font-size: 16px;
    }

    /* Back Test Calculator Mobile Styles */
    .indicator-row {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }

    .remove-indicator {
        width: 100%;
        margin-top: 10px;
    }

    #indicatorsContainer {
        max-height: none;
        overflow-y: visible;
    }

    /* Mobile Styles for Summary */
    .summary-cards {
        flex-direction: column;
        gap: 20px;
    }

    .summary-card {
        padding: 20px;
    }

    .summary-header h3 {
        font-size: 20px;
    }

    .summary-label,
    .summary-value {
        font-size: 14px;
    }

    .summary-total .summary-value {
        font-size: 20px;
    }
}
