/**
 * Admin styles for Advance Canonical URL.
 */

.acu-admin-page {
    --acu-bg: #f6f7f9;
    --acu-surface: #ffffff;
    --acu-border: #dfe3e8;
    --acu-text: #1d2327;
    --acu-muted: #646970;
    --acu-primary: #4f46e5;
    --acu-primary-dark: #4338ca;
    --acu-primary-light: #eef2ff;
    --acu-success: #16855b;
    max-width: 1120px;
    margin-top: 24px;
    color: var(--acu-text);
}

.acu-icon {
    display: block;
    width: 20px;
    height: 20px;
}

.acu-page-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.acu-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: var(--acu-primary);
    color: #fff;
}

.acu-brand-mark .acu-icon {
    width: 24px;
    height: 24px;
}

.acu-page-title {
    margin: 0;
    padding: 0;
    color: var(--acu-text);
    font-size: 24px;
    line-height: 1.25;
}

.acu-page-header p {
    margin: 4px 0 0;
    color: var(--acu-muted);
    font-size: 14px;
}

.acu-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    border: 1px solid #b7e4cf;
    border-radius: 999px;
    background: #ecfdf5;
    color: #116c4a;
    font-size: 12px;
    font-weight: 600;
}

.acu-status-badge > span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--acu-success);
}

.acu-tabs {
    display: flex;
    gap: 4px;
    margin: 0 0 18px;
    border-bottom: 1px solid var(--acu-border);
}

.acu-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 12px;
    color: var(--acu-muted);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.acu-tab:hover,
.acu-tab:focus {
    color: var(--acu-primary);
}

.acu-tab:focus-visible {
    border-radius: 6px;
    outline: 2px solid rgba(79, 70, 229, 0.24);
    outline-offset: -2px;
}

.acu-tab.is-active {
    color: var(--acu-primary);
}

.acu-tab.is-active::after {
    content: "";
    position: absolute;
    right: 10px;
    bottom: -1px;
    left: 10px;
    height: 2px;
    background: var(--acu-primary);
}

.acu-tab .acu-icon {
    width: 16px;
    height: 16px;
}

.acu-settings-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 20px;
    align-items: start;
}

.acu-settings-form,
.acu-policy-panel {
    border: 1px solid var(--acu-border);
    border-radius: 8px;
    background: var(--acu-surface);
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.acu-more-plugins {
    padding: 6px 0 20px;
}

.acu-more-plugins-header {
    margin-bottom: 18px;
}

.acu-more-plugins-header h2 {
    margin: 0;
    color: var(--acu-text);
    font-size: 18px;
    line-height: 1.4;
}

.acu-more-plugins-header p {
    max-width: 680px;
    margin: 5px 0 0;
    color: var(--acu-muted);
    font-size: 13px;
    line-height: 1.55;
}

.acu-plugin-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.acu-plugin-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 220px;
    box-sizing: border-box;
    padding: 18px;
    border: 1px solid var(--acu-border);
    border-radius: 8px;
    background: var(--acu-surface);
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.acu-plugin-card-heading {
    display: flex;
    align-items: flex-start;
    gap: 11px;
}

.acu-plugin-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: var(--acu-primary-light);
    color: var(--acu-primary);
}

.acu-plugin-icon .acu-icon {
    width: 20px;
    height: 20px;
}

.acu-plugin-card h3 {
    margin: 0 0 5px;
    color: var(--acu-text);
    font-size: 14px;
    line-height: 1.35;
}

.acu-plugin-status {
    display: inline-flex;
    align-items: center;
    min-height: 19px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--acu-bg);
    color: var(--acu-muted);
    font-size: 10px;
    font-weight: 700;
}

.acu-plugin-status.is-active {
    background: #ecfdf5;
    color: #116c4a;
}

.acu-plugin-card > p {
    margin: 16px 0 18px;
    color: var(--acu-muted);
    font-size: 12px;
    line-height: 1.55;
}

.acu-plugin-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: auto;
}

.acu-plugin-actions .button {
    min-height: 32px;
}

.acu-plugin-actions .button-primary {
    border-color: var(--acu-primary);
    background: var(--acu-primary);
}

