.media-modal .edit-attachment-frame .attachment-details .autoaltai-generate-button,
.media-modal-content .attachment-details .autoaltai-generate-button {margin: 63px 0 10px 35%;}

.media-modal-content .autoaltai-generate-button {margin: 63px 0 10px 27%;}

.media-modal .edit-attachment-frame .attachment-details .autoaltai-generate-button .button,
.media-modal-content .attachment-details .autoaltai-generate-button .button,
.media-modal-content .autoaltai-generate-button .button {margin:0;}

.media-modal-content .attachment-details .autoaltai-generate-button .button,
.media-modal-content .autoaltai-generate-button .button { color: #ffffff; }

.media-modal-content .autoaltai-generate-button .button:hover,.media-modal-content .autoaltai-generate-button .button:focus {
    color: #ffffff;
}

.autoaltai-generate-button { clear: both; font-family: Inter, sans-serif;margin: 10px 0;}

.autoaltai-generate-button .button {
    background-color: #B30000;
    border: none;
    color: #ffffff;
    font-family: Inter, sans-serif;
    display: flex;
    width: max-content;
    align-items: center;
    min-height: auto;
    padding: 7px 10px 10px 10px;
    margin: 0 0 7px 0;
    gap: 6px;
    transition: 400ms;
}

.autoaltai-generate-button .button > span { line-height: normal; }

.autoaltai-generate-button .button > img {
    display: block;
    filter: brightness(0) invert(1);
    width: 13px;
    height: 13px;
}

.autoaltai-generate-button .button:hover, .autoaltai-generate-button .button:focus {
    background-color: #8a0000;
    border: none;
    color: #ffffff;
    box-shadow: none;
}

.autoaltai-generate-button .autoaltai-generate-btn-keyword-wrap {
    margin: 6px 0 0 0;
}

.autoaltai-generate-button .autoaltai-generate-btn-keyword-wrap > input[type="text"] {
    margin: 0;
}

.autoaltai-generate-button .autoaltai-generate-btn-keyword-wrap > input[type="text"],
.autoaltai-generate-button .autoaltai-generate-btn-keyword-wrap > input[type="text"]::placeholder {font-family: Inter, sans-serif;}

.autoaltai-generate-button .autoaltai-generate-btn-checkbox-wrap input {
    margin-top: 0;
}




/* Single image filename rename action shown beside WordPress' Copy URL button. */
.autoaltai-rename-button {
    display: inline-flex;
    flex: 0 0 auto !important;
    align-items: center;
    width: auto !important;
    max-width: 100%;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 0 !important;
    float: none !important;
    line-height: normal;
    vertical-align: middle;
    box-sizing: border-box;
}

/* Match WordPress' small Copy URL button dimensions while keeping AutoAlt branding. */
.autoaltai-rename-button .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: auto;
    min-height: 26px;
    margin: 0;
    padding: 0 8px;
    border-color: #B30000;
    background: #B30000;
    color: #ffffff !important;
    font-size: 11px;
    font-weight: 400;
    line-height: 2.18181818;
    text-decoration: none;
    white-space: nowrap;
    vertical-align: middle;
    box-shadow: none;
}

.autoaltai-rename-button .button:hover,
.autoaltai-rename-button .button:focus,
.autoaltai-rename-button .button:active {
    border-color: #8a0000;
    background: #8a0000;
    color: #ffffff !important;
    box-shadow: none;
}

.autoaltai-rename-button .button > img {
    display: block;
    flex: 0 0 13px;
    width: 13px;
    height: 13px;
    margin: 0;
    padding: 0;
    filter: brightness(0) invert(1);
}

/* WordPress applies generic attachment-detail styles to every nested span. */
.media-modal .attachment-details .autoaltai-rename-button .button > span,
.media-modal-content .attachment-details .autoaltai-rename-button .button > span,
body.post-type-attachment .autoaltai-rename-button .button > span,
.autoaltai-rename-button .button > span {
    display: inline !important;
    float: none !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    color: #ffffff !important;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit !important;
    text-decoration: none;
}

.autoaltai-rename-button .button:hover > span,
.autoaltai-rename-button .button:focus > span,
.autoaltai-rename-button .button:active > span {
    color: #ffffff !important;
}

.autoaltai-rename-btn.disable,
.autoaltai-rename-btn[aria-busy="true"] {
    opacity: 0.6;
    pointer-events: none;
    cursor: not-allowed;
}

/* Keep both URL actions aligned and let them wrap cleanly on narrow sidebars. */
.autoaltai-rename-actions {
    display: flex !important;
    align-items: center;
    flex-wrap: wrap;
    column-gap: 8px;
    row-gap: 6px;
    box-sizing: border-box;
}

/* WordPress applies responsive widths/margins to controls inside attachment settings.
   Reset only the two action controls so they stay on one line whenever space permits. */
