/**
 * Styles for MCP & Remote Sync (Free preview and shared layout).
 * Follows the native PEIWM design pattern (no left borders, primary buttons #FF6A3D).
 *
 * @package Post_Export_Import_With_Media
 * @since 1.3.0
 */

/* Container and layout */
.peiwm-mcp-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    box-sizing: border-box;
}

.peiwm-mcp-tabs-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 22px;
    background: #f0f1f6;
    padding: 6px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow-x: visible;
}

.peiwm-mcp-tabs-nav .peiwm-tab-btn {
    background: transparent;
    border: 1px solid transparent;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 8px;
    transition: all .18s ease;
    white-space: nowrap;
    text-decoration: none;
    user-select: none;
}

.peiwm-mcp-tabs-nav .peiwm-tab-btn:hover {
    color: #1e293b;
    background: rgba(255, 255, 255, 0.7);
}

.peiwm-mcp-tabs-nav .peiwm-tab-btn.active {
    color: #1e293b;
    background: #fff;
    border-color: #e2e8f0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

@media (max-width: 960px) {
    .peiwm-mcp-tabs-nav {
        gap: 6px;
        padding: 5px;
        margin-bottom: 18px;
    }

    .peiwm-mcp-tabs-nav .peiwm-tab-btn {
        padding: 7px 11px;
        font-size: 12.5px;
        gap: 5px;
    }
}

@media (max-width: 680px) {
    .peiwm-mcp-tabs-nav {
        gap: 4px;
        padding: 4px;
    }

    .peiwm-mcp-tabs-nav .peiwm-tab-btn {
        padding: 6px 9px;
        font-size: 12px;
        gap: 4px;
    }
}

.peiwm-mcp-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

@media (max-width: 960px) {
    .peiwm-mcp-container {
        grid-template-columns: 1fr;
    }
}

/* Feature cards */
.peiwm-mcp-card {
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 4px 14px rgba(18, 33, 63, 0.04);
    position: relative;
    transition: all 0.2s ease;
}

.peiwm-mcp-card:hover {
    box-shadow: 0 8px 24px rgba(18, 33, 63, 0.08);
}

.peiwm-mcp-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid #F1F2F7;
}

.peiwm-mcp-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 106, 61, 0.12);
    color: #FF6A3D;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.peiwm-mcp-icon svg {
    width: 22px;
    height: 22px;
}

.peiwm-mcp-card-title h3 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 700;
    color: #12213F;
}

.peiwm-mcp-card-title p {
    margin: 0;
    font-size: 12.5px;
    color: #6c7385;
}

/* Feature list inside cards */
.peiwm-mcp-features {
    list-style: none;
    margin: 16px 0;
    padding: 0;
}

.peiwm-mcp-features li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: #374151;
    margin-bottom: 10px;
    line-height: 1.5;
}

.peiwm-mcp-features li svg {
    width: 16px;
    height: 16px;
    color: #10B981;
    flex-shrink: 0;
    margin-top: 2px;
}

/* Snippet box */
.peiwm-mcp-snippet-box {
    background: #0F172A;
    border-radius: 10px;
    padding: 14px 16px;
    position: relative;
    margin: 16px 0;
    overflow: hidden;
}

.peiwm-mcp-snippet-box pre {
    margin: 0;
    padding: 0;
    color: #E2E8F0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    line-height: 1.6;
    overflow-x: auto;
}

/* Submenu separator */
#adminmenu a[href*="page=peiwm-mcp"] {
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    margin: 2px 0;
}

#adminmenu a[href*="page=peiwm-mcp"]:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* Modern PEIWM Form Controls - harmonized with .btn.btn-ghost design language */
.peiwm-admin input[type="text"],
.peiwm-admin input[type="password"],
.peiwm-admin input[type="url"],
.peiwm-admin input[type="number"],
.peiwm-admin input.regular-text,
.peiwm-preview-card input[type="text"],
.peiwm-preview-card input[type="password"],
.peiwm-preview-card input[type="url"],
.peiwm-preview-card input[type="number"],
.peiwm-preview-card input.regular-text {
    width: 100%;
    min-height: 42px !important;
    height: 42px !important;
    padding: 0 16px !important;
    border: 1px solid #E8E9F1 !important;
    border-radius: 10px !important;
    font-size: 13.5px !important;
    font-weight: 500 !important;
    color: #181C28 !important;
    background: #FFFFFF !important;
    box-shadow: 0 1px 3px rgba(18, 33, 63, 0.04) !important;
    transition: all .18s ease !important;
    box-sizing: border-box !important;
    line-height: 40px !important;
}