.acu-plugin-actions .button-primary:hover,
.acu-plugin-actions .button-primary:focus {
    border-color: var(--acu-primary-dark);
    background: var(--acu-primary-dark);
}

.acu-plugin-actions .button.disabled {
    display: inline-flex;
    align-items: center;
}

.acu-plugin-details {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--acu-primary);
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
}

.acu-plugin-details:hover,
.acu-plugin-details:focus {
    color: var(--acu-primary-dark);
    text-decoration: underline;
}

.acu-plugin-details .acu-icon {
    width: 13px;
    height: 13px;
}

.acu-settings-section {
    padding: 24px;
}

.acu-settings-section + .acu-settings-section {
    border-top: 1px solid var(--acu-border);
}

.acu-section-heading {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
}

.acu-section-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--acu-primary-light);
    color: var(--acu-primary);
}

.acu-section-icon .acu-icon {
    width: 18px;
    height: 18px;
}

.acu-section-heading h2,
.acu-policy-panel h2 {
    margin: 0;
    color: var(--acu-text);
    font-size: 16px;
    line-height: 1.4;
}

.acu-section-heading p {
    margin: 3px 0 0;
    color: var(--acu-muted);
    font-size: 13px;
}

.acu-choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.acu-choice {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: 12px;
    min-height: 86px;
    box-sizing: border-box;
    padding: 16px;
    border: 1px solid var(--acu-border);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.acu-choice:hover {
    border-color: #a5b4fc;
}

.acu-choice:focus-within {
    border-color: var(--acu-primary);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.18);
}

.acu-choice.is-selected {
    border-color: var(--acu-primary);
    background: #f8f8ff;
}

.acu-choice input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.acu-choice-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--acu-bg);
    color: var(--acu-muted);
    box-shadow: inset 0 0 0 1px rgba(29, 35, 39, 0.04);
    transition: color 160ms ease, background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.acu-choice-icon .acu-icon {
    width: 21px;
    height: 21px;
    stroke-width: 1.9;
}

.acu-choice-icon-automatic::after {
    content: "";
    position: absolute;
    top: 7px;
    right: 7px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #06b6d4;
    box-shadow: 0 0 0 3px #ecfeff;
    opacity: 0;
    transform: scale(0.7);
    transition: opacity 160ms ease, transform 160ms ease;
}

.acu-choice:hover .acu-choice-icon {
    color: var(--acu-primary);
    transform: translateY(-1px);
}

.acu-choice.is-selected .acu-choice-icon {
    background: var(--acu-primary-light);
    color: var(--acu-primary);
    box-shadow: inset 0 0 0 1px #dfe3ff, 0 4px 12px rgba(79, 70, 229, 0.12);
}

.acu-choice.is-selected .acu-choice-icon-automatic::after {
    opacity: 1;
    transform: scale(1);
}

.acu-choice-copy {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.acu-choice-copy strong {
    color: var(--acu-text);
    font-size: 14px;
}

.acu-choice-copy small,
.acu-toggle-row small {
    color: var(--acu-muted);
    font-size: 12px;
    line-height: 1.45;
}

.acu-choice-check {
    visibility: hidden;
    color: var(--acu-primary);
}

.acu-choice-check .acu-icon {
    width: 18px;
    height: 18px;
}

.acu-choice.is-selected .acu-choice-check {
    visibility: visible;
}

.acu-toggle-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    padding: 16px;
    border: 1px solid var(--acu-border);
    border-radius: 8px;
    background: var(--acu-bg);
    cursor: pointer;
}

.acu-toggle-row > span:first-child {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.acu-toggle-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.acu-toggle {
    position: relative;
    width: 46px;
    height: 26px;
    border-radius: 999px;
    background: #8c8f94;
    transition: background-color 150ms ease;
}

.acu-toggle::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.25);
    transition: transform 150ms ease;
}

.acu-toggle-input:checked + .acu-toggle {
    background: var(--acu-primary);
}

.acu-toggle-input:checked + .acu-toggle::after {
    transform: translateX(20px);
}

.acu-toggle-input:focus-visible + .acu-toggle {
    outline: 3px solid rgba(79, 70, 229, 0.22);
    outline-offset: 2px;
}

.acu-form-actions {
    padding: 18px 24px;
    border-top: 1px solid var(--acu-border);
    background: #fbfbfc;
}

