/**
 * Recognyze Admin Common Styles
 *
 * Common styles used across admin dashboard pages.
 *
 * @package Recognyze_Client
 */

/* Welcome Screen Styles */
.wprc-welcome-wrap {
    margin: 20px 0 0 0;
}

.wprc-welcome-wrap h2 {
    font-size: 20px;
    font-weight: 600;
}

.wprc-welcome-wrap h3 {
    font-size: 16px;
    font-weight: 600;
}

.wprc-welcome-card ul,
.wprc-welcome-card ol {
    line-height: 1.8;
}

@media (max-width: 782px) {
    .wprc-welcome-card>div[style*="grid"] {
        grid-template-columns: 1fr !important;
    }
}

/* Diagnostic Content Styles */
.wprc-diagnostic-content .postbox {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.wprc-diagnostic-content .postbox-header {
    border-bottom: 1px solid #ddd;
}

.wprc-diagnostic-content .postbox-header h2 {
    margin: 0;
    padding: 12px 15px;
    font-size: 14px;
    font-weight: 600;
}

.wprc-diagnostic-content table th {
    font-weight: 600;
}

.wprc-diagnostic-content code {
    background: #f0f0f1;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 13px;
}

/* Spinning animation */
.wprc-spinning {
    animation: wprc-spin 1s infinite linear;
}

@keyframes wprc-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Conflict notice styles */
.wprc-conflict-notice {
    border-left-color: #d63638;
}

.wprc-conflict-title {
    margin: 0.5em 0;
    font-size: 14px;
}

.wprc-conflict-title strong {
    color: #d63638;
}

.wprc-conflict-list-wrapper {
    margin-top: 12px;
    padding: 12px;
    background: #f9f9f9;
    border-left: 3px solid #d63638;
    border-radius: 3px;
}

.wprc-conflict-list {
    margin: 8px 0 0 0;
    padding-left: 20px;
    list-style: disc;
}

.wprc-conflict-list li {
    margin: 4px 0;
}

.wprc-conflict-link {
    color: #2271b1;
    text-decoration: none;
}

.wprc-conflict-hint {
    color: #646970;
    font-size: 12px;
    margin-left: 8px;
}

.wprc-conflict-tip {
    margin: 12px 0 0 0;
    font-size: 13px;
    color: #646970;
    font-style: italic;
}

/* ===== Dashboard Table Styles ===== */
.column-node-type {
    width: 100px;
}

.response-row.show {
    display: table-row !important;
}

.response-row td {
    padding: 0 !important;
    vertical-align: top;
    max-width: 100% !important;
    word-wrap: break-word;
    overflow: hidden;
}

.response-row .wprc-details {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.response-row .wprc-response-details {
    margin: 10px;
    max-width: calc(100% - 20px);
    box-sizing: border-box;
    overflow: hidden;
}

.response-row .wprc-response-details pre {
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    max-width: 100% !important;
    overflow-x: auto;
    margin: 0;
    font-size: 11px;
    line-height: 1.4;
    box-sizing: border-box;
}

.wprc-sign-all-btn {
    font-weight: 600 !important;
}

.wprc-sign-all-btn .dashicons {
    opacity: 0.9;
    vertical-align: middle;
    margin-right: 5px;
}

.wprc-sync-all-btn {
    font-weight: 600 !important;
}

.wprc-sync-all-btn .dashicons {
    opacity: 0.9;
    vertical-align: middle;
    margin-right: 5px;
}

.wprc-collapsible-section {
    display: none !important;
}

.tablenav-pages {
    float: right;
    margin: 0 0 9px;
}

.tablenav.top .tablenav-pages,
.tablenav.bottom .tablenav-pages {
    float: right;
    clear: none;
    margin: 0 0 9px;
}

.tablenav.top,
.tablenav.bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
}

.tablenav.top .alignleft,
.tablenav.bottom .alignleft {
    margin-right: 8px;
}

.tablenav-pages .pagination-links {
    margin-left: 10px;
}

.tablenav-pages .button {
    padding: 0 10px;
    height: 30px;
    line-height: 28px;
}

.tablenav-pages .current-page {
    width: 45px;
    height: 30px;
    text-align: center;
}

.tablenav-pages .tablenav-pages-navspan.button {
    padding: 0 10px;
    cursor: default;
}

/* ===== Settings Page Styles ===== */
.nav-tab-wrapper .nav-tab .dashicons {
    margin-right: 5px;
    margin-top: 2px;
    float: left;
}

.wprc-tab-content {
    margin-top: 20px;
}

.wprc-bot-wall-status {
    padding: 15px;
    border-radius: 5px;
    margin: 15px 0;
}

.wprc-bot-wall-status.enabled {
    background: #d1eddb;
    border-left: 4px solid #00a32a;
}

.wprc-bot-wall-status.disabled {
    background: #f8d7da;
    border-left: 4px solid #d63638;
}

/* Bot Wall editor mode UI helpers */
.wprc-bot-wall-hidden {
    display: none !important;
}

/* Policy editor: compact style (matches previous preferred UI) */
.wprc-bot-wall-policy-editor {
    margin-bottom: 12px;
    padding: 8px 10px;
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-radius: 2px;
}

.wprc-bot-wall-policy-editor__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.wprc-bot-wall-policy-editor__title-wrap {
    flex: 1 1 auto;
    min-width: 0;
}

.wprc-bot-wall-policy-editor__title {
    margin: 0 0 2px 0;
    font-size: 14px;
    font-weight: 600;
}

.wprc-bot-wall-policy-editor__active {
    margin: 0;
    font-size: 11px;
    line-height: 1.3;
    color: #646970;
}

.wprc-bot-wall-policy-editor__active-prefix {
    margin-right: 4px;
}

.wprc-bot-wall-policy-editor__active-suffix {
    display: block;
    margin-top: 2px;
}

.wprc-bot-wall-mode-badge {
    display: inline-block;
    margin-right: 4px;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.wprc-bot-wall-mode-badge--visual,
.wprc-bot-wall-mode-badge--json {
    color: #fff;
    background: #2271b1;
}

.wprc-bot-wall-policy-editor__hint {
    margin: 6px 0 0;
    font-size: 11px;
    line-height: 1.3;
}

.wprc-bot-wall-policy-editor .wprc-bot-wall-segmented {
    display: inline-flex;
    border: 1px solid #c3c4c7;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.wprc-bot-wall-policy-editor .wprc-bot-wall-segmented__option {
    display: flex;
    margin: 0;
    cursor: pointer;
}

.wprc-bot-wall-policy-editor .wprc-bot-wall-segmented__label {
    display: inline-block;
    min-width: 46px;
    padding: 3px 10px;
    font-size: 10px;
    line-height: 1.4;
    text-align: center;
    color: #646970;
    border-left: 1px solid #e2e4e7;
    background: #fff;
}

.wprc-bot-wall-policy-editor .wprc-bot-wall-segmented__option:first-child .wprc-bot-wall-segmented__label {
    border-left: 0;
}

.wprc-bot-wall-policy-editor .wprc-bot-wall-segmented__option input:focus + .wprc-bot-wall-segmented__label,
.wprc-bot-wall-policy-editor .wprc-bot-wall-segmented__option input:focus-visible + .wprc-bot-wall-segmented__label {
    outline: 2px solid #2271b1;
    outline-offset: -2px;
}

.wprc-bot-wall-policy-editor .wprc-bot-wall-segmented--is-guided .wprc-bot-wall-segmented__option--guided .wprc-bot-wall-segmented__label,
.wprc-bot-wall-policy-editor .wprc-bot-wall-segmented--is-json .wprc-bot-wall-segmented__option--json .wprc-bot-wall-segmented__label,
.wprc-bot-wall-policy-editor .wprc-bot-wall-segmented--is-search .wprc-bot-wall-segmented__option--search .wprc-bot-wall-segmented__label {
    background: #2271b1 !important;
    color: #fff !important;
    font-weight: 600;
}

#wprc_bot_wall_form[data-wprc-policy-mode="json"] #wprc_bot_wall_category_wall_config_json {
    min-height: 280px;
}

#wprc_bot_wall_category_wall_config_json {
    tab-size: 2;
}

