/* Conditional Logic Frontend Styles */
.wc-specialitypao-addon-container.has-conditional-logic {
    transition: all 0.4s ease;
}

.wc-specialitypao-addon-container.wc-conditional-hidden {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
    border: none;
}

/* Smooth transitions for showing/hiding fields */
.wc-specialitypao-addon-container {
    transition: opacity 0.4s ease, max-height 0.4s ease, margin 0.4s ease, padding 0.4s ease;
}

/* Style for disabled fields while transitioning */
.wc-specialitypao-addon-container.wc-conditional-hidden input,
.wc-specialitypao-addon-container.wc-conditional-hidden select,
.wc-specialitypao-addon-container.wc-conditional-hidden textarea {
    pointer-events: none;
    opacity: 0.5;
}

/* Subtle indicator for conditional fields */
.wc-specialitypao-addon-container.has-conditional-logic::before {
    content: "🔗";
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 12px;
    opacity: 0.3;
    pointer-events: none;
}

/* Loading state for conditional evaluations */
.wc-specialitypao-addon-container.evaluating-conditions {
    position: relative;
}

.wc-specialitypao-addon-container.evaluating-conditions::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}

/* Debug mode styles (only when ?conditional_debug=1) */
body.conditional-debug .wc-specialitypao-addon-container.has-conditional-logic {
    border: 2px dashed #0073aa;
    position: relative;
}

body.conditional-debug .wc-specialitypao-addon-container.has-conditional-logic::after {
    content: "Conditional Field";
    position: absolute;
    top: -10px;
    left: 10px;
    background: #0073aa;
    color: white;
    padding: 2px 8px;
    font-size: 10px;
    border-radius: 3px;
}

body.conditional-debug .wc-specialitypao-addon-container.wc-conditional-hidden::after {
    content: "Hidden by Conditions";
    background: #dc3232;
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .wc-specialitypao-addon-container,
    .wc-specialitypao-addon-container.has-conditional-logic {
        transition: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .wc-specialitypao-addon-container.has-conditional-logic::before {
        opacity: 1;
        color: #000;
    }
    
    .wc-specialitypao-addon-container.wc-conditional-hidden {
        border: 2px solid #dc3232;
    }
}