/* === SEO Magic 1.6.7: unified visual polish === */

/* Brand accents: pink for primary AI actions, #191E2D for secondary controls. */
.smg-modern-wrap {
    --smg-accent-blue: #191E2D;
    --smg-accent-blue-light: #2B3245;
    --smg-accent-dark-blue: #191E2D;
}

/* Normalize WordPress primary/secondary controls inside SEO Magic. */
.wp-core-ui .smg-modern-wrap .button-primary {
    border-color: var(--smg-accent-fuchsia) !important;
    border-radius: 10px !important;
    background: var(--smg-accent-fuchsia) !important;
    color: #fff !important;
    box-shadow: var(--smg-accent-shadow) !important;
    text-shadow: none !important;
}

.wp-core-ui .smg-modern-wrap .button-primary:hover,
.wp-core-ui .smg-modern-wrap .button-primary:focus {
    border-color: var(--smg-accent-fuchsia) !important;
    background: #ff4d75 !important;
    color: #fff !important;
}

.wp-core-ui .smg-modern-wrap .button-secondary:not(.smg-filter-button):not(#smg-cancel-bulk-action) {
    border-color: #191E2D !important;
    border-radius: 10px !important;
    background: transparent !important;
    color: #191E2D !important;
    box-shadow: none !important;
}

.wp-core-ui .smg-modern-wrap .button-secondary:not(.smg-filter-button):not(#smg-cancel-bulk-action):hover,
.wp-core-ui .smg-modern-wrap .button-secondary:not(.smg-filter-button):not(#smg-cancel-bulk-action):focus {
    border-color: #191E2D !important;
    background: #191E2D !important;
    color: #fff !important;
}

.smg-modern-wrap .smg-top-banner-nav a.smg-kofi-button {
    background: var(--smg-accent-fuchsia) !important;
    box-shadow: var(--smg-accent-shadow) !important;
}

.smg-modern-wrap .smg-pro-label,
.smg-modern-wrap .smg-legend-ok {
    background-color: #191E2D !important;
}

/* Apply buttons in Metadata SEO and Multimedia SEO. */
.wp-core-ui .smg-modern-wrap #smg-doaction,
.wp-core-ui .smg-modern-wrap button#smg-doaction,
.wp-core-ui .smg-modern-wrap input#smg-doaction {
    min-height: 46px !important;
    padding: 10px 20px !important;
    border: 0 !important;
    border-radius: 12px !important;
    background: var(--smg-accent-fuchsia) !important;
    color: #fff !important;
    box-shadow: var(--smg-accent-shadow) !important;
    line-height: 1.2 !important;
    appearance: none !important;
    -webkit-appearance: none !important;
}

.wp-core-ui .smg-modern-wrap #smg-doaction:hover,
.wp-core-ui .smg-modern-wrap #smg-doaction:focus {
    background: #ff4d75 !important;
    color: #fff !important;
    transform: translateY(-1px);
}

/* Consistent row action layout in Metadata and Multimedia tables. */
.smg-row-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-height: 42px;
}

.smg-actions-cell {
    vertical-align: middle !important;
}

.smg-actions-cell .smg-action-button-gradient,
.smg-actions-cell .smg-action-button-neutral {
    box-sizing: border-box !important;
    width: 42px !important;
    min-width: 42px !important;
    height: 42px !important;
    min-height: 42px !important;
    margin: 0 !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    vertical-align: middle !important;
}

/* AI diamond: pink and perfectly centered. */
.smg-actions-cell .smg-action-button-gradient {
    border: 0 !important;
    border-radius: 50% !important;
    background: var(--smg-accent-fuchsia) !important;
    color: #fff !important;
    box-shadow: var(--smg-accent-shadow) !important;
}

.smg-actions-cell .smg-action-button-gradient img {
    display: block !important;
    width: 18px !important;
    height: 18px !important;
    margin: 0 !important;
    padding: 0 !important;
    object-fit: contain;
    transform: none !important;
}

/* Manual edit pencil: dark brand color and perfectly centered. */
.wp-core-ui .smg-modern-wrap .smg-actions-cell .smg-action-button-neutral {
    border: 1px solid #191E2D !important;
    border-radius: 10px !important;
    background: #191E2D !important;
    color: #fff !important;
    box-shadow: none !important;
}

.wp-core-ui .smg-modern-wrap .smg-actions-cell .smg-action-button-neutral:hover,
.wp-core-ui .smg-modern-wrap .smg-actions-cell .smg-action-button-neutral:focus {
    border-color: #191E2D !important;
    background: #191E2D !important;
    color: #fff !important;
    filter: brightness(1.15);
}

