/* =====================================================
   منصة الأوامر الذكية — نظام التفاعل الموحد
   assets/css/interaction.css | v1.0 | AN7
   ===================================================== */

/* ===== شريط الإجراءات ===== */
.action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 12px 16px;
    margin: 0 0 32px;
    backdrop-filter: blur(8px);
}

/* الزر الأساسي */
.ab-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: #fff;
    font-family: 'Tajawal', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    padding: 11px 24px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all .2s ease;
    flex-shrink: 0;
}
.ab-primary:hover {
    background: linear-gradient(135deg, #6d28d9, #5b21b6);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(124,58,237,0.4);
}
.ab-primary .ab-icon { font-size: 1.1rem; }

/* الأزرار الثانوية */
.ab-secondary {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-right: auto;
}
[dir="ltr"] .ab-secondary { margin-right: 0; margin-left: auto; }

.ab-icon-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 8px 14px;
    cursor: pointer;
    transition: all .2s ease;
    color: #9ca3af;
    font-family: 'Tajawal', sans-serif;
    min-width: 58px;
}
.ab-icon-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
    color: #fff;
    transform: translateY(-1px);
}
.ab-icon-btn .ab-ico { font-size: 1.2rem; line-height: 1; }
.ab-icon-btn .ab-label { font-size: 0.7rem; white-space: nowrap; }

/* حالات خاصة */
.ab-icon-btn.ab-favorited { color: #facc15; border-color: rgba(250,204,21,0.3); background: rgba(250,204,21,0.08); }
.ab-icon-btn.ab-favorited:hover { background: rgba(250,204,21,0.15); }
.ab-icon-btn.ab-rated { color: #06b6d4; border-color: rgba(6,182,212,0.3); background: rgba(6,182,212,0.08); }

/* ===== النوافذ المنبثقة (Modals) ===== */
.ab-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}
.ab-modal-box {
    background: #0f172a;
    border: 1px solid rgba(124,58,237,0.3);
    border-radius: 20px;
    padding: 32px;
    width: 100%;
    max-width: 440px;
    direction: rtl;
    text-align: right;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.ab-modal-box h3 {
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 20px;
}
.ab-modal-box textarea,
.ab-modal-box select {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 10px 14px;
    color: #e2e8f0;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.95rem;
    resize: vertical;
    margin-bottom: 16px;
    box-sizing: border-box;
    direction: rtl;
}
.ab-modal-box textarea:focus,
.ab-modal-box select:focus { outline: none; border-color: #7c3aed; }
.ab-modal-box select option { background: #0f172a; }

/* نجوم التقييم */
.ab-stars {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 20px;
    flex-direction: row-reverse;
}
.ab-star {
    font-size: 2rem;
    cursor: pointer;
    color: rgba(255,255,255,0.2);
    transition: color .15s, transform .15s;
    user-select: none;
}
.ab-star.active, .ab-star.hover { color: #facc15; transform: scale(1.1); }

/* أزرار النوافذ */
.ab-modal-actions { display: flex; gap: 10px; }
.ab-btn-submit {
    flex: 1; padding: 11px; border-radius: 10px; border: none;
    background: #7c3aed; color: #fff; font-family: 'Tajawal', sans-serif;
    font-size: 1rem; font-weight: 700; cursor: pointer; transition: background .2s;
}
.ab-btn-submit:hover { background: #6d28d9; }
.ab-btn-submit:disabled { opacity: .6; cursor: not-allowed; }
.ab-btn-cancel {
    padding: 11px 20px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.1);
    background: transparent; color: #9ca3af; font-family: 'Tajawal', sans-serif;
    font-size: 1rem; cursor: pointer; transition: all .2s;
}
.ab-btn-cancel:hover { background: rgba(255,255,255,0.05); color: #fff; }

/* أزرار المشاركة */
.ab-share-btns { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.ab-share-wa, .ab-share-x, .ab-share-copy {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px; border-radius: 12px; font-family: 'Tajawal', sans-serif;
    font-size: 0.95rem; font-weight: 700; cursor: pointer; text-decoration: none;
    transition: all .2s; border: none;
}
.ab-share-wa  { background: #25d366; color: #fff; }
.ab-share-wa:hover  { background: #1da851; }
.ab-share-x   { background: #000; color: #fff; border: 1px solid #333; }
.ab-share-x:hover   { background: #111; }
.ab-share-copy { background: rgba(124,58,237,0.2); color: #a78bfa; border: 1px solid rgba(124,58,237,0.3); }
.ab-share-copy:hover { background: rgba(124,58,237,0.3); }

/* ===== Toast الإشعارات ===== */
#ab-toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}
[dir="ltr"] #ab-toast-container { right: auto; left: 24px; }

.ab-toast {
    padding: 12px 20px;
    border-radius: 12px;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    opacity: 0;
    transform: translateY(10px);
    transition: all .3s ease;
    max-width: 320px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.ab-toast-show { opacity: 1; transform: translateY(0); }
.ab-toast-success { background: linear-gradient(135deg, #059669, #047857); }
.ab-toast-warn    { background: linear-gradient(135deg, #d97706, #b45309); }
.ab-toast-error   { background: linear-gradient(135deg, #dc2626, #b91c1c); }

/* ===== استجابة الجوال ===== */
@media (max-width: 600px) {
    .action-bar { padding: 10px; gap: 8px; }
    .ab-primary { font-size: 0.9rem; padding: 10px 16px; }
    .ab-icon-btn { padding: 7px 10px; min-width: 50px; }
    .ab-icon-btn .ab-label { font-size: 0.65rem; }
    .ab-modal-box { padding: 24px 20px; }
    .ab-share-btns { flex-direction: column; }
}