.acu-form-actions .button-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    padding: 0 18px;
    border-color: var(--acu-primary);
    background: var(--acu-primary);
}

.acu-form-actions .button-primary:hover,
.acu-form-actions .button-primary:focus {
    border-color: var(--acu-primary-dark);
    background: var(--acu-primary-dark);
}

.acu-form-actions .button-primary.is-busy {
    cursor: progress;
    opacity: 0.78;
}

.acu-save-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 17px;
    height: 17px;
}

.acu-save-icon .acu-icon {
    width: 17px;
    height: 17px;
}

.acu-save-button.is-busy .acu-save-icon {
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: acu-spin 650ms linear infinite;
}

.acu-save-button.is-busy .acu-save-icon .acu-icon {
    display: none;
}

.acu-save-button.is-saved {
    border-color: var(--acu-success);
    background: var(--acu-success);
}

@keyframes acu-spin {
    to {
        transform: rotate(360deg);
    }
}

.acu-support-launcher {
    position: fixed;
    right: 24px;
    bottom: 52px;
    z-index: 10020;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 17px;
    border: 1px solid var(--acu-primary);
    border-radius: 999px;
    background: var(--acu-primary);
    color: #fff;
    box-shadow: 0 10px 26px rgba(79, 70, 229, 0.24);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.acu-support-launcher:hover,
.acu-support-launcher:focus {
    border-color: var(--acu-primary-dark);
    background: var(--acu-primary-dark);
    color: #fff;
    box-shadow: 0 12px 30px rgba(79, 70, 229, 0.3);
    transform: translateY(-1px);
}

.acu-support-launcher:focus-visible {
    outline: 3px solid rgba(79, 70, 229, 0.24);
    outline-offset: 3px;
}

.acu-support-launcher .acu-icon {
    width: 18px;
    height: 18px;
}

.acu-support-open .acu-support-launcher {
    display: none;
}

.acu-support-panel[hidden] {
    display: none;
}

.acu-support-panel {
    position: fixed;
    inset: 0;
    z-index: 10030;
    pointer-events: none;
}

.acu-support-card {
    position: absolute;
    right: 18px;
    bottom: 52px;
    box-sizing: border-box;
    width: min(390px, calc(100vw - 36px));
    max-height: calc(100vh - 84px);
    overflow: auto;
    padding: 18px;
    border: 1px solid var(--acu-border);
    border-radius: 8px;
    background: var(--acu-surface);
    box-shadow: 0 16px 44px rgba(15, 23, 42, 0.18);
    pointer-events: auto;
}

.acu-support-close {
    position: absolute;
    top: 12px;
    right: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--acu-border);
    border-radius: 8px;
    background: var(--acu-bg);
    color: var(--acu-muted);
    cursor: pointer;
}

.acu-support-close:hover,
.acu-support-close:focus {
    border-color: var(--acu-primary);
    color: var(--acu-primary);
}

.acu-support-close .acu-icon {
    width: 17px;
    height: 17px;
}

.acu-support-header {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding-right: 34px;
    margin-bottom: 14px;
}

.acu-support-header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--acu-primary-light);
    color: var(--acu-primary);
}

.acu-support-header-icon .acu-icon {
    width: 19px;
    height: 19px;
}

.acu-support-header h2 {
    margin: 0 0 4px;
    color: var(--acu-text);
    font-size: 15px;
    line-height: 1.35;
}

.acu-support-header p {
    margin: 0;
    color: var(--acu-muted);
    font-size: 12px;
    line-height: 1.45;
}