.smg-actions-cell .smg-action-button-neutral .dashicons {
    display: block !important;
    flex: 0 0 20px;
    width: 20px !important;
    height: 20px !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 20px !important;
    line-height: 20px !important;
    color: #fff !important;
    text-align: center !important;
}

/* Pagination uses the dark brand color instead of blue. */
.smg-modern-wrap .tablenav-pages .page-numbers {
    color: #191E2D !important;
    border-radius: 8px !important;
}

.smg-modern-wrap .tablenav-pages a.page-numbers:hover,
.smg-modern-wrap .tablenav-pages a.page-numbers:focus {
    border-color: #191E2D !important;
    color: #191E2D !important;
}

.smg-modern-wrap .tablenav-pages .page-numbers.current {
    border-color: #191E2D !important;
    background: #191E2D !important;
    color: #fff !important;
}

/* Content Assistant primary action uses the dark brand color. */
.wp-core-ui .smg-modern-wrap #smg-assistant-optimize-button {
    border: 0 !important;
    border-radius: 12px !important;
    background: #191E2D !important;
    color: #fff !important;
    box-shadow: 0 8px 22px -10px rgba(25, 30, 45, .65) !important;
}

.wp-core-ui .smg-modern-wrap #smg-assistant-optimize-button:hover,
.wp-core-ui .smg-modern-wrap #smg-assistant-optimize-button:focus {
    background: #191E2D !important;
    color: #fff !important;
    filter: brightness(1.15);
}

.wp-core-ui .smg-modern-wrap #smg-assistant-save-button {
    min-height: 46px !important;
    border: 1px solid #191E2D !important;
    border-radius: 10px !important;
    background: transparent !important;
    color: #191E2D !important;
}

/* Fully organized Content Assistant loader. */
#smg-assistant-post-loader {
    overflow: hidden;
}

#smg-assistant-post-loader .smg-assistant-loader-note {
    max-width: 1050px;
    margin: 0 0 22px !important;
    line-height: 1.6;
}

#smg-assistant-toolbar.smg-assistant-loader-toolbar {
    display: block !important;
    width: 100% !important;
    margin: 0 0 24px !important;
    padding: 0 0 24px !important;
    border-bottom: 1px solid var(--smg-border-color) !important;
}

#smg-assistant-toolbar .smg-assistant-loader-controls {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    grid-template-areas:
        "search search"
        "types status" !important;
    gap: 20px 24px !important;
    width: 100% !important;
    align-items: start !important;
}

#smg-assistant-toolbar .smg-assistant-search-control {
    grid-area: search !important;
}

#smg-assistant-toolbar .smg-filter-group-types {
    grid-area: types !important;
}

#smg-assistant-toolbar .smg-filter-group-status {
    grid-area: status !important;
}

#smg-assistant-toolbar .smg-assistant-search-control,
#smg-assistant-toolbar .smg-filter-group {
    min-width: 0 !important;
    margin: 0 !important;
    padding: 18px !important;
    border: 1px solid var(--smg-border-color);
    border-radius: 12px;
    background: var(--smg-bg-primary);
    box-sizing: border-box;
}

#smg-assistant-toolbar .smg-filter-group-label {
    display: block !important;
    margin: 0 0 10px !important;
    color: var(--smg-text-primary) !important;
    font-size: 14px;
    font-weight: 700 !important;
    line-height: 1.3;
}

#smg-assistant-toolbar .smg-assistant-search-control input[type="search"] {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    min-height: 46px !important;
    margin: 0 !important;
    border-radius: 10px !important;
}

#smg-assistant-toolbar .smg-filter-buttons {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 10px !important;
    margin: 0 !important;
}

#smg-assistant-toolbar .smg-filter-button {
    min-height: 44px !important;
    margin: 0 !important;
    padding: 10px 18px !important;
    border-radius: 10px !important;
    line-height: 1.25 !important;
    white-space: normal !important;
}

/* Load for Editing buttons: rounded in both light and dark themes. */
.wp-core-ui .smg-modern-wrap #smg-posts-table-body-assistant .smg-load-post-for-editing,
.wp-core-ui .smg-modern-wrap #smg-posts-table-body-assistant button.smg-load-post-for-editing {
    min-height: 44px !important;
    margin: 0 !important;
    padding: 10px 20px !important;
    border: 0 !important;
    border-radius: 12px !important;
    background: var(--smg-accent-fuchsia) !important;
    color: #fff !important;
    box-shadow: var(--smg-accent-shadow) !important;
    line-height: 1.25 !important;
    appearance: none !important;
    -webkit-appearance: none !important;
}

.wp-core-ui .smg-modern-wrap #smg-posts-table-body-assistant .smg-load-post-for-editing:hover,
.wp-core-ui .smg-modern-wrap #smg-posts-table-body-assistant .smg-load-post-for-editing:focus {
    background: #ff4d75 !important;
    color: #fff !important;
    transform: translateY(-1px);
}

