/* ══════════════════════════════════════════════════════════════════════════
   خلاصه ساز مقاله نتوبین — طراحی: یاسین کیانی — yasinkiani.ir
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Base ───────────────────────────────────────────────────────────────── */
.netobin-widget {
    direction: rtl;
    font-family: 'Vazirmatn', 'Vazir', 'IRANSans', 'Tahoma', 'Arial', sans-serif;
    background-color: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-sizing: border-box;
}

.netobin-widget *,
.netobin-widget *::before,
.netobin-widget *::after {
    box-sizing: border-box;
    direction: rtl;
}

/* ── Header ─────────────────────────────────────────────────────────────── */
.netobin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.netobin-header-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ── Title ───────────────────────────────────────────────────────────────── */
.netobin-title {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    line-height: 1.4;
}

/* ── AI Badge ────────────────────────────────────────────────────────────── */
.netobin-ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background-color: #6c63ff;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 100px;
    letter-spacing: 0.01em;
    line-height: 1.6;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Read Time ───────────────────────────────────────────────────────────── */
.netobin-read-time {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #9ca3af;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Body ────────────────────────────────────────────────────────────────── */
.netobin-body {
    /* padding controlled by Elementor summary_padding */
}

/* ── Button ──────────────────────────────────────────────────────────────── */
.netobin-btn-wrap {
    padding: 20px 20px 20px;
}

.netobin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: #6c63ff;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 11px 22px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.15s ease;
    direction: rtl;
    text-align: center;
    line-height: 1.4;
}

.netobin-btn:hover {
    background-color: #5a52d5;
    transform: translateY(-1px);
}

.netobin-btn:active {
    transform: translateY(0);
}

.netobin-btn.netobin-btn--loading {
    opacity: 0.65;
    pointer-events: none;
    cursor: default;
    transform: none;
}

.netobin-icon {
    font-size: 14px;
    line-height: 1;
    flex-shrink: 0;
}

/* ── Loading ─────────────────────────────────────────────────────────────── */
.netobin-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 20px;
}

.netobin-dots {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}

.netobin-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #6c63ff;
    animation: netobinBounce 1.3s infinite ease-in-out;
}

.netobin-dot:nth-child(1) { animation-delay: 0s;    }
.netobin-dot:nth-child(2) { animation-delay: 0.18s; }
.netobin-dot:nth-child(3) { animation-delay: 0.36s; }

@keyframes netobinBounce {
    0%, 80%, 100% { transform: scale(0.55); opacity: 0.35; }
    40%           { transform: scale(1);    opacity: 1;    }
}

.netobin-loading-text {
    font-size: 13px;
    color: #6b7280;
    font-family: inherit;
}

/* ── Summary Content ─────────────────────────────────────────────────────── */
.netobin-summary-content {
    direction: rtl;
    font-size: 14px;
    line-height: 1.9;
    color: #374151;
    padding: 20px 20px;
    text-align: justify;
    animation: netobinFadeIn 0.35s ease;
}

.netobin-summary-content p {
    margin: 0 0 14px;
    direction: rtl;
}

.netobin-summary-content p:last-child {
    margin-bottom: 0;
}

.netobin-summary-formal {
    text-align: justify;
}

.netobin-summary-list {
    margin: 0;
    padding: 0;
    padding-right: 22px;
    padding-left: 0;
    list-style-type: disc;
}

.netobin-summary-list li {
    direction: rtl;
    margin-bottom: 8px;
    line-height: 1.75;
}

/* Typewriter cursor */
.netobin-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background-color: #6c63ff;
    margin-right: 1px;
    vertical-align: text-bottom;
    border-radius: 1px;
    animation: netobinBlink 0.75s step-end infinite;
}

@keyframes netobinBlink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

/* ── Error ───────────────────────────────────────────────────────────────── */
.netobin-error {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 16px 20px;
    color: #dc2626;
    font-size: 13px;
    font-family: inherit;
    direction: rtl;
}

.netobin-error svg {
    flex-shrink: 0;
    opacity: 0.85;
    margin-top: 2px;
}

.netobin-error-text {
    white-space: pre-line;
    line-height: 1.7;
}

/* ── Animations ──────────────────────────────────────────────────────────── */
@keyframes netobinFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0);   }
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .netobin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 14px 16px;
    }

    .netobin-read-time {
        align-self: flex-end;
    }

    .netobin-summary-content,
    .netobin-loading,
    .netobin-btn-wrap,
    .netobin-error {
        padding-right: 16px;
        padding-left: 16px;
    }
}

@media (max-width: 480px) {
    .netobin-widget {
        border-radius: 8px;
    }

    .netobin-btn {
        width: 100%;
        justify-content: center;
    }

    .netobin-title {
        font-size: 14px;
    }

    .netobin-summary-content {
        font-size: 13px;
    }
}

/* ── RTL overrides for LTR themes ────────────────────────────────────────── */
.netobin-widget,
.netobin-widget * {
    text-align: right;
}

.netobin-summary-list {
    text-align: right;
    padding-left: 0 !important;
    padding-right: 22px !important;
}
