/* Public-facing styles for the WooCommerce Installment Calculator plugin */
:root {
    --wic-primary-color: #0073aa;
    --wic-success-color: #28a745; /* Default for WhatsApp and prices */
    --wic-contact-button-color: #28a745; /* Color for the contact button, can be overridden */
    --wic-danger-color: #d9534f;
    --wic-warning-color: #ffc107;
    --wic-light-bg: #f8f9fa;
    --wic-border-color: #dee2e6;
}

.wic-info-container {
    direction: rtl;
    background: var(--wic-light-bg);
    border: 1px solid var(--wic-border-color);
    padding: 20px 25px;
    margin-top: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.wic-summary {
    display: flex;
    justify-content: space-around;
    align-items: baseline;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.wic-summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.4;
}

.wic-summary-item .label {
    font-size: 14px;
    color: #555;
}

.wic-summary-item .value {
    font-size: 20px;
    font-weight: bold;
    color: #333;
}

.wic-summary-item .value.primary {
    color: var(--wic-success-color);
    font-size: 22px;
}

/* --- New Slider Styles --- */
.wic-slider-container {
    margin: 0 auto 20px;
    max-width: 90%;
}

.wic-slider-label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 12px;
}

.wic-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: #ddd;
    outline: none;
    opacity: 0.9;
    -webkit-transition: .2s;
    transition: opacity .2s;
    border-radius: 5px;
    direction: ltr; /* Slider direction must be LTR */
}

.wic-slider:hover {
    opacity: 1;
}

.wic-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--wic-success-color);
    cursor: pointer;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 5px rgba(0,0,0,0.2);
}

.wic-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--wic-success-color);
    cursor: pointer;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 5px rgba(0,0,0,0.2);
}
/* --- End Slider Styles --- */


.wic-buttons-wrapper {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.wic-buttons-wrapper.wic-single-button-wrapper {
    justify-content: center;
}

.wic-calc-button {
    flex: 1;
    transition: all 0.3s ease !important;
    padding: 12px !important;
    font-size: 15px !important;
    font-weight: bold !important;
    border-radius: 8px !important;
    line-height: 1.5 !important;
}

.wic-calc-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.wic-buttons-wrapper.wic-single-button-wrapper .wic-calc-button {
    flex-grow: 1;
    width: 100%;
    max-width: 100%;
    background-color: transparent !important;
    color: #555 !important;
    border: 1px solid #ddd !important;
    font-weight: normal !important;
    border-radius: 4px !important;
    box-shadow: none !important;
}

.wic-buttons-wrapper.wic-single-button-wrapper .wic-calc-button:hover {
     background-color: #f9f9f9 !important;
     color: #222 !important;
     transform: none !important;
     box-shadow: none !important;
     filter: none;
}

.wic-calc-button.whatsapp,
.wic-calc-button.telegram,
.wic-calc-button.woocommerce-checkout,
.wic-calc-button.custom-messenger {
    background-color: var(--wic-contact-button-color) !important;
    border-color: var(--wic-contact-button-color) !important;
    color: #fff !important;
}

.wic-calc-button.whatsapp:hover,
.wic-calc-button.telegram:hover,
.wic-calc-button.woocommerce-checkout:hover,
.wic-calc-button.custom-messenger:hover {
    filter: brightness(90%);
}

.wic-calc-button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    transform: none !important;
    box-shadow: none !important;
}

.wic-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.wic-modal.active {
    display: flex;
    opacity: 1;
}

.wic-modal-content {
    direction: rtl;
    background-color: #fff;
    width: 90%;
    max-width: 550px;
    border-radius: 12px;
    position: relative;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.wic-modal.active .wic-modal-content {
    transform: scale(1);
}

.wic-modal-header {
    background-color: var(--wic-light-bg);
    padding: 15px 25px;
    border-bottom: 1px solid var(--wic-border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wic-modal-header h3 { margin: 0; font-size: 18px; color: #333; }
.wic-modal-close { color: #888; font-size: 32px; font-weight: normal; cursor: pointer; line-height: 1; transition: color 0.2s; }
.wic-modal-close:hover { color: #333; }
.wic-modal-body { padding: 15px 25px 25px; }
.wic-results-wrapper { margin-top: 0; }

.wic-result-item {
    display: flex;
    justify-content: space-between;
    padding: 16px 10px;
    border-bottom: 1px solid #f1f1f1;
    font-size: 15px;
}

.wic-result-item:nth-child(even) { background-color: #f9f9f9; }
.wic-result-item:last-child { border-bottom: none; }
.wic-result-item.total { font-weight: bold; background-color: #e9f5ff; border-top: 2px solid var(--wic-primary-color); padding-top: 16px; margin-top: 10px; }
.wic-result-item .label { color: #444; }
.wic-result-item .value { color: #005a87; font-weight: 600; }
.wic-result-item .value.primary { color: var(--wic-success-color); }
.wic-result-item .value.interest { color: var(--wic-danger-color); }

/* Status Badges */
.wic-status-badge { display: inline-block; padding: .25em .6em; font-size: 75%; font-weight: 700; line-height: 1; text-align: center; white-space: nowrap; vertical-align: baseline; border-radius: .25rem; color: #fff; }
.wic-status-badge.status-paid { background-color: var(--wic-success-color); }
.wic-status-badge.status-unpaid { background-color: var(--wic-danger-color); }
.wic-status-badge.status-pending_approval { background-color: var(--wic-warning-color); color: #212529; }

/* Payment Button */
.wic-pay-button {
    padding: 6px 12px !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
    border-radius: 4px !important;
}

/* Document Upload Form */
.wic-document-upload-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--wic-border-color);
}

.wic-document-upload-form {
    margin-top: 15px;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #fafafa;
}

.wic-upload-field {
    margin-bottom: 20px;
}

.wic-upload-field label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
}

.wic-upload-field .wic-file-input {
    width: 100%;
}

.wic-uploaded-file {
    font-size: 0.9em;
    color: #008000;
    margin-top: 5px;
}
.wic-uploaded-file a {
    text-decoration: none;
    font-weight: bold;
}
