/**
 * Enhanced Enquiry Frontend Styles
 * Advanced Enquiry Form with Dynamic Fields
 */

/* Enhanced Enquiry Form Container */
.lpsm-enhanced-enquiry-form {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.lpsm-enhanced-enquiry-form h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 28px;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Form Sections */
.lpsm-form-section {
    margin-bottom: 40px;
    padding: 25px;
    background: #fafafa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    position: relative;
}

.lpsm-form-section h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.lpsm-form-section h3::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Form Fields */
.lpsm-form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.lpsm-form-row.two-column {
    grid-template-columns: 1fr 1fr;
}

.lpsm-field-group {
    position: relative;
}

.lpsm-field-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
    font-size: 14px;
    transition: color 0.3s ease;
}

.lpsm-field-group label.required::after {
    content: ' *';
    color: #e74c3c;
    font-weight: bold;
}

.lpsm-field-group input[type="text"],
.lpsm-field-group input[type="email"],
.lpsm-field-group input[type="tel"],
.lpsm-field-group input[type="date"],
.lpsm-field-group input[type="time"],
.lpsm-field-group input[type="number"],
.lpsm-field-group select,
.lpsm-field-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    line-height: 1.5;
    background: #fff;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.lpsm-field-group input:focus,
.lpsm-field-group select:focus,
.lpsm-field-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.lpsm-field-group textarea {
    min-height: 120px;
    resize: vertical;
}

/* Radio Buttons */
.lpsm-radio-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.lpsm-radio-option {
    position: relative;
}

.lpsm-radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.lpsm-radio-option label {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
    font-weight: 500;
    margin-bottom: 0;
}

.lpsm-radio-option label::before {
    content: '';
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #e1e5e9;
    margin-right: 12px;
    transition: all 0.3s ease;
    background: #fff;
    flex-shrink: 0;
}

.lpsm-radio-option input[type="radio"]:checked + label {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
    color: #667eea;
}

.lpsm-radio-option input[type="radio"]:checked + label::before {
    border-color: #667eea;
    background: #667eea;
    box-shadow: inset 0 0 0 3px #fff;
}

.lpsm-radio-option label:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.02);
}

/* Checkboxes */
.lpsm-checkbox-group {
    margin-top: 10px;
}

.lpsm-checkbox-option {
    position: relative;
    margin-bottom: 15px;
}

.lpsm-checkbox-option input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.lpsm-checkbox-option label {
    padding: 16px 20px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
    font-weight: 500;
    line-height: 1.5;
    margin-bottom: 0;
}

.lpsm-checkbox-option label::before {
    content: '';
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid #e1e5e9;
    margin-right: 12px;
    transition: all 0.3s ease;
    background: #fff;
    flex-shrink: 0;
    margin-top: 2px;
}

.lpsm-checkbox-option input[type="checkbox"]:checked + label {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
    color: #667eea;
}

.lpsm-checkbox-option input[type="checkbox"]:checked + label::before {
    border-color: #667eea;
    background: #667eea;
    background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='m13.854 3.646-7.5 7.5a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6 10.293l7.146-7.147a.5.5 0 0 1 .708.708z'/%3e%3c/svg%3e");
}

.lpsm-checkbox-option label:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.02);
}

/* Conditional Fields */
.lpsm-conditional-field {
    margin-top: 20px;
    padding: 20px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 8px;
    border-left: 4px solid #667eea;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.4s ease;
}

.lpsm-conditional-field.show {
    opacity: 1;
    max-height: 1000px;
    margin-top: 20px;
}

/* Sibling Repeater Fields */
.lpsm-sibling-repeater {
    margin-top: 20px;
}

.lpsm-sibling-item {
    padding: 20px;
    margin-bottom: 15px;
    background: #fff;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    position: relative;
}

