/* WP MCP Server Admin Styles */

/* Server Status table label column */
.wp-mcp-status-label { color: #50575e; font-weight: 400; width: 50%; white-space: nowrap; }

/* Page-level navigation tabs (shown on every plugin admin page) */
.wp-mcp-page-nav { margin: 12px 0 16px; }

.wp-mcp-admin {
    max-width: 1200px;
}

/* Dashboard Grid */
.wp-mcp-dashboard-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 20px;
    margin-top: 20px;
}

.wp-mcp-card {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 20px;
}

.wp-mcp-card h2 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f1;
}

.wp-mcp-card-wide,
.wp-mcp-card-full {
    grid-column: 1 / -1;
}

/* Status Table */
.wp-mcp-status-table {
    width: 100%;
    border-collapse: collapse;
}

.wp-mcp-status-table td {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f1;
}

.wp-mcp-status-table td:first-child {
    color: #50575e;
    width: 45%;
}

/* Badges */
.wp-mcp-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
}

.wp-mcp-badge-success,
.wp-mcp-badge-active,
.wp-mcp-badge-ok {
    background: #d4edda;
    color: #155724;
}

.wp-mcp-badge-error {
    background: #f8d7da;
    color: #721c24;
}

.wp-mcp-badge-warning,
.wp-mcp-badge-expired {
    background: #fff3cd;
    color: #856404;
}

.wp-mcp-badge-inactive {
    background: #e2e3e5;
    color: #383d41;
}

/* Endpoint Box */
.wp-mcp-endpoint-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    padding: 10px 15px;
    margin: 10px 0;
}

.wp-mcp-endpoint-box code {
    flex: 1;
    font-size: 13px;
    word-break: break-all;
    background: transparent;
    padding: 0;
}

/* Code Block */
.wp-mcp-code-block {
    position: relative;
    background: #1d2327;
    color: #f0f0f1;
    padding: 15px;
    border-radius: 4px;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.6;
    margin: 10px 0;
}

.wp-mcp-code-block .wp-mcp-copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
}

.wp-mcp-code-block pre {
    margin: 0;
    color: inherit;
    background: transparent;
}

/* Tools List (chips) */
.wp-mcp-tools-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.wp-mcp-tool-chip {
    display: inline-block;
    padding: 3px 10px;
    background: #f0f0f1;
    border: 1px solid #dcdcde;
    border-radius: 3px;
    font-size: 12px;
}

/* Token Form - Tool Permissions Grid */
.wp-mcp-tools-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 15px;
    max-height: 600px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    background: #f6f7f7;
}

/* Fieldset for tool permissions */
.wp-mcp-token-form fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

/* Filter Controls */
.wp-mcp-filters {
    display: flex;
    gap: 10px;
    margin: 10px 0;
    padding: 10px;
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    flex-wrap: wrap;
    align-items: center;
}

/* Multiselect dropdown widget */
.wp-mcp-multiselect {
    position: relative;
    display: inline-block;
}

.wp-mcp-multiselect-btn {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 5px 10px;
    min-width: 150px;
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 3px;
    font-size: 13px;
    color: #2c3338;
    cursor: pointer;
    line-height: 1.4;
}

.wp-mcp-multiselect-btn:hover {
    border-color: #8c8f94;
}

.wp-mcp-multiselect-btn:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}

.wp-mcp-multiselect.is-open .wp-mcp-multiselect-btn {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.wp-mcp-multiselect-arrow {
    font-size: 9px;
    color: #646970;
    transition: transform 0.15s ease;
    flex-shrink: 0;
}

.wp-mcp-multiselect.is-open .wp-mcp-multiselect-arrow {
    transform: rotate(180deg);
}

.wp-mcp-multiselect-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    z-index: 9999;
    min-width: 100%;
    max-height: 220px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 3px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
    padding: 4px 0;
}

.wp-mcp-multiselect.is-open .wp-mcp-multiselect-dropdown {
    display: block;
}

.wp-mcp-multiselect-option {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px;
    font-size: 13px;
    color: #2c3338;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
}

.wp-mcp-multiselect-option:hover {
    background: #f0f6fc;
}