.acu-support-plans {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.acu-support-plan {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    width: 100%;
    min-height: 112px;
    padding: 12px;
    border: 1px solid var(--acu-border);
    border-radius: 8px;
    background: var(--acu-bg);
    color: var(--acu-text);
    text-align: left;
    cursor: pointer;
    transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.acu-support-plan:hover,
.acu-support-plan:focus-visible {
    border-color: var(--acu-primary);
    background: var(--acu-primary-light);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
    outline: 0;
}

.acu-support-plan.is-featured::after {
    content: "Popular";
    position: absolute;
    top: 10px;
    right: 10px;
    color: var(--acu-primary);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
}

.acu-support-plan.is-loading,
.acu-support-plan:disabled {
    cursor: progress;
    opacity: 0.62;
}

.acu-support-plan-name {
    padding-right: 38px;
    font-size: 12px;
    font-weight: 700;
}

.acu-support-plan-price {
    color: var(--acu-primary);
    font-size: 18px;
    font-weight: 750;
}

.acu-support-plan-description {
    margin-top: auto;
    color: var(--acu-muted);
    font-size: 11px;
    line-height: 1.35;
}

.acu-support-message {
    min-height: 17px;
    margin: 10px 0 0;
    color: var(--acu-success);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.45;
}

.acu-support-message:empty {
    min-height: 0;
    margin-top: 0;
}

.acu-support-message.is-error {
    color: #b42318;
}

.acu-policy-panel {
    padding: 20px;
}

.acu-policy-panel dl {
    margin: 16px 0;
}

.acu-policy-panel dl > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--acu-border);
}

.acu-policy-panel dt {
    color: var(--acu-muted);
    font-size: 12px;
}

.acu-policy-panel dd {
    margin: 0;
    color: var(--acu-text);
    font-size: 12px;
    font-weight: 600;
    text-align: right;
}

.acu-policy-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0;
    color: var(--acu-muted);
    font-size: 12px;
    line-height: 1.5;
}

.acu-policy-note .acu-icon {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    margin-top: 1px;
    color: var(--acu-primary);
}

#acu_canonical_meta_box .inside {
    margin: 0;
    padding: 0;
}

.acu-meta-box {
    color: #1d2327;
}

.acu-meta-status {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 16px;
    border-bottom: 1px solid #dcdcde;
    background: #f6f7f7;
}

.acu-meta-status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    box-sizing: border-box;
    padding: 6px;
    border-radius: 8px;
    background: #eef2ff;
    color: #4f46e5;
}

.acu-meta-status-icon .acu-icon {
    width: 19px;
    height: 19px;
}

@media (prefers-reduced-motion: reduce) {
    .acu-choice-icon,
    .acu-choice-icon-automatic::after,
    .acu-support-launcher,
    .acu-support-plan {
        transition: none;
    }
}

.acu-meta-status > div {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.acu-meta-status span:last-child,
.acu-custom-field p,
.acu-default-url > span {
    color: #646970;
    font-size: 12px;
    line-height: 1.45;
}

.acu-default-url,
.acu-custom-field {
    padding: 16px;
}

.acu-default-url {
    display: flex;
    flex-direction: column;
    gap: 7px;
    border-bottom: 1px solid #dcdcde;
}

.acu-default-url code {
    display: block;
    overflow-wrap: anywhere;
    padding: 8px 10px;
    border: 1px solid #dcdcde;
    border-radius: 6px;
    background: #f6f7f7;
    color: #2c3338;
    font-size: 12px;
}

.acu-custom-field label {
    display: block;
    margin-bottom: 7px;
    font-weight: 600;
}

.acu-custom-field input[type="url"] {
    width: 100%;
    min-height: 40px;
    margin: 0;
    border-color: #8c8f94;
}

.acu-custom-field input[type="url"]:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 1px #4f46e5;
}

.acu-custom-field p {
    margin: 7px 0 0;
}

@media (max-width: 900px) {
    .acu-settings-layout {
        grid-template-columns: 1fr;
    }

    .acu-policy-panel {
        order: -1;
    }

    .acu-plugin-grid {
        grid-template-columns: 1fr;
    }

    .acu-plugin-card {
        min-height: 0;
    }
}

@media (max-width: 600px) {
    .acu-admin-page {
        margin-right: 10px;
    }

    .acu-page-header {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .acu-tabs {
        overflow-x: auto;
    }

    .acu-status-badge {
        grid-column: 1 / -1;
        justify-self: start;
    }

    .acu-choice-grid {
        grid-template-columns: 1fr;
    }

    .acu-settings-section,
    .acu-policy-panel {
        padding: 18px;
    }

    .acu-support-launcher {
        right: 14px;
        bottom: 46px;
    }

    .acu-support-card {
        right: 10px;
        bottom: 46px;
        width: calc(100vw - 20px);
        max-height: calc(100vh - 66px);
        padding: 16px;
    }
}
