/* ── AI Summary Box — Frontend ───────────────────────────────────────────── */

.ai-summary-wrap {
    margin-bottom: 28px;
}

.ai-summary-box {
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.10);
}

/* Header row */
.ai-summary-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    cursor: pointer;
    user-select: none;
    outline: none;
    background: linear-gradient(233.19deg, #8EC850 -256.88%, #428DCB -167.3%, #2AB998 -81.23%, #C2579B -2.2%, #EC7026 80.36%);
}

.ai-summary-header:hover {
    filter: brightness(1.06);
}

.ai-summary-header:focus-visible {
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.7);
}

/* Sparkle icon */
.ai-summary-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    color: #fff;
}

/* Title block */
.ai-summary-title-block {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ai-summary-title {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.ai-summary-tagline {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.65);
    margin-top: 2px;
}

/* Arrow */
.ai-summary-arrow {
    width: 18px;
    height: 18px;
    color: #fff;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.ai-summary-box.is-open .ai-summary-arrow {
    transform: rotate(180deg);
}

/* Divider */
.ai-summary-divider {
    height: 0;
    background: rgba(0, 0, 0, 0.08);
    margin: 0;
    transition: height 0.2s ease;
}

.ai-summary-box.is-open .ai-summary-divider {
    height: 1px;
}

/* Content area — accordion */
.ai-summary-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.ai-summary-box.is-open .ai-summary-content {
    max-height: 1200px;
}

/* Body inside content */
.ai-summary-body {
    padding: 14px 18px 18px;
}

/* Bullet list from wp_editor */
.ai-summary-body ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ai-summary-body ul li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 15px;
    line-height: 1.65;
    color: #333;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.ai-summary-body ul li:last-child {
    margin-bottom: 0;
}

.ai-summary-body ul li.ai-bullet-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Purple dot before each bullet */
.ai-summary-body ul li::before {
    content: '';
    display: block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #6B3FA0;
    flex-shrink: 0;
    margin-top: 7px;
}

/* Paragraph fallback if admin used <p> instead of <ul> */
.ai-summary-body p {
    font-size: 15px;
    line-height: 1.65;
    color: #333;
    margin-bottom: 8px;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media ( max-width: 768px ) {
    .ai-summary-header {
        padding: 12px 14px;
    }
    .ai-summary-body {
        padding: 12px 14px 16px;
    }
    .ai-summary-body ul li {
        font-size: 14px;
    }
    .ai-summary-title {
        font-size: 14px;
    }
}

/* ── Admin Meta Box ───────────────────────────────────────────────────────── */

#ai-summary-metabox {
    padding: 4px 0;
}

#ai-summary-generate {
    margin-bottom: 10px;
}

/* WP spinner inside button */
.ai-btn-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ai-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 4px;
}

@keyframes ai-spin {
    to { transform: rotate(360deg); }
}

/* Review checkbox */
#ai-summary-review-wrap {
    margin-top: 12px;
}

#ai-summary-review-wrap label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
    color: #1d2327;
}

#ai-summary-review-wrap input[type="checkbox"] {
    margin: 0;
    flex-shrink: 0;
}

#ai-summary-review-wrap .description {
    margin-top: 4px;
    margin-left: 24px;
}

/* Notice below editor */
#ai-summary-notice {
    padding: 6px 10px;
    border-radius: 3px;
    font-size: 12px;
    border-left: 4px solid;
}

#ai-summary-notice.is-success {
    background: #edfaef;
    border-color: #00a32a;
    color: #007017;
    display: flex !important;
    align-items: center;
    gap: 5px;
}

#ai-summary-notice.is-error {
    background: #fcf0f1;
    border-color: #d63638;
    color: #d63638;
    display: block !important;
}

#ai-summary-notice.is-warning {
    background: #fff8e5;
    border-color: #dba617;
    color: #7a5500;
    display: block !important;
    font-weight: 500;
}
