/* ── Surmahal AI News Summary Widget v2 ── */

.sais-widget {
    margin: 0 0 28px 0;
    font-family: inherit;
}

/* ─── Main trigger button ─── */
.sais-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    background: linear-gradient(135deg, #6c47ff 0%, #a855f7 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 10px rgba(108,71,255,0.30);
}
.sais-btn:hover  { opacity: 0.88; transform: translateY(-1px); }
.sais-btn:active { transform: translateY(0); }
.sais-btn:disabled { opacity: 0.65; cursor: not-allowed; transform: none; }

/* ─── Spinner inside button ─── */
.sais-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: sais-spin 0.7s linear infinite;
    flex-shrink: 0;
}
@keyframes sais-spin { to { transform: rotate(360deg); } }

/* ─── Format picker panel ─── */
.sais-format-picker {
    margin-top: 4px;
    padding: 18px 20px;
    background: #f8f7ff;
    border: 1px solid #e0d9ff;
    border-radius: 10px;
    animation: sais-fade-in 0.3s ease;
}
.sais-format-question {
    margin: 0 0 14px 0;
    font-size: 14px;
    font-weight: 600;
    color: #3d2b99;
}
.sais-format-options {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.sais-format-btn {
    flex: 1;
    min-width: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 16px 12px;
    background: #fff;
    border: 2px solid #ddd6fe;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, transform 0.12s;
    text-align: center;
}
.sais-format-btn:hover {
    border-color: #7c3aed;
    background: #f5f3ff;
    transform: translateY(-2px);
}
.sais-format-btn:active { transform: translateY(0); }
.sais-format-icon {
    font-size: 22px;
    line-height: 1;
}
.sais-format-btn strong {
    font-size: 14px;
    color: #1e1433;
    font-weight: 700;
}
.sais-format-btn small {
    font-size: 12px;
    color: #777;
}

/* ─── Skeleton loader ─── */
.sais-skeleton {
    margin-top: 4px;
    padding: 18px 20px;
    background: #f8f7ff;
    border: 1px solid #e0d9ff;
    border-radius: 10px;
}
.sais-skeleton-line {
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, #ede9fe 25%, #d4c5ff 50%, #ede9fe 75%);
    background-size: 200% 100%;
    animation: sais-shimmer 1.4s infinite;
    margin-bottom: 10px;
    width: 100%;
}
.sais-skeleton-line:last-child { margin-bottom: 0; }
@keyframes sais-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ─── Summary result box ─── */
.sais-box {
    margin-top: 4px;
    padding: 18px 20px 14px;
    background: #f8f7ff;
    border-left: 4px solid #6c47ff;
    border-radius: 0 10px 10px 0;
    animation: sais-fade-in 0.4s ease;
}
@keyframes sais-fade-in {
    from { opacity: 0; transform: translateY(-5px); }
    to   { opacity: 1; transform: translateY(0); }
}

.sais-box-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.sais-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #6c47ff;
}
.sais-badge {
    font-size: 10px;
    padding: 2px 8px;
    background: #ede9fe;
    color: #5b21b6;
    border-radius: 99px;
    font-weight: 600;
}
.sais-badge--format {
    background: #6c47ff;
    color: #fff;
}
.sais-badge--cached {
    background: #dcfce7;
    color: #166534;
}

/* ─── Paragraph summary ─── */
.sais-text {
    font-size: 15px;
    line-height: 1.68;
    color: #2d2d2d;
    margin: 0;
}

/* ─── Bullet summary ─── */
.sais-bullets {
    margin: 0;
    padding: 0;
    list-style: none;
}
.sais-bullets li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 9px;
    font-size: 15px;
    line-height: 1.6;
    color: #2d2d2d;
}
.sais-bullets li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #6c47ff;
    font-weight: 700;
}
.sais-bullets li:last-child { margin-bottom: 0; }

/* ─── Footer / change format ─── */
.sais-box-footer {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #e5deff;
}
.sais-retry-btn {
    background: none;
    border: none;
    font-size: 12px;
    color: #7c3aed;
    cursor: pointer;
    padding: 0;
    font-weight: 600;
    opacity: 0.8;
    transition: opacity 0.15s;
}
.sais-retry-btn:hover { opacity: 1; text-decoration: underline; }

/* ─── Error state ─── */
.sais-error {
    margin-top: 10px;
    padding: 10px 16px;
    background: #fff1f1;
    border-left: 4px solid #ef4444;
    border-radius: 0 6px 6px 0;
    font-size: 13px;
    color: #b91c1c;
    animation: sais-fade-in 0.3s ease;
}

/* ─── Dark mode ─── */
@media (prefers-color-scheme: dark) {
    .sais-format-picker,
    .sais-skeleton,
    .sais-box {
        background: #1e1433;
        border-color: #4c1d95;
    }
    .sais-format-question { color: #c4b5fd; }
    .sais-format-btn {
        background: #2d1f4e;
        border-color: #4c1d95;
    }
    .sais-format-btn:hover {
        background: #3b2465;
        border-color: #7c3aed;
    }
    .sais-format-btn strong { color: #e9d5ff; }
    .sais-format-btn small  { color: #9ca3af; }
    .sais-box { border-color: #a855f7; }
    .sais-label  { color: #c084fc; }
    .sais-badge  { background: #2d1f4e; color: #c084fc; }
    .sais-badge--format { background: #7c3aed; color: #fff; }
    .sais-badge--cached { background: #14532d; color: #86efac; }
    .sais-text   { color: #e5e7eb; }
    .sais-bullets li { color: #e5e7eb; }
    .sais-bullets li::before { color: #a855f7; }
    .sais-box-footer { border-color: #3b2465; }
    .sais-retry-btn  { color: #c084fc; }
    .sais-skeleton-line {
        background: linear-gradient(90deg, #2d1f4e 25%, #3b2465 50%, #2d1f4e 75%);
        background-size: 200% 100%;
    }
}
