/**
 * Popup Styles for Jewelry Pricing Engine - Professional & Clean
 */

/* Overlay */
.jpe-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

/* Popup Container */
.jpe-popup-container {
    background: #fff;
    width: 90%;
    max-width: 700px;
    border-radius: 24px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    overflow-y: auto;
    animation: jpeFadeIn 0.25s ease;
}

/* Header */
.jpe-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 28px;
    border-bottom: 1px solid #eef2f6;
    background: #fff;
    border-radius: 24px 24px 0 0;
}

.jpe-popup-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a1a2e;
}

.jpe-popup-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #aaa;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.jpe-popup-close:hover {
    background: #f5f5f5;
    color: #333;
}

/* Content */
.jpe-popup-content {
    padding: 28px;
}

/* Configuration Section */
.jpe-config-section {
    background: #f9fafc;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
}

/* Configuration Row */
.jpe-config-row {
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.jpe-config-row label {
    width: 100px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* Select dropdown - fixed padding for better visibility */
.jpe-config-row select {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    background: #fff;
    min-height: 40px;
    cursor: pointer;
}

/* Number inputs */
.jpe-config-row input[type="number"] {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    background: #fff;
    min-height: 40px;
}

.jpe-config-row select:focus,
.jpe-config-row input:focus {
    border-color: #3b82f6;
    outline: none;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

/* Weight Control - proper flex column */
.jpe-weight-control {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Weight input */
#jpe-weight {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    box-sizing: border-box;
}

/* Weight slider container - as requested */
#jpe-weight-slider {
    margin-top: 8px;
    display: flex;
    align-items: center;
    width: 100%;
}

/* jQuery UI Slider customization */
.ui-slider {
    background: #e2e8f0 !important;
    border: none !important;
    height: 6px !important;
    border-radius: 10px !important;
    width: 100% !important;
}

.ui-slider .ui-slider-handle {
    width: 18px !important;
    height: 18px !important;
    border-radius: 50% !important;
    background: #fff !important;
    border: 2px solid #3b82f6 !important;
    top: -6px !important;
    margin-left: -9px !important;
    cursor: pointer !important;
}

.ui-slider .ui-slider-handle:hover {
    transform: scale(1.15);
}

.ui-slider .ui-slider-range {
    background: #3b82f6 !important;
    height: 6px !important;
    border-radius: 10px !important;
}

/* Quantity input */
#jpe-quantity {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    background: #fff;
}

/* Price Breakdown Section */
.jpe-price-section {
    background: #f8fafc;
    border-radius: 16px;
    padding: 20px;
    margin: 20px 0;
}

.jpe-breakdown-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #edf2f7;
}

.jpe-breakdown-row.total {
    border-top: 2px solid #e2e8f0;
    border-bottom: none;
    margin-top: 8px;
    padding-top: 14px;
    font-weight: 700;
    font-size: 1.2rem;
}

/* Diamond Guide Button */
.jpe-diamond-guide-trigger {
    text-align: center;
    margin: 20px 0;
}

.jpe-diamond-guide-trigger button {
    background: transparent;
    border: 1px solid #3b82f6;
    color: #3b82f6;
    padding: 10px 24px;
    border-radius: 40px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.jpe-diamond-guide-trigger button:hover {
    background: #3b82f6;
    color: #fff;
}

/* Action Buttons */
.jpe-popup-actions {
    display: flex;
    gap: 16px;
    margin-top: 24px;
}

.jpe-popup-actions .button {
    flex: 1;
    text-align: center;
    padding: 12px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 40px;
    cursor: pointer;
    border: none;
}

.jpe-popup-actions .button-primary {
    background: #3b82f6;
    color: #fff;
}

.jpe-popup-actions .button-primary:hover {
    background: #2563eb;
}

.jpe-popup-actions .button:first-child {
    background: #f1f5f9;
    color: #334155;
}

.jpe-popup-actions .button:first-child:hover {
    background: #e2e8f0;
}

/* Lead Form Summary */
.jpe-lead-summary {
    background: #f0f9ff;
    border-left: 4px solid #3b82f6;
    padding: 16px 20px;
    margin-bottom: 20px;
    border-radius: 12px;
}

.jpe-lead-summary ul {
    margin: 0;
    padding-left: 20px;
    list-style: none;
}

/* Form Rows */
.jpe-form-row {
    margin-bottom: 18px;
}

.jpe-form-row label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}

.jpe-form-row input,
.jpe-form-row select,
.jpe-form-row textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    font-size: 0.9rem;
}

.jpe-form-row input:focus,
.jpe-form-row select:focus,
.jpe-form-row textarea:focus {
    border-color: #3b82f6;
    outline: none;
}

/* Form Actions */
.jpe-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    justify-content: center;
}

/* Message */
#jpe-lead-message {
    padding: 12px;
    border-radius: 12px;
    text-align: center;
    margin-top: 16px;
}

#jpe-lead-message.success {
    background: #dcfce7;
    color: #166534;
}

#jpe-lead-message.error {
    background: #fee2e2;
    color: #991b1b;
}

/* Loading State */
.jpe-loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.jpe-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: jpe-spin 0.6s linear infinite;
}

@keyframes jpe-spin {
    to { transform: rotate(360deg); }
}

@keyframes jpeFadeIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

/* Responsive */
@media (max-width: 640px) {
    .jpe-popup-container {
        width: 95%;
    }
    .jpe-popup-header {
        padding: 16px 20px;
    }
    .jpe-popup-header h2 {
        font-size: 1.3rem;
    }
    .jpe-popup-content {
        padding: 20px;
    }
    .jpe-config-row {
        flex-direction: column;
        align-items: stretch;
    }
    .jpe-config-row label {
        width: auto;
        margin-bottom: 4px;
    }
    .jpe-weight-control {
        width: 100%;
    }
    .jpe-popup-actions {
/*         flex-direction: column; */
        gap: 12px;
    }
    .ui-slider .ui-slider-handle {
        width: 24px !important;
        height: 24px !important;
        top: -9px !important;
        margin-left: -12px !important;
    }
}


.jpe-form-row input, .jpe-form-row select, .jpe-form-row textarea {

    padding: 2px 14px;

}

.button-primary {
    width: 50%;
}

.jpe-popup-close {
    width: 50%;
}


.btn-diamond {
    width: 70%;
    display: flex;
    justify-content: center;
    align-items: center;
}


.jpe-diamond-guide-actions {
    display: flex;
    justify-content: center;
}