/* ==================================================
   Nuclear Fancy Pants Edition™ -- NUCLEAR+++
   File: /home/ploi/automarketer-ai.com/public/wp-content/plugins/automarketer-ai/assets/css/blog-generator.css
   Description: Blog post generator modal styles
   Last Edited: 2026-04-24
   ================================================== */
@import url('fonts.css');

.amai-gen-btn-wrap {
    margin: 0 0 12px;
}

.amai-gen-trigger-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 16px;
    background: #D97757;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: "Nunito", sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
}

.amai-gen-trigger-btn:hover {
    background: #c4623d;
}

/* Modal */
.amai-gen-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(26, 22, 20, 0.55);
    backdrop-filter: blur(3px);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.amai-gen-modal.show {
    display: flex;
}

.amai-gen-wrap {
    background: #fff;
    border-radius: 20px;
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 64px rgba(0,0,0,0.18);
    font-family: "DM Sans", sans-serif;
    animation: amaiGenSpring 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
}

@keyframes amaiGenSpring {
    from { opacity: 0; transform: scale(0.94) translateY(12px); }
    to   { opacity: 1; transform: scale(1)    translateY(0);    }
}

.amai-gen-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 24px 28px 16px;
    border-bottom: 1px solid #F0EBE6;
}

.amai-gen-eyebrow {
    font-size: 11px;
    font-weight: 600;
    color: #D97757;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 4px;
}

.amai-gen-title {
    font-family: "Nunito", sans-serif;
    font-size: 20px;
    font-weight: 800;
    color: #1C1917;
}

.amai-gen-close {
    background: none;
    border: none;
    font-size: 22px;
    color: #78716C;
    cursor: pointer;
    line-height: 1;
    padding: 0 0 0 12px;
}

.amai-gen-close:hover { color: #1C1917; }

.amai-gen-body {
    padding: 20px 28px;
    flex: 1;
}

.amai-gen-desc {
    font-size: 13.5px;
    color: #57534E;
    margin: 0 0 16px;
    line-height: 1.5;
}

.amai-gen-titles-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.amai-gen-title-card {
    padding: 12px 16px;
    border: 1.5px solid #E7DDD5;
    border-radius: 10px;
    font-size: 14px;
    color: #1C1917;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    line-height: 1.45;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.amai-gen-title-text {
    display: block;
}
.amai-gen-title-pill {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: #78716C;
    background: #F5F0EC;
    border: 1px solid #E7DDD5;
    border-radius: 20px;
    padding: 2px 8px;
    line-height: 1.5;
    align-self: flex-start;
}

.amai-gen-title-card:hover {
    border-color: #D97757;
    background: #FFF8F5;
}

.amai-gen-title-card.selected {
    border-color: #D97757;
    background: #FFF8F5;
    box-shadow: 0 0 0 3px rgba(217,119,87,0.15);
}

.amai-gen-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 0;
    font-size: 13.5px;
    color: #78716C;
}

.amai-gen-spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid #E7DDD5;
    border-top-color: #D97757;
    border-radius: 50%;
    animation: amaiGenSpin 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes amaiGenSpin {
    to { transform: rotate(360deg); }
}

.amai-gen-error {
    padding: 10px 14px;
    background: #FEF2F2;
    border: 1.5px solid #FECACA;
    border-radius: 8px;
    color: #DC2626;
    font-size: 13px;
}

.amai-gen-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 28px 24px;
    border-top: 1px solid #F0EBE6;
}

.amai-gen-btn-primary {
    padding: 9px 22px;
    background: #D97757;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: "Nunito", sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
}

.amai-gen-btn-primary:hover:not(:disabled) { background: #c4623d; }
.amai-gen-btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }

.amai-gen-btn-secondary {
    display: inline-flex;
    padding: 9px 18px;
    background: transparent;
    color: #78716C;
    border: 1.5px solid #E7DDD5;
    border-radius: 8px;
    font-family: "Nunito", sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

.amai-gen-btn-secondary:hover { border-color: #D97757; color: #D97757; }


/* --------------------------------------------------
   Writing overlay -- Stage 2
   -------------------------------------------------- */
.amai-gen-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(249, 250, 251, 0.92);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
}
.amai-gen-overlay-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    text-align: center;
}
.amai-gen-overlay-title {
    font-family: 'Nunito', sans-serif;
    font-size: 22px;
    font-weight: 800;
    color: #1C1917;
}
.amai-gen-overlay-msg {
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    color: #78716C;
}
.amai-gen-spinner--lg {
    width: 48px;
    height: 48px;
    border-width: 4px;
}

