/* Gate CLOSED — keep fields hidden even if some other JS un-hid them. */
.bbps-resolved-reopen-gate[data-reopen-active="false"] .js-topic-reply-fieldset,
.bbps-resolved-reopen-gate[data-reopen-active="false"] .js-topic-reply-wrap,
.bbps-resolved-reopen-gate[data-reopen-active="false"] .bbp-submit-wrapper,
.bbps-resolved-reopen-gate[data-reopen-active="false"] .js-bbps-upload-container {
    display: none !important;
}

/* Gate OPEN — override the theme's inline style="display:none;" so the
   fields appear even with JS disabled (no-JS path arrives here via
   ?bbps_reopen=1, where T008 sets data-reopen-active="true" server-side). */
.bbps-resolved-reopen-gate[data-reopen-active="true"] .js-topic-reply-fieldset,
.bbps-resolved-reopen-gate[data-reopen-active="true"] .js-topic-reply-wrap {
    display: block !important;
}
.bbps-resolved-reopen-gate[data-reopen-active="true"] .bbp-submit-wrapper,
.bbps-resolved-reopen-gate[data-reopen-active="true"] .js-bbps-upload-container {
    display: block !important;
}

/* Expired-window state — form always hidden. */
.bbps-resolved-reopen-gate--expired .js-topic-reply-fieldset,
.bbps-resolved-reopen-gate--expired .js-topic-reply-wrap,
.bbps-resolved-reopen-gate--expired .bbp-submit-wrapper,
.bbps-resolved-reopen-gate--expired .js-bbps-upload-container {
    display: none !important;
}

/* Panel container */
.bbps-reopen-panel {
    background: #FEF7E6;
    border-left: 4px solid #0074A2;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 2px;
}

.bbps-reopen-panel__heading {
    margin: 0 0 8px;
    font-size: 1.15em;
    font-weight: 600;
    color: #1d2327;
}

.bbps-reopen-panel__body {
    margin: 0 0 16px;
    color: #3c434a;
    line-height: 1.5;
}

.bbps-reopen-panel__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.bbps-reopen-panel__primary {
    display: inline-block;
    padding: 10px 20px;
    background: #0074A2;
    color: #fff !important;
    border: none;
    border-radius: 3px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.4;
    text-align: center;
}

.bbps-reopen-panel__primary:hover,
.bbps-reopen-panel__primary:focus {
    background: #005d82;
    color: #fff !important;
    text-decoration: none;
}

.bbps-reopen-panel__secondary {
    display: inline-block;
    padding: 10px 20px;
    background: transparent;
    color: #0074A2 !important;
    border: 1px solid #0074A2;
    border-radius: 3px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.4;
    text-align: center;
}

.bbps-reopen-panel__secondary:hover,
.bbps-reopen-panel__secondary:focus {
    background: #f0f6fc;
    color: #005d82 !important;
    border-color: #005d82;
    text-decoration: none;
}

/* Rejection notice */
.bbps-resolved-reopen-notice {
    background: #fef0f0;
    border-left: 4px solid #d63638;
    padding: 12px 16px;
    margin-bottom: 12px;
    border-radius: 2px;
}

.bbps-resolved-reopen-notice p {
    margin: 0;
    color: #8a2424;
    line-height: 1.5;
}

/* Expired panel — single action */
.bbps-reopen-panel--expired .bbps-reopen-panel__actions {
    justify-content: flex-start;
}

/* Mobile — stack actions vertically */
@media (max-width: 600px) {
    .bbps-reopen-panel__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .bbps-reopen-panel__primary,
    .bbps-reopen-panel__secondary {
        width: 100%;
        text-align: center;
    }
}