.wp-mcp-multiselect-option input[type="checkbox"] {
    margin: 0;
    flex-shrink: 0;
}

.wp-mcp-tool-category h4 {
    margin: 0 0 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #dcdcde;
}

.wp-mcp-tool-category h4 label,
.wp-mcp-category-toggle {
    font-weight: 600;
    cursor: pointer;
}

.wp-mcp-tool-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wp-mcp-tool-item {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 4px;
    border-radius: 3px;
    cursor: pointer;
}

.wp-mcp-tool-item:hover {
    background: #e8e8e8;
}

.wp-mcp-tool-item input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
}

.wp-mcp-tool-item code {
    font-size: 11px;
    white-space: nowrap;
}

.wp-mcp-tool-item .description {
    font-size: 11px;
    color: #50575e;
    display: block;
}

.wp-mcp-select-all {
    display: block;
    margin-bottom: 5px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    cursor: pointer;
}

/* Token Notice */
.wp-mcp-token-notice {
    border-left-color: #00a32a;
}

.wp-mcp-token-notice .wp-mcp-endpoint-box {
    background: #fff;
}

/* Token Actions */
.wp-mcp-action-revoke {
    color: #dba617;
}

.wp-mcp-action-delete {
    color: #b32d2e;
}

/* Settings - block label (used in Disabled Delete Tools checkboxes) */
.wp-mcp-block-label {
    display: block;
    margin-bottom: 4px;
}

/* Abilities & Hooks Browser - Collapsible Plugin Sections */
.wp-mcp-plugin-section {
    margin-bottom: 12px;
    padding: 0;
}

.wp-mcp-plugin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: #f6f7f7;
    border-bottom: 1px solid #c3c4c7;
    cursor: pointer;
    user-select: none;
    border-radius: 3px 3px 0 0;
}

.wp-mcp-plugin-header:hover {
    background: #e8e8e8;
}

.wp-mcp-plugin-header h3 {
    margin: 0;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.wp-mcp-plugin-toggle-icon {
    font-size: 10px;
    color: #50575e;
}

.wp-mcp-plugin-body {
    padding: 0;
}

.wp-mcp-plugin-body.is-collapsed {
    display: none;
}

/* Tab content panels */
.wp-mcp-tab-content {
    margin-top: 0;
}

/* Quick Start Collapsible Grid */
.wp-mcp-quickstart-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 12px;
}

.wp-mcp-quickstart-item {
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    overflow: hidden;
}

.wp-mcp-quickstart-item > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    cursor: pointer;
    user-select: none;
    font-weight: 600;
    font-size: 13px;
    list-style: none;
    gap: 8px;
}

.wp-mcp-quickstart-item > summary::-webkit-details-marker {
    display: none;
}

.wp-mcp-quickstart-item > summary::after {
    content: '▶';
    font-size: 9px;
    color: #50575e;
    flex-shrink: 0;
    transition: transform 0.15s ease;
}

.wp-mcp-quickstart-item[open] > summary::after {
    transform: rotate(90deg);
}

.wp-mcp-quickstart-item > summary:hover {
    background: #e8e8e8;
}

.wp-mcp-quickstart-item[open] > summary {
    border-bottom: 1px solid #dcdcde;
    background: #fff;
}

.wp-mcp-quickstart-body {
    padding: 14px;
    background: #fff;
}

.wp-mcp-quickstart-body .description {
    margin-bottom: 8px;
}

/* Responsive */
@media screen and (max-width: 782px) {
    .wp-mcp-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .wp-mcp-tools-grid {
        grid-template-columns: 1fr;
    }

    .wp-mcp-quickstart-grid {
        grid-template-columns: 1fr;
    }
}

/* Utility Classes */
.wp-mcp-mb-16 {
    margin-bottom: 16px;
}
.wp-mcp-mb-0 {
    margin-bottom: 0;
}
.wp-mcp-mt-16 {
    margin-top: 16px;
}
.wp-mcp-m-0 {
    margin: 0;
}
.wp-mcp-m-0-0-8 {
    margin: 0 0 8px;
}
.wp-mcp-my-16 {
    margin: 16px 0;
}
.wp-mcp-p-12-16 {
    padding: 12px 16px;
}
.wp-mcp-p-10-14 {
    padding: 10px 14px;
}
.wp-mcp-ml-8 {
    margin-left: 8px;
}
.wp-mcp-ml-12 {
    margin-left: 12px;
}
.wp-mcp-mw-280 {
    max-width: 280px;
}
.wp-mcp-w-320 {
    width: 320px;
}
.wp-mcp-text-muted {
    color: #646970;
}

