/**
 * Cybokron Advanced Widget Visibility - Admin Styles
 */

/* Visibility Toggle Button */
.cybawv-visibility-wrapper {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #ddd;
}

.cybawv-visibility-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.cybawv-visibility-button {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
}

.cybawv-visibility-button:hover,
.cybawv-visibility-button:focus {
    background: #005a87;
    border-color: #005a87;
    color: #fff;
}

.cybawv-visibility-status {
    font-size: 12px;
    color: #666;
}

.cybawv-visibility-status.cybawv-has-rules {
    color: #0073aa;
    font-weight: 600;
}

/* Visibility Panel */
.cybawv-visibility-panel {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-top: 10px;
    padding: 15px;
}

/* Action Row (Show/Hide) */
.cybawv-action-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    font-size: 13px;
}

.cybawv-action-row select {
    min-width: 80px;
}

/* Rules Container */
.cybawv-rules {
    margin-bottom: 15px;
}

/* Single Rule */
.cybawv-rule {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
    padding: 10px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;
    margin-bottom: 8px;
}

.cybawv-rule:last-child {
    margin-bottom: 0;
}

/* Button-like Actions */
.cybawv-rule-remove,
.cybawv-add-rule,
.cybawv-delete-rules {
    background: transparent;
    border: 0;
    border-radius: 2px;
    font: inherit;
    margin: 0;
    padding: 0;
}

/* Remove Button */
.cybawv-rule-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #a00;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    min-height: 24px;
    min-width: 24px;
    padding: 5px;
}

.cybawv-rule-remove:hover {
    color: #dc3232;
}

/* Rule Selects */
.cybawv-rule select {
    min-width: 120px;
}

.cybawv-rule-type {
    min-width: 140px !important;
}

.cybawv-rule-value {
    min-width: 180px !important;
    max-width: 250px;
}

.cybawv-rule-value-container {
    display: inline-flex;
    align-items: flex-start;
    gap: 8px;
}

.cybawv-taxonomy-control {
    display: inline-flex;
    align-items: flex-start;
    gap: 8px;
    flex-wrap: wrap;
}

.cybawv-rule-taxonomy {
    min-width: 180px !important;
    max-width: 250px;
}

.cybawv-rule-values {
    min-width: 220px !important;
    max-width: 280px;
    min-height: 90px;
}

/* Rule Label */
.cybawv-rule-label {
    color: #666;
    font-size: 13px;
    padding: 5px 0;
}

/* Checkboxes Container */
.cybawv-rule-options {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    margin-top: 5px;
    padding-left: 25px;
}

.cybawv-rule-options label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #555;
    cursor: pointer;
}

.cybawv-rule-options input[type="checkbox"] {
    margin: 0;
}

/* Descendants checkbox highlight */
.cybawv-rule-options .cybawv-descendants-option {
    color: #0073aa;
    font-weight: 500;
}

/* Add Condition Button */
.cybawv-add-rule {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #0073aa;
    cursor: pointer;
    text-decoration: none;
    font-size: 13px;
}

.cybawv-add-rule:hover {
    color: #005a87;
    text-decoration: underline;
}

.cybawv-add-rule::before {
    content: "+";
    font-size: 16px;
    font-weight: bold;
}

/* Match All Checkbox */
.cybawv-match-all {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.cybawv-match-all label {
    font-size: 12px;
    color: #555;
    cursor: pointer;
}

/* Footer Actions */
.cybawv-panel-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #ddd;
}

.cybawv-delete-rules {
    color: #a00;
    cursor: pointer;
    text-decoration: none;
    font-size: 12px;
}

.cybawv-delete-rules:hover {
    color: #dc3232;
    text-decoration: underline;
}

.cybawv-rule-remove:focus-visible,
.cybawv-add-rule:focus-visible,
.cybawv-delete-rules:focus-visible {
    box-shadow: 0 0 0 2px #2271b1;
    outline: 2px solid transparent;
}

.cybawv-done-button {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
}

/* Responsive */
@media screen and (max-width: 782px) {
    .cybawv-rule {
        flex-direction: column;
    }

    .cybawv-rule select,
    .cybawv-rule-values,
    .cybawv-rule-taxonomy,
    .cybawv-rule-value,
    .cybawv-rule-value-container,
    .cybawv-taxonomy-control {
        width: 100%;
        max-width: none;
    }

    .cybawv-rule-options {
        padding-left: 0;
    }
}