/* Review notice follows the same two-color brand system. */
.smg-review-notice {
    border-left-color: var(--smg-accent-fuchsia) !important;
}

.smg-review-notice-icon {
    background: rgba(247, 52, 94, .09) !important;
}

.smg-review-notice-actions .button.button-primary.smg-review-button {
    border-color: var(--smg-accent-fuchsia) !important;
    border-radius: 10px !important;
    background: var(--smg-accent-fuchsia) !important;
    color: #fff !important;
    box-shadow: var(--smg-accent-shadow) !important;
}

.smg-review-notice-actions .button.button-primary.smg-review-button:hover,
.smg-review-notice-actions .button.button-primary.smg-review-button:focus {
    border-color: var(--smg-accent-fuchsia) !important;
    background: #ff4d75 !important;
    color: #fff !important;
}

.smg-review-notice-actions .button.button-secondary,
.smg-review-notice-actions .button.button-secondary:hover,
.smg-review-notice-actions .button.button-secondary:focus {
    color: #191E2D !important;
}

@media (max-width: 1100px) {
    #smg-assistant-toolbar .smg-assistant-loader-controls {
        grid-template-columns: 1fr !important;
        grid-template-areas:
            "search"
            "types"
            "status" !important;
    }
}

@media (max-width: 782px) {
    #smg-assistant-toolbar .smg-assistant-search-control,
    #smg-assistant-toolbar .smg-filter-group {
        padding: 14px !important;
    }

    #smg-assistant-toolbar .smg-filter-button {
        flex: 1 1 calc(50% - 10px) !important;
        min-width: 130px;
        text-align: center;
    }

    .smg-row-actions {
        gap: 7px;
    }
}


/* === 1.6.8 final UI normalization === */
:root {
    --smg-brand-pink: #F7345E;
    --smg-brand-dark: #191E2D;
}

/* Main Content Assistant actions are pink and consistently rounded. */
.wp-core-ui .smg-modern-wrap #smg-assistant-optimize-button,
.wp-core-ui .smg-modern-wrap #smg-publish-post-button.smg-review-publish-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    min-height: 48px !important;
    padding: 11px 24px !important;
    border: 0 !important;
    border-radius: 12px !important;
    background: var(--smg-brand-pink) !important;
    background-image: none !important;
    color: #fff !important;
    box-shadow: 0 8px 22px -8px rgba(247, 52, 94, .55) !important;
    text-shadow: none !important;
}

.wp-core-ui .smg-modern-wrap #smg-assistant-optimize-button:hover,
.wp-core-ui .smg-modern-wrap #smg-assistant-optimize-button:focus,
.wp-core-ui .smg-modern-wrap #smg-publish-post-button.smg-review-publish-button:hover,
.wp-core-ui .smg-modern-wrap #smg-publish-post-button.smg-review-publish-button:focus {
    background: #ff4d75 !important;
    color: #fff !important;
    transform: translateY(-1px);
}

.wp-core-ui .smg-modern-wrap #smg-assistant-optimize-button[disabled],
.wp-core-ui .smg-modern-wrap #smg-publish-post-button.smg-review-publish-button[disabled] {
    background: var(--smg-brand-pink) !important;
    color: #fff !important;
    opacity: .62 !important;
}

.wp-core-ui .smg-modern-wrap #smg-assistant-save-button {
    border-color: var(--smg-brand-dark) !important;
    border-radius: 12px !important;
    color: var(--smg-brand-dark) !important;
}

/* Keep both Content Assistant columns aligned at the exact same top edge. */
#smg-assistant-main-card .smg-assistant-layout {
    display: grid !important;
    grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr) !important;
    gap: 25px !important;
    align-items: start !important;
}

#smg-assistant-main-card .smg-assistant-main-column,
#smg-assistant-main-card .smg-assistant-sidebar-column {
    min-width: 0 !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
    align-self: start !important;
}

#smg-assistant-main-card .smg-assistant-sidebar-column {
    position: sticky !important;
    top: 42px !important;
    transform: translateY(-2px) !important;
}

#smg-assistant-main-card .smg-assistant-main-column > :first-child,
#smg-assistant-main-card .smg-assistant-sidebar-column > :first-child {
    margin-top: 0 !important;
}

/* Secondary PRO links use the second brand color instead of WordPress blue. */
.smg-modern-wrap .smg-pro-upsell-link,
.smg-modern-wrap .smg-pro-inline-cta {
    border-color: var(--smg-brand-dark) !important;
    background: var(--smg-brand-dark) !important;
    color: #fff !important;
}