.peiwm-admin input[type="text"]:hover,
.peiwm-admin input[type="password"]:hover,
.peiwm-admin input[type="url"]:hover,
.peiwm-admin input.regular-text:hover,
.peiwm-preview-card input[type="text"]:hover,
.peiwm-preview-card input[type="password"]:hover,
.peiwm-preview-card input[type="url"]:hover,
.peiwm-preview-card input.regular-text:hover {
    border-color: #CBD5E1 !important;
}

.peiwm-admin input[type="text"]:focus,
.peiwm-admin input[type="password"]:focus,
.peiwm-admin input[type="url"]:focus,
.peiwm-admin input.regular-text:focus,
.peiwm-preview-card input[type="text"]:focus,
.peiwm-preview-card input[type="password"]:focus,
.peiwm-preview-card input[type="url"]:focus,
.peiwm-preview-card input.regular-text:focus {
    border-color: #FF6A3D !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(255, 106, 61, 0.16) !important;
    background: #FFFFFF !important;
}

/* Readonly fields stay crisp and readable like .btn-ghost, not greyed out */
.peiwm-admin input[readonly],
.peiwm-preview-card input[readonly] {
    background: #FFFFFF !important;
    color: #181C28 !important;
    border-color: #E8E9F1 !important;
    cursor: text !important;
}

.peiwm-admin input:disabled,
.peiwm-preview-card input:disabled {
    background: #F8FAFC !important;
    color: #64748B !important;
    border-color: #E8E9F1 !important;
    cursor: not-allowed !important;
}

.peiwm-input-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !important;
    font-size: 13px !important;
    letter-spacing: 0.2px !important;
}

/* Hero Connector URL & Copy Box layout */
.peiwm-url-copy-box {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    max-width: 820px !important;
    margin-bottom: 14px !important;
}

.peiwm-url-copy-box .peiwm-url-input-wrap {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.peiwm-url-copy-box .peiwm-input-icon {
    position: absolute;
    left: 14px;
    color: #94A3B8;
    font-size: 17px;
    width: 17px;
    height: 17px;
    pointer-events: none;
    z-index: 2;
}

.peiwm-url-copy-box input.peiwm-input-with-icon {
    padding-left: 38px !important;
}

.peiwm-url-copy-box .btn {
    height: 42px !important;
    min-height: 42px !important;
    padding: 0 18px !important;
    display: inline-flex !important;
    align-items: center !important;
}

/* Modern Select Dropdown */
.peiwm-admin select,
.peiwm-admin select.regular-text,
.peiwm-preview-card select,
.peiwm-preview-card select.regular-text {
    width: 100%;
    min-height: 42px !important;
    height: 42px !important;
    padding: 0 40px 0 16px !important;
    border: 1px solid #E8E9F1 !important;
    border-radius: 10px !important;
    font-size: 13.5px !important;
    font-weight: 500 !important;
    color: #181C28 !important;
    background: #FFFFFF url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2212%22%20height%3D%227%22%20viewBox%3D%220%200%2012%207%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M1%201L6%206L11%201%22%20stroke%3D%22%2364748B%22%20stroke-width%3D%221.75%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E") no-repeat right 16px center !important;
    background-size: 12px 7px !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    box-shadow: 0 1px 3px rgba(18, 33, 63, 0.04) !important;
    transition: all .18s ease !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
    line-height: 40px !important;
}

.peiwm-admin select:hover,
.peiwm-preview-card select:hover {
    border-color: #CBD5E1 !important;
}

.peiwm-admin select:focus,
.peiwm-preview-card select:focus {
    border-color: #FF6A3D !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(255, 106, 61, 0.16) !important;
}

.peiwm-admin select:disabled,
.peiwm-preview-card select:disabled {
    background-color: #FAFBFD !important;
    color: #475569 !important;
    border-color: #E8E9F1 !important;
    cursor: not-allowed !important;
    opacity: 1 !important;
}

/* Modern Checkbox - WP Admin Reset and Custom Checkmark */
.peiwm-admin input[type="checkbox"]::before,
.peiwm-admin input[type="checkbox"]::after,
.peiwm-preview-card input[type="checkbox"]::before,
.peiwm-preview-card input[type="checkbox"]::after {
    content: none !important;
    display: none !important;
}

.peiwm-admin input[type="checkbox"],
.peiwm-preview-card input[type="checkbox"] {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    width: 20px !important;
    min-width: 20px !important;
    max-width: 20px !important;
    height: 20px !important;
    min-height: 20px !important;
    max-height: 20px !important;
    border: 1.5px solid #CBD5E1 !important;
    border-radius: 6px !important;
    background-color: #FFFFFF !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    vertical-align: middle !important;
    margin: 2px 0 0 0 !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
    transition: all .15s ease !important;
    box-shadow: 0 1px 2px rgba(18, 33, 63, 0.04) !important;
    box-sizing: border-box !important;
}

.peiwm-admin input[type="checkbox"]:hover,
.peiwm-preview-card input[type="checkbox"]:hover {
    border-color: #FF6A3D !important;
}

.peiwm-admin input[type="checkbox"]:focus,
.peiwm-preview-card input[type="checkbox"]:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(255, 106, 61, 0.2) !important;
    border-color: #FF6A3D !important;
}

