/* Instagram Intelligence — Phase 3 (المنافسون).
   تعتمد على style.css/dashboard.css/instagram-settings.css المُحمَّلة مسبقاً
   (نفس بادئة ig- واتفاقية Phase 1/2) — فقط ما هو جديد فعلياً هنا: التبويبات
   الفرعية، شريط فلاتر القائمة، نقطة نشط/معطَّل، نسب أنواع المحتوى، والنافذة
   المنبثقة (لا يوجد Modal عام جاهز في style.css/dashboard.css يستحق إعادة
   استخدامه بلا كوبلينج غير ضروري مع curtain_designer.css). */

.ig-subtabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border, #e5e5e5);
  margin-bottom: 4px;
}
.ig-subtab {
  padding: 8px 16px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2, #666);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.ig-subtab.active {
  color: var(--accent, #2f6f4e);
  border-bottom-color: var(--accent, #2f6f4e);
}
.ig-subtab:hover:not(.active) { color: var(--text, #1a1a1a); }

.ig-comp-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
#ig-comp-search { min-width: 220px; }

.ig-comp-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ig-comp-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ig-comp-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--border, #eee);
  flex-shrink: 0;
}
.ig-comp-avatar-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--panel-2, #eee);
  color: var(--text-2, #888);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.ig-comp-cell-text { display: flex; flex-direction: column; min-width: 0; }
.ig-comp-cell-username {
  font-weight: 600;
  color: var(--text, #1a1a1a);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}
.ig-comp-cell-name {
  font-size: 12px;
  color: var(--text-2, #888);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}
.ig-comp-row-link { cursor: pointer; }
.ig-comp-row-link:hover { background: var(--panel-2, #f5f5f5); }

.ig-active-pill {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--border, #e5e5e5);
  color: var(--text-2, #555);
}
.ig-active-pill.active { background: #d7f4e3; color: #157347; }
.ig-active-pill.inactive { background: var(--border, #e5e5e5); color: var(--text-2, #666); }
:root[data-theme="dark"] .ig-active-pill.active { background: #113826; color: #6fe3a3; }

.ig-comp-row-actions { display: flex; gap: 6px; }
.ig-comp-row-actions button {
  border: 1px solid var(--border, #e5e5e5);
  background: var(--panel, #fff);
  color: var(--text-2, #555);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}
.ig-comp-row-actions button:hover { background: var(--panel-2, #f5f5f5); }

.ig-comp-back-btn { margin-bottom: 4px; }

.ig-comp-ratios-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.ig-comp-ratio-chip {
  flex: 1 1 120px;
  background: var(--panel, #fff);
  border: 1px solid var(--border, #e5e5e5);
  border-radius: var(--radius-md, 8px);
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-2, #666);
}
.ig-comp-ratio-chip b { color: var(--text, #1a1a1a); font-size: 14px; }

/* ── نافذة إضافة/تعديل منافس ───────────────────────────────────────── */
.ig-comp-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.ig-comp-modal {
  background: var(--panel, #fff);
  border-radius: var(--radius-lg, 12px);
  width: 100%;
  max-width: 420px;
  padding: 18px 20px 22px;
  box-shadow: var(--shadow-card, 0 8px 30px rgba(0,0,0,.18));
}
.ig-comp-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.ig-comp-modal-title { font-size: 15px; font-weight: 700; color: var(--text, #1a1a1a); }
.ig-comp-modal-close {
  background: var(--panel-2, #f0f0f0);
  border: none;
  border-radius: 999px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  color: var(--text-2, #666);
}
.ig-comp-modal-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2, #555);
  margin-bottom: 6px;
}
.ig-comp-modal-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border, #e5e5e5);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 14px;
  background: var(--panel, #fff);
  color: var(--text, #1a1a1a);
}
.ig-comp-modal-hint { font-size: 12px; color: var(--text-2, #888); margin: 6px 0 0; }
.ig-comp-modal-error {
  font-size: 12.5px;
  color: #a02020;
  background: #fbdada;
  border-radius: 6px;
  padding: 8px 10px;
  margin: 10px 0 0;
}
:root[data-theme="dark"] .ig-comp-modal-error { background: #3a1414; color: #f0a3a3; }
.ig-comp-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

@media (max-width: 720px) {
  .ig-comp-filters { flex-direction: column; align-items: stretch; }
  #ig-comp-search { min-width: 0; }
  .ig-comp-cell-username, .ig-comp-cell-name { max-width: 120px; }
}