/* Start here indicator */
.amai-gen-start-here {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Nunito', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: #D97757;
    margin-left: 10px;
    letter-spacing: 0.01em;
}
.amai-gen-start-here strong {
    font-weight: 800;
}


/* --------------------------------------------------
   Image manager meta box
   -------------------------------------------------- */
.amai-img-manager {
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    color: #1C1917;
}

.amai-img-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1.5px solid #E7DDD5;
    margin-bottom: 14px;
}

.amai-img-tab {
    background: none;
    border: none;
    border-bottom: 2.5px solid transparent;
    margin-bottom: -1.5px;
    padding: 7px 12px;
    font-family: 'Nunito', sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: #78716C;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.amai-img-tab:hover { color: #D97757; }

.amai-img-tab.active {
    color: #D97757;
    border-bottom-color: #D97757;
}

.amai-img-tab--remove { margin-left: auto; }
.amai-img-tab--remove:hover { color: #DC2626; }
.amai-img-tab--remove.active { color: #DC2626; border-bottom-color: #DC2626; }

.amai-img-panel { display: none; }
.amai-img-panel.active { display: block; }

.amai-img-search-row {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}

.amai-img-input {
    flex: 1;
    padding: 6px 10px;
    border: 1.5px solid #E7DDD5;
    border-radius: 6px;
    font-family: 'DM Sans', sans-serif;
    font-size: 12.5px;
    color: #1C1917;
    background: #fff;
    outline: none;
    transition: border-color 0.15s;
    min-width: 0;
}

.amai-img-input:focus { border-color: #D97757; }

.amai-img-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1.5px solid #E7DDD5;
    border-radius: 6px;
    font-family: 'DM Sans', sans-serif;
    font-size: 12.5px;
    color: #1C1917;
    background: #fff;
    outline: none;
    resize: vertical;
    transition: border-color 0.15s;
    margin-bottom: 10px;
    line-height: 1.5;
}

.amai-img-textarea:focus { border-color: #D97757; }

.amai-img-btn-primary {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    background: #D97757;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-family: 'Nunito', sans-serif;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
}

.amai-img-btn-primary:hover:not(:disabled) { background: #c4623d; }
.amai-img-btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }

.amai-img-btn-danger {
    display: inline-flex;
    align-items: center;
    padding: 7px 16px;
    background: transparent;
    color: #DC2626;
    border: 1.5px solid #FECACA;
    border-radius: 6px;
    font-family: 'Nunito', sans-serif;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    margin-top: 4px;
}

.amai-img-btn-danger:hover { background: #FEF2F2; border-color: #DC2626; }

.amai-img-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-top: 4px;
}

.amai-img-thumb {
    position: relative;
    aspect-ratio: 1;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.15s;
}

.amai-img-thumb:hover { border-color: #D97757; }
.amai-img-thumb.selected { border-color: #D97757; box-shadow: 0 0 0 2px rgba(217,119,87,0.25); }

.amai-img-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.amai-img-thumb-credit {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 3px 5px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 9px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0;
    transition: opacity 0.15s;
}

.amai-img-thumb:hover .amai-img-thumb-credit { opacity: 1; }

.amai-img-set-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.amai-img-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 0;
    font-size: 12.5px;
    color: #78716C;
}

.amai-img-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #E7DDD5;
    border-top-color: #D97757;
    border-radius: 50%;
    animation: amaiGenSpin 0.7s linear infinite;
    flex-shrink: 0;
}

.amai-img-error {
    padding: 8px 12px;
    background: #FEF2F2;
    border: 1.5px solid #FECACA;
    border-radius: 6px;
    color: #DC2626;
    font-size: 12px;
    margin-top: 8px;
}

.amai-img-success {
    padding: 8px 12px;
    background: #F0FDF4;
    border: 1.5px solid #BBF7D0;
    border-radius: 6px;
    color: #15803D;
    font-size: 12px;
    margin-top: 10px;
}

.amai-img-remove-desc {
    font-size: 12.5px;
    color: #78716C;
    line-height: 1.5;
    margin: 0 0 10px;
}