.peiwm-admin input[type="checkbox"]:checked,
.peiwm-preview-card input[type="checkbox"]:checked {
    background-color: #FF6A3D !important;
    border-color: #FF6A3D !important;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2212%22%20height%3D%229%22%20viewBox%3D%220%200%2012%209%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M1.5%204.5L4.5%207.5L10.5%201.5%22%20stroke%3D%22white%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: 11px 9px !important;
}

.peiwm-admin input[type="checkbox"]:disabled,
.peiwm-preview-card input[type="checkbox"]:disabled {
    cursor: not-allowed !important;
}

.peiwm-admin input[type="checkbox"]:disabled:checked,
.peiwm-preview-card input[type="checkbox"]:disabled:checked {
    background-color: #FF6A3D !important;
    border-color: #FF6A3D !important;
    opacity: 0.85 !important;
}

.peiwm-admin input[type="checkbox"]:disabled:not(:checked),
.peiwm-preview-card input[type="checkbox"]:disabled:not(:checked) {
    background-color: #F8FAFC !important;
    border-color: #E2E8F0 !important;
}

/* Modern PEIWM Table Styling - Clean Card Wrapper */
.peiwm-table-wrap {
    border: 1px solid #E8E9F1 !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    background: #FFFFFF !important;
    box-shadow: 0 1px 4px rgba(18, 33, 63, 0.03) !important;
    margin: 16px 0 !important;
}

.peiwm-table-wrap table,
.peiwm-table-wrap table.wp-list-table,
.peiwm-table-wrap table.widefat {
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    border: none !important;
    background: #FFFFFF !important;
    box-shadow: none !important;
    margin: 0 !important;
}

.peiwm-table-wrap table thead th,
.peiwm-table-wrap table.wp-list-table thead th {
    background: #FAFBFD !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    border-bottom: 1px solid #E8E9F1 !important;
    color: #64748B !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.6px !important;
    padding: 13px 18px !important;
    text-align: left !important;
}

.peiwm-table-wrap table tbody td,
.peiwm-table-wrap table.wp-list-table tbody td {
    padding: 14px 18px !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    border-bottom: 1px solid #F1F2F7 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #181C28 !important;
    vertical-align: middle !important;
    background: transparent !important;
    line-height: 1.5 !important;
}

.peiwm-table-wrap table.striped>tbody>:nth-child(odd),
.peiwm-table-wrap table.striped>tbody>:nth-child(odd)>td {
    background-color: #FAFAFC !important;
}

.peiwm-table-wrap table.striped>tbody>:nth-child(even),
.peiwm-table-wrap table.striped>tbody>:nth-child(even)>td {
    background-color: #FFFFFF !important;
}

.peiwm-table-wrap table tbody tr:hover td,
.peiwm-table-wrap table.wp-list-table tbody tr:hover td {
    background-color: #F5F7FA !important;
}

.peiwm-table-wrap table tbody tr:last-child td,
.peiwm-table-wrap table.wp-list-table tbody tr:last-child td {
    border-bottom: none !important;
}

.peiwm-table-wrap table code {
    background: #F1F2F7 !important;
    padding: 4px 8px !important;
    border-radius: 6px !important;
    font-size: 12px !important;
    color: #181C28 !important;
    border: 1px solid #E8E9F1 !important;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !important;
}

/* ==========================================================================
   Documentation & Guide Tab Styling
   ========================================================================== */
.peiwm-docs-hero {
    background: linear-gradient(120deg, #12213F 0%, #1A2E52 60%, #23345A 100%);
    border-radius: 14px;
    padding: 20px 24px;
    margin-bottom: 22px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 12px 28px rgba(18, 33, 63, 0.1);
    color: #FFFFFF;
}

.peiwm-docs-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(500px 240px at 85% -10%, rgba(255, 106, 61, 0.3), transparent 60%), radial-gradient(400px 200px at 10% 120%, rgba(16, 185, 129, 0.25), transparent 60%);
    pointer-events: none;
}

