/* Dark Theme VaR Calculator Plugin Styles with RTL Support */

.var-calculator-container {
    background-color: #1e1e1e /* Dark background */ !important;
    color: #f1f1f1; /* Light text */
    padding: 25px;
    border-radius: 8px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin-bottom: 20px;
    border: 1px solid #2c2c2c !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    direction: rtl;
}

.var-calculator-container h2,
.var-calculator-container h3,
.var-calculator-container h4 {
    color: #ffffff;
    font-weight: bold;
    margin-top: 0;
    margin-bottom: 15px;
    text-align: center;
}

.var-input-section,
.var-results-section {
    background-color: #2a2a2a;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 20px;
    border: 1px solid #3a3a3a;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
}

.var-calculator-container .form-group {
    margin-bottom: 15px;
}

.var-calculator-container label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #bbbbbb;
}

.var-calculator-container input[type="file"],
.var-calculator-container input[type="number"],
.var-calculator-container select {
    width: 100%;
    padding: 10px;
    background-color: #1e1e1e !important;
    border: 1px solid #444;
    color: #ffffff;
    border-radius: 4px;
    box-sizing: border-box;
}

.var-calculator-container input[type="file"] {
    padding: 5px;
    color-scheme: dark;
}

.var-calculator-container .form-group small {
    display: block;
    margin-top: 5px;
    font-size: 0.85em;
    color: #888888;
}

.var-calculator-container .radio-group label {
    display: inline-block;
    margin-right: 15px;
    font-weight: normal;
    color: #cccccc;
}

.var-calculator-container .radio-group input[type="radio"] {
    margin-right: 5px;
    vertical-align: middle;
}

.var-calculator-container .btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    text-align: center;
    display: inline-block;
    margin-top: 10px;
    transition: background-color 0.3s ease;
}

.var-calculator-container .btn-primary {
    background-color: #0099ff;
    color: #ffffff;
}

.var-calculator-container .btn-primary:hover {
    background-color: #007acc;
}

.var-calculator-container .btn-secondary {
    background-color: #333;
    color: #0099ff;
    border: 1px solid #0099ff;
}

.var-calculator-container .btn-secondary:hover {
    background-color: #444;
}

.var-calculator-container .loading-message {
    margin-top: 15px;
    color: #00bfff;
    font-style: italic;
}

.var-calculator-container .error-message {
    margin-top: 15px;
    color: #ff4d4d;
    background-color: #331111;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #ff4d4d;
}

.var-results-section .results-summary {
    margin-bottom: 20px;
}

.var-results-section .results-summary h3 {
    border-bottom: 2px solid #0099ff;
    padding-bottom: 8px;
    margin-bottom: 15px;
    color: #ffffff;
}

.var-results-section .results-summary p {
    margin: 8px 0;
    font-size: 1.1em;
    line-height: 1.5;
}

.var-results-section .results-summary strong {
    color: #00bfff;
    font-weight: bold;
}

.var-results-section .results-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    color: #dddddd;
}

.var-results-section .results-table th,
.var-results-section .results-table td {
    padding: 10px;
    text-align: right;
    border-bottom: 1px solid #444;
}

.var-results-section .results-table th {
    background-color: #2a2a2a;
    color: #00bfff;
    font-weight: bold;
}

.var-results-section .results-table tr:nth-child(even) {
    background-color: #1e1e1e;
}

.var-results-section .chart-container {
    margin-top: 20px;
    margin-bottom: 20px;
    background-color: #1e1e1e;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #444;
}

.var-results-section .chart-title {
    text-align: center;
    color: #00bfff;
    margin-bottom: 10px;
    font-weight: bold;
}

.var-results-section .signature-area {
    margin-top: 30px;
    border-top: 1px dashed #444;
    padding-top: 15px;
}

.var-results-section .signature-line {
    display: inline-block;
    width: 200px;
    border-bottom: 1px solid #ffffff;
    margin-top: 30px;
}

/* Print Styles */
@media print {
    body * {
        visibility: hidden;
    }
    .var-results-section, .var-results-section * {
        visibility: visible;
    }
    .var-results-section {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        border: none;
        padding: 20px;
        margin: 0;
        background-color: #ffffff !important;
        color: #000000 !important;
    }
    .var-results-section h3,
    .var-results-section h4,
    .var-results-section p,
    .var-results-section strong,
    .var-results-section span {
        color: #000000 !important;
    }
    .var-results-section .chart-container {
        background-color: #ffffff !important;
        border: 1px solid #cccccc;
        padding: 10px;
        page-break-inside: avoid;
    }
    .var-results-section .results-table th {
        background-color: #f0f0f0 !important;
        color: #000000 !important;
    }
    .var-results-section .results-table tr:nth-child(even) {
        background-color: #f9f9f9 !important;
    }
    #print-results-btn {
        display: none;
    }
    .var-results-section .signature-area {
        margin-top: 50px;
    }
    @page {
        size: A4;
        margin: 1cm;
    }
}