/* Settings Styles */
.wp-mcp-notice-warning {
    margin: 0 0 12px;
    padding: 8px 14px;
}
.wp-mcp-mt-8 {
    margin-top: 8px;
}
.wp-mcp-mt-12 {
    margin-top: 12px;
}
.wp-mcp-mt-14 {
    margin-top: 14px;
}
.wp-mcp-text-danger {
    color: #d63638;
}
.wp-mcp-column-list {
    column-count: 3;
    margin: 4px 0 0 18px;
}
.wp-mcp-lang-select {
    position: relative;
    display: inline-block;
    width: 320px;
}
.wp-mcp-lang-display {
    width: 100%;
    padding: 6px 30px 6px 8px;
    box-sizing: border-box;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' fill='none' stroke='%23646970' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 10px center;
    cursor: pointer;
}
.wp-mcp-lang-display:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}
.wp-mcp-lang-select.is-open .wp-mcp-lang-display {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}
.wp-mcp-lang-options {
    display: none !important;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 250px;
    overflow-y: auto;
    margin: 0;
    padding: 0;
    list-style: none !important;
    background: #fff;
    border: 1px solid #2271b1;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,.1);
    z-index: 100;
}
.wp-mcp-lang-select.is-open .wp-mcp-lang-options {
    display: block !important;
}
.wp-mcp-lang-options li {
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    list-style: none !important;
    margin: 0;
}
.wp-mcp-lang-options li:hover,
.wp-mcp-lang-options li.wp-mcp-lang-highlight {
    background: #f0f6fc;
}
.wp-mcp-lang-options li.wp-mcp-lang-active {
    font-weight: 600;
}
.wp-mcp-lang-code {
    color: #999;
    font-size: 12px;
    margin-left: 8px;
}
.wp-mcp-lang-options li.wp-mcp-lang-hidden {
    display: none !important;
}

/* =========================================================
   Plugin Integrations Page
   ========================================================= */

.wp-mcp-plugin-groups { max-width: 900px; margin-top: 16px; }