.peiwm-docs-hero-content {
    position: relative;
    z-index: 1;
    max-width: 820px;
}

.peiwm-docs-hero h2 {
    margin: 0 0 6px 0;
    font-size: 20px;
    font-weight: 700;
    color: #FFFFFF;
    line-height: 1.3;
}

.peiwm-docs-hero p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: #C7D2FE;
}

.peiwm-docs-quick-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 14px;
    position: relative;
    z-index: 1;
}

.peiwm-docs-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #FFFFFF !important;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none !important;
    transition: all 0.15s ease;
}

.peiwm-docs-nav-link:hover {
    background: rgba(255, 106, 61, 0.25);
    border-color: rgba(255, 106, 61, 0.5);
    transform: translateY(-1px);
}

.peiwm-docs-nav-link .dashicons {
    font-size: 15px;
    width: 15px;
    height: 15px;
}

.peiwm-docs-section-title {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid #F1F2F7;
}

.peiwm-docs-step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #FF6A3D;
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.peiwm-docs-section-title h3 {
    margin: 0 0 2px 0;
    font-size: 16.5px;
    font-weight: 700;
    color: #12213F;
}

.peiwm-docs-section-title .description {
    margin: 0;
    font-size: 12.5px;
    color: #64748B;
}

/* Grids */
.peiwm-docs-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 16px;
    margin-top: 14px;
}

.peiwm-docs-grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-top: 14px;
}

.peiwm-docs-feature-box {
    background: #FAFBFD;
    border: 1px solid #E8E9F1;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.18s ease;
}

.peiwm-docs-feature-box:hover {
    border-color: #CBD5E1;
    box-shadow: 0 4px 14px rgba(18, 33, 63, 0.05);
    transform: translateY(-2px);
}

.peiwm-docs-feature-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.peiwm-docs-feature-icon .dashicons {
    font-size: 22px;
    width: 22px;
    height: 22px;
}

.peiwm-docs-feature-box h4 {
    margin: 0 0 6px 0;
    font-size: 14.5px;
    font-weight: 700;
    color: #12213F;
}

.peiwm-docs-feature-box p {
    margin: 0;
    font-size: 13px;
    line-height: 1.55;
    color: #475569;
}

/* Client Cards */
.peiwm-docs-client-card {
    background: #FFFFFF;
    border: 1px solid #E8E9F1;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(18, 33, 63, 0.03);
}

.peiwm-docs-client-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 14.5px;
    color: #12213F;
}

.peiwm-docs-client-header .dashicons {
    color: #FF6A3D;
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.peiwm-docs-client-desc {
    margin: 0 0 14px 0;
    font-size: 12.5px;
    color: #64748B;
}

.peiwm-docs-steps-list {
    margin: 0;
    padding-left: 20px;
    font-size: 12.5px;
    line-height: 1.6;
    color: #334155;
}

.peiwm-docs-steps-list li {
    margin-bottom: 6px;
}

/* Tabs Accordion */
.peiwm-docs-tabs-accordion {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.peiwm-docs-tab-item {
    border: 1px solid #E8E9F1;
    border-radius: 10px;
    overflow: hidden;
    background: #FFFFFF;
    transition: all 0.18s ease;
}

.peiwm-docs-tab-item:hover {
    border-color: #CBD5E1;
}

.peiwm-docs-tab-head {
    background: #FAFBFD;
    padding: 13px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13.5px;
    color: #12213F;
    cursor: pointer;
}

.peiwm-docs-tab-head:hover {
    background: #F1F5F9;
}

.peiwm-docs-tab-body {
    padding: 18px 20px;
    border-top: 1px solid #E8E9F1;
    font-size: 13px;
    line-height: 1.6;
    color: #334155;
    background: #FFFFFF;
}

.peiwm-docs-tab-body p:last-child {
    margin-bottom: 0;
}

/* FAQ Items */
.peiwm-docs-faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.peiwm-docs-faq-item {
    background: #FAFBFD;
    border: 1px solid #E8E9F1;
    border-radius: 10px;
    padding: 16px 20px;
}

.peiwm-docs-faq-item h4 {
    margin: 0 0 6px 0;
    font-size: 14px;
    font-weight: 700;
    color: #12213F;
}

.peiwm-docs-faq-item p {
    margin: 0;
    font-size: 13px;
    line-height: 1.55;
    color: #475569;
}