.lpsm-sibling-item h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.lpsm-remove-sibling {
    background: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lpsm-remove-sibling:hover {
    background: #c0392b;
    transform: translateY(-1px);
}

.lpsm-add-sibling {
    background: #27ae60;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lpsm-add-sibling:hover {
    background: #229954;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

.lpsm-add-sibling::before {
    content: '+';
    font-size: 18px;
    font-weight: bold;
}

/* Submit Button */
.lpsm-submit-section {
    text-align: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e1e5e9;
}

.lpsm-submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 16px 40px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.lpsm-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.lpsm-submit-btn:active {
    transform: translateY(0);
}

.lpsm-submit-btn.loading {
    pointer-events: none;
    opacity: 0.8;
}

.lpsm-submit-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Progress Indicator */
.lpsm-progress-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(102, 126, 234, 0.2);
    z-index: 9999;
}

.lpsm-progress-bar {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.3s ease;
}

/* Messages */
.lpsm-message {
    padding: 16px 20px;
    margin: 20px 0;
    border-radius: 8px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
}

.lpsm-message.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.lpsm-message.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.lpsm-message.info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.lpsm-message::before {
    content: '';
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
}

.lpsm-message.success::before {
    background: #28a745;
    background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='m13.854 3.646-7.5 7.5a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6 10.293l7.146-7.147a.5.5 0 0 1 .708.708z'/%3e%3c/svg%3e");
}

.lpsm-message.error::before {
    background: #dc3545;
    background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

.lpsm-message.info::before {
    background: #17a2b8;
    background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='m8.93 6.588-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533L8.93 6.588zM9 4.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0z'/%3e%3c/svg%3e");
}

/* Field Validation */
.lpsm-field-group.error input,
.lpsm-field-group.error select,
.lpsm-field-group.error textarea {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.lpsm-field-group.error label {
    color: #e74c3c;
}

.lpsm-field-error {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.lpsm-field-error::before {
    content: '⚠';
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .lpsm-enhanced-enquiry-form {
        padding: 20px;
        margin: 10px;
    }
    
    .lpsm-form-row.two-column {
        grid-template-columns: 1fr;
    }
    
    .lpsm-radio-group {
        grid-template-columns: 1fr;
    }
    
    .lpsm-form-section {
        padding: 20px;
    }
    
    .lpsm-submit-btn {
        width: 100%;
        padding: 16px 20px;
    }
}

@media (max-width: 480px) {
    .lpsm-enhanced-enquiry-form {
        padding: 15px;
        margin: 5px;
    }
    
    .lpsm-form-section {
        padding: 15px;
    }
    
    .lpsm-enhanced-enquiry-form h2 {
        font-size: 24px;
    }
    
    .lpsm-form-section h3 {
        font-size: 18px;
    }
}

/* Traffic Light System Styles */
.lpsm-traffic-light-display {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    margin-bottom: 20px;
}

.lpsm-traffic-light-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.lpsm-traffic-light-item {
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.lpsm-traffic-light-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #e9ecef;
}

.lpsm-traffic-light-item.red::before { background: #f44336; }
.lpsm-traffic-light-item.amber::before { background: #f5b819; }
.lpsm-traffic-light-item.green::before { background: #4caf50; }
.lpsm-traffic-light-item.blue::before { background: #2196f3; }
.lpsm-traffic-light-item.gray::before { background: #9e9e9e; }

.lpsm-traffic-light-label {
    font-size: 12px;
    margin-bottom: 4px;
    font-weight: 600;
    color: #333;
}

.lpsm-traffic-light-status {
    display: block;
    font-weight: 500;
    color: #555;
    margin-bottom: 4px;
    font-size: 11px;
    text-transform: capitalize;
}

.lpsm-traffic-light-date {
    font-size: 9px;
    opacity: 0.8;
    color: #666;
}

.lpsm-traffic-light-actions {
    text-align: center;
    margin-top: 15px;
}

/* Status Badge Styles */
.status-badge-inline {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    color: white;
    text-transform: uppercase;
    margin: 2px;
}

.status-section-inline {
    flex: 1;
    min-width: 200px;
}

.status-section-inline h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.status-items-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

/* Traffic Light Dots */
.lpsm-traffic-light-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-block;
    cursor: help;
    border: 2px solid rgba(0,0,0,0.2);
    transition: transform 0.2s ease;
    margin: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.lpsm-traffic-light-dot:hover {
    transform: scale(1.2);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Print Styles */
@media print {
    .lpsm-submit-section,
    .lpsm-progress-indicator {
        display: none;
    }
    
    .lpsm-enhanced-enquiry-form {
        box-shadow: none;
        border: 1px solid #333;
    }
    
    .lpsm-form-section {
        background: #fff;
        border: 1px solid #333;
    }
}