/**
 * CBS Per Meter Pricing - Premium Frontend Styling
 */

/* Container wrapper */
.cbs-pmp-container {
    margin: 20px 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cbs-pmp-container:hover {
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.05);
}

/* Notice Block */
.cbs-pmp-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(99, 102, 241, 0.06);
    border-left: 4px solid #6366f1;
    border-radius: 4px 12px 12px 4px;
    font-size: 14px;
    color: #312e81;
    margin-bottom: 20px;
    line-height: 1.4;
}

.cbs-pmp-icon {
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Controls Wrapper */
.cbs-pmp-controls-wrapper {
    margin-bottom: 20px;
}

.cbs-pmp-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cbs-pmp-row {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

/* Slider column styles */
.cbs-pmp-slider-col {
    flex: 1;
    min-width: 200px;
    display: flex;
    align-items: center;
}

/* Custom range slider styling */
.cbs-pmp-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 9999px;
    background: #e2e8f0;
    outline: none;
    transition: background 0.3s;
}

/* Webkit browser thumb */
.cbs-pmp-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    cursor: pointer;
    box-shadow: 0 0 0 0px rgba(99, 102, 241, 0.4);
    transition: transform 0.1s ease, box-shadow 0.2s ease;
    border: 2px solid #ffffff;
}

.cbs-pmp-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 0 0 6px rgba(99, 102, 241, 0.2);
}

.cbs-pmp-slider::-webkit-slider-thumb:active {
    transform: scale(0.95);
    box-shadow: 0 0 0 8px rgba(99, 102, 241, 0.3);
}

/* Mozilla Firefox thumb */
.cbs-pmp-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    cursor: pointer;
    box-shadow: 0 0 0 0px rgba(99, 102, 241, 0.4);
    transition: transform 0.1s ease, box-shadow 0.2s ease;
}

.cbs-pmp-slider::-moz-range-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 0 0 6px rgba(99, 102, 241, 0.2);
}

.cbs-pmp-slider::-moz-range-thumb:active {
    transform: scale(0.95);
    box-shadow: 0 0 0 8px rgba(99, 102, 241, 0.3);
}

/* Number input column styles */
.cbs-pmp-input-col {
    display: flex;
    align-items: center;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
    overflow: hidden;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.cbs-pmp-input-col:focus-within {
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.cbs-pmp-input {
    width: 70px !important;
    height: 44px !important;
    padding: 0 0 0 14px !important;
    border: none !important;
    outline: none !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    background: transparent !important;
    -moz-appearance: textfield !important;
    text-align: center !important;
}

.cbs-pmp-input::-webkit-outer-spin-button,
.cbs-pmp-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.cbs-pmp-unit-badge {
    padding: 0 14px;
    height: 44px;
    display: flex;
    align-items: center;
    background: #f8fafc;
    color: #64748b;
    font-weight: 600;
    font-size: 14px;
    border-left: 1px solid #e2e8f0;
}

/* Price estimation preview panel (Glassmorphic) */
.cbs-pmp-live-price-box {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.8) 100%);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 4px 12px rgba(99, 102, 241, 0.03);
    position: relative;
    overflow: hidden;
}

/* Subtle background accent glow */
.cbs-pmp-live-price-box::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, rgba(255, 255, 255, 0) 70%);
    pointer-events: none;
}

.cbs-pmp-price-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.cbs-pmp-preview-label {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
}

.cbs-pmp-preview-value {
    font-size: 22px;
    font-weight: 800;
    color: #4f46e5;
    transition: opacity 0.15s ease-in-out;
}

.cbs-pmp-formula-row {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 500;
}

.cbs-pmp-price-suffix {
    font-size: 0.65em;
    font-weight: 500;
    color: #64748b;
    margin-left: 2px;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .cbs-pmp-container {
        padding: 15px;
    }
    .cbs-pmp-row {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    .cbs-pmp-input-col {
        justify-content: space-between;
    }
    .cbs-pmp-input {
        flex: 1;
    }
}
