/**
 * Enhanced CSS for JSON Product Configurator
 * This provides professional styling for the parameter selection interface
 */

.json-configurator {
    margin: 30px 0;
    padding: 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
}

.json-configurator h3 {
    margin-bottom: 20px;
    color: #495057;
    font-size: 1.4em;
    font-weight: 600;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

.json-parameter {
    margin-bottom: 20px;
    padding: 15px;
    background: #ffffff;
    border: 1px solid #e3e6ea;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.json-parameter:hover {
    border-color: #0073aa;
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.1);
}

.json-param-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 1.1em;
}

.json-param-label strong {
    color: #0073aa;
}

.json-param-description {
    display: block;
    font-size: 0.9em;
    color: #6c757d;
    font-weight: 400;
    margin-top: 5px;
    font-style: italic;
}

.json-param-select,
.json-param-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #ced4da;
    border-radius: 6px;
    font-size: 15px;
    background-color: #ffffff;
    transition: all 0.3s ease;
}

.json-param-select:focus,
.json-param-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.json-param-select:hover,
.json-param-input:hover {
    border-color: #adb5bd;
}

/* Price Display Styling */
.json-price-display {
    margin-top: 25px;
    padding: 20px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid #0073aa;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.15);
}

.price-breakdown {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.base-price {
    margin-bottom: 15px;
    color: #6c757d;
    font-size: 1.1em;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.price-modifiers {
    margin: 15px 0;
    font-size: 0.95em;
}

.price-modifier {
    padding: 6px 12px;
    margin: 4px 0;
    border-radius: 5px;
    background-color: #f8f9fa;
    border-left: 4px solid transparent;
    transition: all 0.2s ease;
}

.price-modifier.positive {
    color: #dc3545;
    background-color: #fff5f5;
    border-left-color: #dc3545;
}

.price-modifier.negative {
    color: #28a745;
    background-color: #f0fff4;
    border-left-color: #28a745;
}

.total-price {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px solid #0073aa;
    font-size: 1.4em;
    font-weight: 700;
    color: #0073aa;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .json-configurator {
        margin: 15px 0;
        padding: 15px;
    }
    
    .json-parameter {
        margin-bottom: 15px;
        padding: 12px;
    }
    
    .json-param-select,
    .json-param-input {
        padding: 10px 12px;
    }
    
    .json-price-display {
        padding: 15px;
    }
    
    .total-price {
        font-size: 1.2em;
    }
}

/* Animation for price updates */
.json-price-display.updating {
    opacity: 0.7;
    transform: scale(0.98);
}

.json-price-display.updated {
    opacity: 1;
    transform: scale(1);
    animation: priceUpdate 0.3s ease;
}

@keyframes priceUpdate {
    0% {
        background-color: #e7f3ff;
    }
    100% {
        background-color: #ffffff;
    }
}

/* Loading state */
.json-configurator.loading {
    position: relative;
    pointer-events: none;
}

.json-configurator.loading::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    z-index: 10;
}

/* Input validation styling */
.json-param-input.invalid {
    border-color: #dc3545;
    background-color: #fff5f5;
}

.json-param-input.valid {
    border-color: #28a745;
    background-color: #f0fff4;
}

/* Quantity input special styling */
.json-parameter[data-param-type="quantity"] {
    border-left: 4px solid #ffc107;
    background: linear-gradient(135deg, #fffaf0 0%, #ffffff 100%);
}

.json-parameter[data-param-type="quantity"] .json-param-label::before {
    content: "📊 ";
    margin-right: 5px;
}

/* Premium options highlighting */
.json-param-select option[data-price-modifier]:not([data-price-modifier="0"]) {
    font-weight: 600;
}

/* Accessibility improvements */
.json-configurator *:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.json-configurator .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}