/* trigger button in the row */
.ep-ig-sc-trigger {
    margin-right: 6px;
    background: linear-gradient(135deg, #6354a5 0%, #b04ea3 100%) !important;
    color: #fff !important;
    border: 0 !important;
}

.ep-ig-sc-trigger .dashicons {
    color: #fff;
}

.ep-ig-sc-trigger:hover {
    filter: brightness(1.05);
}

/* overlay */
.ep-ig-sc-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 22, 36, 0.7);
    backdrop-filter: blur(2px);
    z-index: 100000;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 16px;
    overflow-y: auto;
    animation: epIgScFadeIn .15s ease-out;
}

.ep-ig-sc-modal-overlay.is-open {
    display: flex;
}

@keyframes epIgScFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* modal frame */
.ep-ig-sc-modal {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
    max-width: 720px;
    width: 100%;
    position: relative;
    font-size: 14px;
    color: #2c3142;
    overflow: hidden;
    clip-path: inset(0 round 14px);
    isolation: isolate;
    animation: epIgScRise .18s ease-out;
}

@keyframes epIgScRise {
    from {
        transform: translateY(12px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* header */
.ep-ig-sc-header {
    background: linear-gradient(135deg, #6354a5 0%, #b04ea3 60%, #f08a3c 100%);
    color: #fff;
    padding: 22px 28px;
    border-top-left-radius: 14px;
    border-top-right-radius: 14px;
}

.ep-ig-sc-header h3 {
    margin: 0;
    color: #fff;
    font-size: 18px;
    line-height: 1.3;
}

.ep-ig-sc-header .ep-ig-sc-sub {
    margin: 6px 0 0;
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
}

.ep-ig-sc-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    border: 0;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    color: #fff;
    transition: background .15s, transform .15s;
}

.ep-ig-sc-close:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: rotate(90deg);
}

/* body */
.ep-ig-sc-body {
    padding: 18px 28px 20px;
    max-height: calc(90vh - 240px);
    overflow-y: auto;
}

/* fields */
.ep-ig-sc-modal label {
    font-weight: 600;
    display: block;
    margin-bottom: 6px;
    font-size: 12.5px;
    color: #4a4f63;
    letter-spacing: .01em;
}

.ep-ig-sc-modal .form__control {
    width: 100%;
    height: 38px;
    padding: 0 12px;
    border: 1px solid #d8dbe5;
    border-radius: 8px;
    box-sizing: border-box;
    background: #fff;
    font-size: 13px;
    color: #2c3142;
    transition: border-color .15s, box-shadow .15s;
}

.ep-ig-sc-modal .form__control:focus {
    outline: none;
    border-color: #6354a5;
    box-shadow: 0 0 0 3px rgba(99, 84, 165, 0.15);
}

.ep-ig-sc-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
}

@media (min-width: 600px) {
    .ep-ig-sc-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* sections (collapsible) */
.ep-ig-sc-section {
    margin-top: 12px;
    border: 1px solid #ecedf3;
    border-radius: 10px;
    background: #fafbfd;
    padding: 0 16px;
    transition: border-color .15s;
}

.ep-ig-sc-section[open] {
    background: #fff;
    border-color: #e1e3ed;
}

.ep-ig-sc-section summary {
    cursor: pointer;
    padding: 13px 0;
    font-weight: 600;
    color: #2c3142;
    list-style: none;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
}

.ep-ig-sc-section summary::-webkit-details-marker {
    display: none;
}

.ep-ig-sc-section summary::before {
    content: "";
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%237c8194'%3E%3Cpath d='M6 4l4 4-4 4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    transition: transform .15s;
}

.ep-ig-sc-section[open] summary::before {
    transform: rotate(90deg);
}

.ep-ig-sc-section>*:not(summary) {
    padding-bottom: 14px;
}

.ep-ig-sc-section .pro-badge {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #5B4E96;
    color: #fff;
    font-weight: 700;
    letter-spacing: .05em;
    margin-left: 6px;
}

/* toggle chips */
.ep-ig-sc-toggles {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

@media (min-width: 600px) {
    .ep-ig-sc-toggles {
        grid-template-columns: repeat(3, 1fr);
    }
}

.ep-ig-sc-toggles label {
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 8px 10px;
    background: #fff;
    border: 1px solid #ecedf3;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    color: #4a4f63;
    font-size: 13px;
}

.ep-ig-sc-toggles label:hover {
    border-color: #c9c4e0;
}

.ep-ig-sc-toggles input[type="checkbox"] {
    accent-color: #6354a5;
    width: 16px;
    height: 16px;
    margin: 0;
}

/* sticky output footer */
.ep-ig-sc-output-wrap {
    padding: 16px 28px 20px;
    background: #f6f7fb;
    border-top: 1px solid #ecedf3;
}

.ep-ig-sc-output-wrap label {
    font-size: 12.5px;
    margin-bottom: 8px;
}

.ep-ig-sc-modal textarea.form__control {
    height: auto;
    padding: 12px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12.5px;
    line-height: 1.55;
    color: #2c3142;
    background: #fff;
    resize: vertical;
}

.ep-ig-sc-actions {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.ep-ig-sc-actions .button__themeColor {
    background: linear-gradient(135deg, #6354a5, #b04ea3) !important;
    color: #fff !important;
    border: 0 !important;
    padding: 8px 18px !important;
    height: auto !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    box-shadow: 0 4px 14px rgba(99, 84, 165, 0.25);
    transition: transform .12s, box-shadow .15s;
}

.ep-ig-sc-actions .button__themeColor:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(99, 84, 165, 0.35);
}

.ep-ig-sc-actions #ep-ig-sc-copy-msg {
    color: #0a8a3a;
    font-weight: 600;
    font-size: 13px;
    display: none;
    align-items: center;
    gap: 4px;
}

.ep-ig-sc-actions #ep-ig-sc-copy-msg.is-visible {
    display: inline-flex;
}

.ep-ig-sc-actions #ep-ig-sc-copy-msg::before {
    content: "✓";
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #0a8a3a;
    color: #fff;
    text-align: center;
    line-height: 18px;
    font-size: 11px;
}
