/**
 * Frontend styles for Stebel AmCreate Improvements
 */

/* Validation error message styling - using specificity instead of !important */
body .woocommerce .stebel-validation-error,
body .stebel-validation-error {
    background: #ffcfe4;
    color: #b25b85;
    padding: 10px 15px;
    margin: 10px 0;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
}

/* Remove automatic icon since message includes custom emoji */

/* Success state styling */
body .woocommerce .stebel-validation-success,
body .stebel-validation-success {
    background: #d4edda;
    color: #155724;
    padding: 10px 15px;
    margin: 10px 0;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.4;
    display: block;
}

.stebel-validation-success:before {
    content: "✓ ";
    font-weight: bold;
}

/* Resolution warning styling */
body .woocommerce .stebel-resolution-warning,
body .stebel-resolution-warning {
    background: #ffec99;
    color: #8c7100;
    padding: 10px 15px;
    margin: 10px 0;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
    display: block;
}

/* Bold styling for strong elements in messages */
body .woocommerce .stebel-validation-error strong,
body .stebel-validation-error strong,
body .woocommerce .stebel-resolution-warning strong,
body .stebel-resolution-warning strong {
    font-weight: 600;
}

/* Disable add to cart button when validation fails */
.single_add_to_cart_button:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
}

/* Highlight required fields */
.stebel-field-required {
    border: 2px solid #dc3545 !important;
    box-shadow: 0 0 5px rgba(220, 53, 69, 0.3) !important;
}

.stebel-field-valid {
    border: 2px solid #28a745 !important;
    box-shadow: 0 0 5px rgba(40, 167, 69, 0.3) !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .stebel-validation-error,
    .stebel-validation-success,
    .stebel-resolution-warning {
        padding: 8px 12px !important;
        font-size: 13px !important;
        margin: 8px 0 !important;
    }
}

/* Integration with common themes */
.woocommerce .stebel-validation-error,
.woocommerce .stebel-resolution-warning {
    margin-bottom: 1em !important;
}

/* Ensure visibility over other elements */
.stebel-validation-error,
.stebel-validation-success,
.stebel-resolution-warning {
    position: relative !important;
    z-index: 10 !important;
}

/* Hidden state - very aggressive override */
.stebel-validation-error.hidden,
.stebel-validation-success.hidden,
.stebel-resolution-warning.hidden,
.stebel-validation-error[style*="display: none"],
.stebel-validation-error[style*="visibility: hidden"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Show error when validation fails - high specificity but cleaner */
body .woocommerce .stebel-validation-error.validation-failed,
body .stebel-validation-error.validation-failed {
    display: block;
}

/* Hide error when validation passes - high specificity for reliable hiding */
body .woocommerce .stebel-validation-error.validation-passed,
body .stebel-validation-error.validation-passed {
    display: none;
    visibility: hidden;
    opacity: 0;
    height: 0;
}