/* Frontend User Admin Postbox Styles */
.postbox {
    border: 1px solid #e5e5e5;
    background: #fff;
    margin-bottom: 20px;
    position: relative;
}

.postbox h3 {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    padding: 8px 40px 8px 12px;
    line-height: 1.4;
    background: #f7f7f7;
    border-bottom: 1px solid #e5e5e5;
    cursor: pointer;
    user-select: none;
    position: relative;
}

.postbox h3:hover {
    background: #f1f1f1;
}

.postbox .handlediv {
    float: right;
    width: 27px;
    height: 30px;
    cursor: pointer;
    position: absolute;
    right: 0;
    top: 0;
    padding: 1px;
    text-align: center;
}

.postbox .handlediv:before {
    content: '\f142';
    font: normal 20px/1 dashicons;
    color: #666;
    display: inline-block;
    line-height: 30px;
    width: 27px;
    text-align: center;
    transition: color 0.1s ease-in-out;
}

.postbox.closed .handlediv:before {
    content: '\f140';
}

.postbox .inside {
    padding: 12px;
    border-top: none;
    /* display property will be controlled by JavaScript */
}

/* Ensure closed postboxes don't show content */
.postbox.closed h3 {
    border-bottom: none;
}

/* Fallback for when JavaScript is disabled */
.no-js .postbox.closed .inside {
    display: none;
}

/* Loading animation */
.postbox .handlediv:hover:before {
    color: #0073aa;
}

/* For older WordPress versions without dashicons */
.no-dashicons .postbox .handlediv:before {
    content: '−';
    font-family: Arial, sans-serif;
    font-size: 16px;
    font-weight: bold;
}

.no-dashicons .postbox.closed .handlediv:before {
    content: '+';
}

/* Force show/hide states with higher specificity */
.postbox:not(.closed) .inside {
    display: block !important;
    visibility: visible !important;
}

.postbox.closed .inside {
    display: none !important;
    visibility: hidden !important;
}

/* Debug styles */
.postbox .handlediv.debug {
    background: rgba(255, 0, 0, 0.2);
}

.postbox.debug {
    border: 2px solid red;
}