.wp-mcp-plugin-card {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    margin-bottom: 10px;
    transition: border-color 0.15s, opacity 0.15s;
}
.wp-mcp-plugin-card.is-disabled { border-color: #dcdcde; opacity: 0.72; }

.wp-mcp-plugin-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 16px;
    gap: 10px;
}
.wp-mcp-plugin-card-header-left  { display: flex; align-items: center; gap: 9px; flex: 1; }
.wp-mcp-plugin-card-header-right { font-size: 12px; color: #50575e; white-space: nowrap; }

.wp-mcp-collapse-btn {
    background: none; border: none; cursor: pointer;
    padding: 2px 4px; color: #50575e; line-height: 1;
    display: flex; align-items: center; flex-shrink: 0;
}
.wp-mcp-collapse-btn .dashicons { font-size: 18px; width: 18px; height: 18px; }
.wp-mcp-collapse-btn:hover { color: #2271b1; }

.wp-mcp-group-toggle { display: flex; align-items: center; gap: 7px; cursor: pointer; margin: 0; }

.wp-mcp-plugin-card-body { border-top: 1px solid #f0f0f1; padding: 14px 16px; }
.wp-mcp-plugin-description { color: #50575e; margin: 0 0 10px; font-size: 13px; }

.wp-mcp-notice-requires { margin: 0 0 10px !important; padding: 7px 12px !important; }

.wp-mcp-tool-controls { display: flex; align-items: center; gap: 7px; margin-bottom: 9px; }
.wp-mcp-tool-search   { flex: 1; max-width: 260px; }

.wp-mcp-tool-list { border: 1px solid #e5e5e5; border-radius: 3px; overflow: hidden; }

.wp-mcp-tool-row {
    display: flex; align-items: flex-start; justify-content: space-between;
    padding: 7px 12px; border-bottom: 1px solid #f0f0f1; gap: 10px;
}
.wp-mcp-tool-row:last-child { border-bottom: none; }
.wp-mcp-tool-row:hover      { background: #fafafa; }
.wp-mcp-tool-row.is-disabled { background: #fafafa; color: #a7aaad; }

.wp-mcp-tool-label {
    display: flex; align-items: flex-start; gap: 7px;
    flex: 1; cursor: pointer; margin: 0;
}
.wp-mcp-tool-label input[type="checkbox"] { margin-top: 3px; flex-shrink: 0; }

.wp-mcp-tool-info { display: flex; flex-direction: column; gap: 2px; }
.wp-mcp-tool-name { font-size: 12px; background: none; padding: 0; }
.wp-mcp-tool-description { font-size: 12px; color: #50575e; line-height: 1.4; }
.wp-mcp-tool-row.is-disabled .wp-mcp-tool-description { color: #c3c4c7; }

.wp-mcp-tool-badges { display: flex; gap: 4px; flex-shrink: 0; margin-top: 2px; }

/* Badges */
.wp-mcp-badge {
    display: inline-block; font-size: 10px; font-weight: 600;
    padding: 2px 6px; border-radius: 10px; line-height: 1.4;
    text-transform: uppercase; letter-spacing: 0.3px; white-space: nowrap;
}
.wp-mcp-badge--stable       { background: #d7f7d7; color: #1a6b1a; }
.wp-mcp-badge--beta         { background: #fff3cd; color: #856404; }
.wp-mcp-badge--premium      { background: #e8d5f7; color: #5b1fa6; }
.wp-mcp-badge--read_only    { background: #d9eaf7; color: #1a4a6b; }
.wp-mcp-badge--read         { background: #d9eaf7; color: #1a4a6b; }
.wp-mcp-badge--write        { background: #fce8d5; color: #7a3200; }
.wp-mcp-badge--api          { background: #f0f0f1; color: #50575e; }
.wp-mcp-badge--installed    { background: #d7f7d7; color: #1a6b1a; }
.wp-mcp-badge--not-installed { background: #f0f0f1; color: #787c82; }
.wp-mcp-badge--paid         { background: #fce8d5; color: #7a3200; }
.wp-mcp-install-btn.button  { vertical-align: middle; margin-left: 4px !important; }

/* Not-installed card state */
.wp-mcp-plugin-card.is-not-installed { opacity: 0.6; }
.wp-mcp-plugin-card.is-not-installed .wp-mcp-group-toggle { cursor: not-allowed; }
.wp-mcp-plugin-card.is-not-installed .wp-mcp-tool-label   { cursor: default; }
label.wp-mcp-group-toggle.is-not-installed { cursor: not-allowed; }

/* Type filter buttons */
.wp-mcp-type-filters { display: inline-flex; gap: 4px; }
.wp-mcp-type-filter-btn { font-size: 11px !important; padding: 2px 8px !important; height: auto !important; line-height: 1.6 !important; }
.wp-mcp-type-filter-btn.is-active { background: #2271b1 !important; border-color: #2271b1 !important; color: #fff !important; }

/* Dashboard Available Tools intro hints (conditional notices) */
.wp-mcp-admin .wp-mcp-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0 0;
    padding: 8px 12px;
    border-left: 4px solid;
    border-radius: 2px;
    font-size: 13px;
    line-height: 1.5;
}
.wp-mcp-admin .wp-mcp-hint .dashicons { flex-shrink: 0; font-size: 18px; width: 18px; height: 18px; }
.wp-mcp-admin .wp-mcp-hint a { font-weight: 600; }
.wp-mcp-admin .wp-mcp-hint-info { background: #f0f6fc; border-color: #2271b1; color: #1d2327; }
.wp-mcp-admin .wp-mcp-hint-info .dashicons { color: #2271b1; }
.wp-mcp-admin .wp-mcp-hint-warn { background: #fcf9e8; border-color: #dba617; color: #1d2327; }
.wp-mcp-admin .wp-mcp-hint-warn .dashicons { color: #b88f00; }