#wprc_bot_wall_form[data-wprc-policy-mode="json"] .CodeMirror {
    min-height: 280px;
    border: 1px solid #8c8f94;
    border-radius: 2px;
}

.wprc-bot-override-group {
    margin: 12px 0 16px;
    border: 1px solid #dcdcde;
    border-radius: 6px;
    background: #fff;
}

.wprc-bot-override-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0 12px;
}

.wprc-bot-override-group__title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin: 0;
    padding: 10px 12px;
    font-weight: 600;
    border-bottom: 1px solid #f0f0f1;
    background: #f6f7f7;
    border-left: 0;
    border-right: 0;
    border-top: 0;
    text-align: left;
    cursor: pointer;
}

.wprc-bot-override-group__title:focus {
    outline: 2px solid #2271b1;
    outline-offset: -2px;
}

.wprc-bot-override-group__title-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    color: #1d2327;
}

.wprc-bot-override-group.is-collapsed .wprc-bot-override-group__title {
    border-bottom-color: transparent;
}

.wprc-bot-override-list {
    padding: 8px 12px;
}

.wprc-bot-override-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f1;
}

.wprc-bot-override-row:last-child {
    border-bottom: 0;
}

.wprc-bot-override-row__name {
    font-weight: 500;
    color: #1d2327;
}