.smg-modern-wrap .smg-pro-upsell-link:hover,
.smg-modern-wrap .smg-pro-inline-cta:hover {
    border-color: var(--smg-brand-dark) !important;
    background: #252c40 !important;
    color: #fff !important;
}

@media (max-width: 1100px) {
    #smg-assistant-main-card .smg-assistant-layout {
        grid-template-columns: 1fr !important;
    }

    #smg-assistant-main-card .smg-assistant-sidebar-column {
        position: static !important;
        transform: none !important;
    }
}


/* === 1.6.10 compact action alignment, dashboard focus and archive-save polish === */

/* Dashboard cards: remove the oversized browser/WordPress blue focus ring. */
.smg-modern-wrap .smg-summary-card-link,
.smg-modern-wrap .smg-summary-card-link:focus,
.smg-modern-wrap .smg-summary-card-link:focus-visible,
.smg-modern-wrap .smg-summary-card-link:active {
    outline: 0 !important;
    box-shadow: none !important;
    border: 0 !important;
}

.smg-modern-wrap .smg-summary-card-link:focus .smg-summary-card,
.smg-modern-wrap .smg-summary-card-link:focus-visible .smg-summary-card {
    border-color: var(--smg-accent-fuchsia) !important;
    box-shadow: 0 0 0 2px rgba(247, 52, 94, .18), 0 8px 25px rgba(0, 0, 0, .08) !important;
}

/* Metadata and Multimedia row actions share one exact box model. */
#smg-posts-table td.smg-actions-cell,
#smg-media-table td.smg-actions-cell {
    padding-top: 12px !important;
    padding-bottom: 12px !important;
    vertical-align: middle !important;
    line-height: 1 !important;
}

#smg-posts-table .smg-row-actions,
#smg-media-table .smg-row-actions {
    display: flex !important;
    width: 100% !important;
    min-height: 40px !important;
    margin: 0 !important;
    padding: 0 !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    line-height: 1 !important;
}

#smg-posts-table .smg-row-actions > button,
#smg-media-table .smg-row-actions > button {
    position: relative !important;
    box-sizing: border-box !important;
    flex: 0 0 38px !important;
    width: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
    margin: 0 !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    vertical-align: middle !important;
    line-height: 1 !important;
    transform: none !important;
}

#smg-posts-table .smg-row-actions > button:hover,
#smg-posts-table .smg-row-actions > button:focus,
#smg-media-table .smg-row-actions > button:hover,
#smg-media-table .smg-row-actions > button:focus {
    transform: none !important;
}

#smg-posts-table .smg-action-button-gradient,
#smg-media-table .smg-action-button-gradient {
    border-radius: 50% !important;
}

#smg-posts-table .smg-action-button-neutral,
#smg-media-table .smg-action-button-neutral {
    border-radius: 12px !important;
}

#smg-posts-table .smg-action-icon,
#smg-media-table .smg-action-icon {
    position: static !important;
    display: block !important;
    flex: 0 0 17px !important;
    width: 17px !important;
    height: 17px !important;
    margin: 0 !important;
    padding: 0 !important;
    object-fit: contain !important;
    line-height: 1 !important;
    transform: none !important;
}

#smg-posts-table .smg-action-button-neutral .dashicons,
#smg-media-table .smg-action-button-neutral .dashicons {
    position: static !important;
    display: flex !important;
    flex: 0 0 18px !important;
    width: 18px !important;
    height: 18px !important;
    margin: 0 !important;
    padding: 0 !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 18px !important;
    line-height: 18px !important;
    transform: none !important;
}

#smg-posts-table .smg-row-actions > button:focus,
#smg-media-table .smg-row-actions > button:focus {
    outline: 0 !important;
    box-shadow: 0 0 0 2px rgba(247, 52, 94, .22) !important;
}

/* Keep table headers and dynamic rows on the same visual grid. */
#smg-posts-table .smg-col-actions,
#smg-media-table .smg-col-actions,
#smg-posts-table td.smg-actions-cell,
#smg-media-table td.smg-actions-cell {
    width: 112px !important;
    text-align: center !important;
}

#smg-posts-table .smg-row-actions,
#smg-media-table .smg-row-actions {
    justify-content: center !important;
}

#smg-media-table .smg-col-thumb,
#smg-media-table tbody td:nth-child(2) {
    text-align: center !important;
}

#smg-media-table tbody > tr > th.check-column,
#smg-media-table tbody > tr > td,
#smg-posts-table tbody > tr > th.check-column,
#smg-posts-table tbody > tr > td {
    vertical-align: middle !important;
}

#smg-media-table .smg-media-table-thumbnail {
    display: block;
    margin: 0 auto;
}