.autoaltai-rename-actions > .copy-attachment-url,
.autoaltai-rename-actions > button[data-clipboard-target],
.autoaltai-rename-actions > .autoaltai-rename-button {
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: 100%;
    margin: 0 !important;
}

.autoaltai-rename-feedback {
    display: block !important;
    clear: both;
    float: none !important;
    min-height: 0 !important;
    margin: 6px 0 0 0 !important;
    padding: 0 !important;
    line-height: normal !important;
}

.autoaltai-rename-actions > .autoaltai-rename-feedback {
    flex: 0 0 100%;
    width: 100% !important;
    clear: none;
    margin: 0 !important;
}

body.post-type-attachment .autoaltai-rename-button {
    margin-top: 0;
}

/* ============================================================================
   ALERT / MESSAGE BOXES
   ============================================================================ */

.autoaltai-generate-button .autoaltai-alert,
.autoaltai-generate-button .autoalt-response,
.autoaltai-rename-feedback .autoaltai-alert {
    padding: 4px 15px;
    margin: 6px 0 0 0;
    font-size: 12px;
    line-height: 20px;
    font-weight: 500;
    font-family: var(--bodyfontfamily);
    border-radius: 4px;
    width: fit-content;
}

/* WordPress gives spans inside attachment settings float, width and padding.
   Reset those rules so rename feedback stays in the URL value column. */
.media-modal .attachment-details .autoaltai-rename-feedback .autoaltai-alert,
.media-modal-content .attachment-details .autoaltai-rename-feedback .autoaltai-alert,
body.post-type-attachment .autoaltai-rename-feedback .autoaltai-alert,
.autoaltai-rename-feedback .autoaltai-alert {
    display: block !important;
    float: none !important;
    min-height: 0 !important;
    width: fit-content !important;
    max-width: 100%;
    margin: 0 !important;
    padding: 4px 15px !important;
    line-height: 20px !important;
    box-sizing: border-box;
    white-space: normal;
    overflow-wrap: anywhere;
}

/* Success Message */
.autoaltai-generate-button .autoaltai-alert.autoaltai-alert-success,
.autoaltai-generate-button .autoaltai-alert.autoaltai-success,
.autoaltai-generate-button .autoalt-response.text-success,
.autoaltai-rename-feedback .autoaltai-alert.autoaltai-success {
    color: #155724;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
}

/* Error Message */
.autoaltai-generate-button .autoaltai-alert.autoaltai-alert-error,
.autoaltai-generate-button .autoaltai-alert.autoaltai-error,
.autoaltai-generate-button .autoalt-response.text-error,
.autoaltai-rename-feedback .autoaltai-alert.autoaltai-error {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
}

/* Info Message */
.autoaltai-generate-button .autoaltai-alert.autoaltai-alert-info,
.autoaltai-generate-button .autoaltai-alert.autoaltai-info {
    color: #004085;
    background-color: #cce5ff;
    border: 1px solid #b8daff;
}

/* Warning Message */
.autoaltai-generate-button .autoaltai-alert.autoaltai-alert-warning,
.autoaltai-generate-button .autoaltai-alert.autoaltai-warning {
    color: #856404;
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
}

#adminmenu li.menu-top a.toplevel_page_autoaltai-bulk-generate .wp-menu-image.dashicons-before img{ max-width: 18px; margin: 0 auto; }

.autoaltai-generate-btn.disable,
.autoaltai-generate-btn[aria-disabled="true"] {
    opacity: 0.6;
    pointer-events: none;
    cursor: not-allowed;
}

@media only screen and (max-width: 1199px) {
    .media-modal .edit-attachment-frame .attachment-details .autoaltai-generate-button .button,
    .media-modal-content .attachment-details .autoaltai-generate-button .button {
        margin: 0;
    }

    .media-modal .edit-attachment-frame .attachment-details .autoaltai-generate-button,
    .media-modal-content .attachment-details .autoaltai-generate-button {
        margin: 63px 0 10px 0;
    }

    

    .autoaltai-generate-button .autoaltai-generate-btn-checkbox-wrap input {
        line-height: normal;
        height: 20px;
        width: 20px;
        margin-right: 8px;
    }

    
    
}

@media only screen and (max-width: 991px) {
    
.media-modal-content .autoaltai-generate-button .button { margin: 13px 0 10px 0; }
}

@media only screen and (max-width: 900px) {

.media-modal-content .autoaltai-generate-button {
    margin: 0 20px 10px 20px;
}
}

@media only screen and (max-width: 782px) {
    .autoaltai-rename-actions {
        align-items: flex-start;
    }

    .autoaltai-rename-actions > .copy-attachment-url,
    .autoaltai-rename-actions > button[data-clipboard-target],
    .autoaltai-rename-actions > .autoaltai-rename-button {
        margin: 0 !important;
    }
}

@media only screen and (max-width: 767px) {
    .autoaltai-generate-button .autoaltai-generate-btn-checkbox-wrap input {
        height: 16px;
        width: 16px;
    }
    
}