.wprc-bot-override-row__controls {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.wprc-bot-override-pill {
    margin: 0;
    cursor: pointer;
}

.wprc-bot-override-pill input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.wprc-bot-override-pill span {
    display: inline-block;
    min-width: 60px;
    text-align: center;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid #dcdcde;
    background: #fff;
    color: #50575e;
    font-size: 12px;
    font-weight: 600;
}

.wprc-bot-override-pill--allow input:checked + span {
    border-color: #00a32a;
    background: #00a32a;
    color: #fff;
}

.wprc-bot-override-pill--deny input:checked + span {
    border-color: #d63638;
    background: #d63638;
    color: #fff;
}

.wprc-bot-override-pill input:disabled + span {
    opacity: 0.6;
    cursor: not-allowed;
}

.wprc-bot-search-status[data-wprc-bot-search-status="allow"] {
    color: #00a32a;
    font-weight: 600;
}

.wprc-bot-search-status[data-wprc-bot-search-status="deny"] {
    color: #d63638;
    font-weight: 600;
}

.wprc-bot-wall-json-status {
    margin-top: 8px;
    font-size: 12px;
}

.wprc-json-status-valid {
    color: #00a32a;
}

.wprc-json-status-invalid {
    color: #d63638;
}

.wprc-json-status-info {
    color: #2271b1;
}

.wprc-test-commands {
    background: #f6f7f7;
    border: 1px solid #c3c4c7;
    border-radius: 5px;
    padding: 15px;
    margin: 15px 0;
}

.wprc-test-commands code {
    background: #23282d;
    color: #f1f1f1;
    padding: 8px 12px;
    border-radius: 3px;
    display: block;
    margin: 5px 0;
    word-break: break-all;
}

.wprc-signed-posts-list {
    max-height: 200px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 10px;
    margin: 10px 0;
}

.wprc-signed-posts-list ul {
    margin: 0;
    padding-left: 20px;
}

.wprc-signed-posts-list li {
    margin: 5px 0;
}

/* ===== Export Page Styles ===== */
.spinning {
    animation: spin 1s infinite linear;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

#next-export-info {
    position: relative;
}

#refresh-export-status {
    transition: all 0.3s ease;
}

/* ===== Quick Edit Styles ===== */
.wprc-quick-edit-row {
    background: #f8f8f8;
}

.wprc-quick-edit-container {
    padding: 15px !important;
}

.wprc-quick-edit-wrapper {
    background: #fff;
    border: 1px solid #ddd;
    padding: 12px;
    max-width: 800px;
    margin: 0;
    text-align: left;
}

.wprc-quick-edit-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    padding-bottom: 8px;
    color: #23282d;
    text-align: left;
}

.wprc-quick-edit-fields {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-left: 5px;
}

.wprc-quick-edit-field {
    margin-bottom: 8px;
    display: flex;
    align-items: flex-start;
    text-align: left;
    position: relative;
}

.wprc-quick-edit-field label {
    display: inline-block;
    width: 120px;
    margin: 0;
    padding: 0;
    font-weight: normal;
    text-align: left;
    padding-right: 5px;
    color: #666;
}

.wprc-field-input {
    flex: 1;
    max-width: 500px;
    margin-left: 0;
    position: relative;
    display: flex;
    align-items: center;
}

.wprc-quick-edit-field input,
.wprc-quick-edit-field textarea {
    width: 100%;
    padding: 3px 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
    margin-top: 0;
    height: auto;
    font-size: 13px;
}

.wprc-quick-edit-field input[title],
.wprc-quick-edit-field textarea[title] {
    cursor: help;
}

.wprc-tooltip-icon {
    margin-left: 3px;
    color: #999;
    font-size: 14px;
    cursor: help;
    vertical-align: middle;
    display: inline-block;
}

.wprc-quick-edit-actions {
    margin-top: 15px;
    text-align: right;
}

.wprc-quick-edit-actions button {
    margin-left: 8px;
}

.wprc-quick-edit-save {
    background: #0073aa !important;
    color: #fff !important;
    border-color: #006291 !important;
}

.wprc-quick-edit-save:hover {
    background: #006291 !important;
}

/* ===== Admin Footer Styles ===== */
/* Robust Sticky Footer for WordPress Admin */

/* 1. Ensure root elements allow expansion */
html,
body {
    height: 100%;
}

/* 2. Target the main content wrapper */
/* Use min-height: 100vh to force it to fill the viewport */
#wpcontent {
    display: flex !important;
    flex-direction: column !important;
    min-height: 100vh !important;
    /* Fix for admin bar offset if needed, though 100vh is usually fine/safe enough */
}

/* 3. Allow key content body to expand */
#wpbody {
    flex: 1 0 auto !important;
}

/* 4. Footer Configuration */
/* Stick to bottom using margin-top: auto */
#wpfooter {
    flex-shrink: 0 !important;
    position: relative !important;
    /* Ensure it's not absolute */
    inset: auto !important;
    /* Reset top/left/right/bottom if set */
    margin-top: auto !important;
    /* Push to bottom */

    /* Layout */
    width: 100% !important;
    padding: 10px 20px;
    background: #f0f0f1;
    border-top: 1px solid #ddd;
    box-sizing: border-box;

    /* Ensure z-index is correct */
    z-index: 100;
}

#wpfooter p {
    margin: 0;
    line-height: 20px;
}

#footer-left {
    float: left;
}

#footer-upgrade {
    float: right;
}

.clear {
    clear: both;
}