/**
 * Smart Owl AI Advantage Mashup - CSS Styles
 * Version: 1.0.2
 */

/* Main mashup panel box (inserted under Smart Owl Get Response button) */
.soaam-mashup-controls {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 16px;
    margin: 14px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,.06);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.soaam-mashup-controls * {
    box-sizing: border-box;
}

.soaam-position-toggle {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 6px;
    border: 1px solid #e5e5e5;
    margin-bottom: 12px;
}
.soaam-position-toggle label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
}
.soaam-position-toggle input[type="radio"] { margin: 0; }

.soaam-instruction-area textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font: inherit;
    font-size: 14px;
    resize: vertical;
}
.soaam-both-instructions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.soaam-both-instructions label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}
.soaam-before-instructions, .soaam-after-instructions {
    display: flex; flex-direction: column;
}

.soaam-action-buttons {
    display: flex;
    justify-content: center;
    margin-top: 12px;
}
.soaam-action-buttons .button-primary {
    min-width: 220px;
}

/* ------------------------------------------------------------------
   Select control placement in response header (fix overlap with copy)
   ------------------------------------------------------------------ */

/* Ensure response header can align items on one row and wrap cleanly */
.response-header {
    display: flex;
    align-items: center;
    gap: 8px;            /* space between title, copy, and select */
    flex-wrap: wrap;     /* allow wrapping on small screens */
}

/* Title stretches but can wrap when needed */
.response-header h3 {
    flex: 1 1 auto;
    min-width: 200px;
}

/* Copy button remains a small inline control */
.response-header .copy-response {
    flex: 0 0 auto;
    margin-left: 6px;
}

/* Mashup “Select” control: inline to the right of copy, never overlap */
.response-header .soaam-select {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 6px;        /* space after the copy button */
    font-size: 12px;
    color: #555;
    vertical-align: middle;
    position: relative;
    z-index: 1;              /* above background, not over buttons */
    background: transparent; /* avoid covering icon with a background box */
    padding: 0;              /* keep hitbox tight */
    line-height: 1.2;
    user-select: none;
}

/* Checkbox sizing and color */
.response-header .soaam-select input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: #2271b1;  /* native check color (modern browsers) */
    margin: 0;
    padding: 0;
}

/* Optional: improve visibility of the checked state where accent-color isn't supported */
.response-header .soaam-select input[type="checkbox"]:checked {
    outline: 1px solid #2271b1;
}

/* When the header wraps, keep the order sensible */
@media (max-width: 640px) {
    .response-header {
        gap: 6px;
    }
    .response-header .copy-response,
    .response-header .soaam-select {
        order: 2; /* push controls after the title on wrap */
    }
    .response-header h3 {
        order: 1;
        min-width: 0;
    }
}

/* Notifications */
.soaam-notice {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 16px;
    border-radius: 4px;
    color: #fff;
    font-weight: 500;
    z-index: 9999;
    max-width: 320px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: soaam-slide-in 0.3s ease-out;
}
.soaam-notice-success { background: #46b450; }
.soaam-notice-error   { background: #dc3232; }

@keyframes soaam-slide-in {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0);   opacity: 1; }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .soaam-both-instructions { grid-template-columns: 1fr; }
    .soaam-mashup-controls { padding: 12px; }
    .soaam-action-buttons .button-primary { width: 100%; min-width: auto; }
}

/* Print: hide the mashup controls */
@media print {
    .soaam-mashup-controls { display: none !important; }
}